make stash ID argument to "stash show" optional
This commit is contained in:
parent
3b4944f6f7
commit
09a6f91f49
1
README
1
README
@ -66,6 +66,7 @@ Implemented subcommands:
|
|||||||
- <id> defaults to the newest stash object created
|
- <id> defaults to the newest stash object created
|
||||||
show [id]:
|
show [id]:
|
||||||
- display the diff stored in stash with ID <id>
|
- display the diff stored in stash with ID <id>
|
||||||
|
- <id> defaults to the newest stash object created
|
||||||
drop [id]:
|
drop [id]:
|
||||||
- delete stash object <id>
|
- delete stash object <id>
|
||||||
- <id> defaults to the newest stash object created
|
- <id> defaults to the newest stash object created
|
||||||
|
7
jsvn
7
jsvn
@ -68,6 +68,7 @@
|
|||||||
# - <id> defaults to the newest stash object created
|
# - <id> defaults to the newest stash object created
|
||||||
# show [id]:
|
# show [id]:
|
||||||
# - display the diff stored in stash with ID <id>
|
# - display the diff stored in stash with ID <id>
|
||||||
|
# - <id> defaults to the newest stash object created
|
||||||
# drop [id]:
|
# drop [id]:
|
||||||
# - delete stash object <id>
|
# - delete stash object <id>
|
||||||
# - <id> defaults to the newest stash object created
|
# - <id> defaults to the newest stash object created
|
||||||
@ -843,9 +844,11 @@ def stash(argv, svn, out):
|
|||||||
out.write('No stashes to pop\n')
|
out.write('No stashes to pop\n')
|
||||||
os.chdir(owd)
|
os.chdir(owd)
|
||||||
elif action == 'show':
|
elif action == 'show':
|
||||||
|
stash_ids = get_stash_ids(svn)
|
||||||
|
if len(stash_ids) > 0:
|
||||||
|
stash_id = stash_ids[-1]
|
||||||
if len(argv) >= 3:
|
if len(argv) >= 3:
|
||||||
stash_id = int(argv[2])
|
stash_id = int(argv[2])
|
||||||
stash_ids = get_stash_ids(svn)
|
|
||||||
if stash_id in stash_ids:
|
if stash_id in stash_ids:
|
||||||
stash_fname = get_stash_fname(svn, stash_id)
|
stash_fname = get_stash_fname(svn, stash_id)
|
||||||
fd = open(stash_fname, 'r')
|
fd = open(stash_fname, 'r')
|
||||||
@ -855,7 +858,7 @@ def stash(argv, svn, out):
|
|||||||
else:
|
else:
|
||||||
out.write('Invalid stash ID\n')
|
out.write('Invalid stash ID\n')
|
||||||
else:
|
else:
|
||||||
out.write('Usage: stash show <ID>\n')
|
out.write('No stashes to show\n')
|
||||||
elif action == 'drop':
|
elif action == 'drop':
|
||||||
stash_ids = get_stash_ids(svn)
|
stash_ids = get_stash_ids(svn)
|
||||||
if len(stash_ids) > 0:
|
if len(stash_ids) > 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user