change stash subcommands to require "--" prefix
This commit is contained in:
parent
cec02602a0
commit
ee592451b5
46
jsvn
46
jsvn
@ -1233,12 +1233,7 @@ def revert_h(argv, svn, out, config):
|
|||||||
break
|
break
|
||||||
return RET_OK if did_something else RET_REEXEC
|
return RET_OK if did_something else RET_REEXEC
|
||||||
|
|
||||||
def stash_save_h(argv, svn, out, config):
|
def stash_save_h(args, svn, out, config, keep_wc):
|
||||||
keep_wc = False
|
|
||||||
options, args = getopt.getopt(argv, 'k')
|
|
||||||
for opt, val in options:
|
|
||||||
if opt == '-k':
|
|
||||||
keep_wc = True
|
|
||||||
owd = os.getcwd()
|
owd = os.getcwd()
|
||||||
wc_dir = get_svn_wc_root(svn)
|
wc_dir = get_svn_wc_root(svn)
|
||||||
os.chdir(wc_dir)
|
os.chdir(wc_dir)
|
||||||
@ -1380,12 +1375,7 @@ def stash_list_h(argv, svn, out, config):
|
|||||||
out.write('\n')
|
out.write('\n')
|
||||||
return RET_OK
|
return RET_OK
|
||||||
|
|
||||||
def stash_pop_h(argv, svn, out, config):
|
def stash_pop_h(args, svn, out, config, keep):
|
||||||
keep = False
|
|
||||||
options, args = getopt.getopt(argv, 'k')
|
|
||||||
for opt, val in options:
|
|
||||||
if opt == '-k':
|
|
||||||
keep = True
|
|
||||||
owd = os.getcwd()
|
owd = os.getcwd()
|
||||||
wc_dir = get_svn_wc_root(svn)
|
wc_dir = get_svn_wc_root(svn)
|
||||||
os.chdir(wc_dir)
|
os.chdir(wc_dir)
|
||||||
@ -1443,23 +1433,21 @@ def stash_drop_h(argv, svn, out, config):
|
|||||||
|
|
||||||
def stash_h(argv, svn, out, config):
|
def stash_h(argv, svn, out, config):
|
||||||
argv = argv[1:] # strip 'stash' command
|
argv = argv[1:] # strip 'stash' command
|
||||||
action = 'save'
|
opts, args = getopt.getopt(argv, 'k',
|
||||||
if len(argv) >= 1:
|
['list', 'pop', 'show', 'drop'])
|
||||||
if not argv[0].startswith('-'):
|
keep = False
|
||||||
action = argv[0]
|
for opt, arg in opts:
|
||||||
argv = argv[1:]
|
if opt == '--list':
|
||||||
# now argv only contains options/arguments to the stash subcommand itself
|
return stash_list_h(args, svn, out, config)
|
||||||
actions = {
|
if opt == '--pop':
|
||||||
'save': stash_save_h,
|
return stash_pop_h(args, svn, out, config, keep)
|
||||||
'list': stash_list_h,
|
if opt == '--show':
|
||||||
'pop': stash_pop_h,
|
return stash_show_h(args, svn, out, config)
|
||||||
'show': stash_show_h,
|
if opt == '--drop':
|
||||||
'drop': stash_drop_h
|
return stash_drop_h(args, svn, out, config)
|
||||||
}
|
if opt == '-k':
|
||||||
if action in actions:
|
keep = True
|
||||||
return actions[action](argv, svn, out, config)
|
return stash_save_h(args, svn, out, config, keep)
|
||||||
sys.stderr.write('Unknown action "%s"\n' % action)
|
|
||||||
return RET_ERR
|
|
||||||
|
|
||||||
def root_h(argv, svn, out, config):
|
def root_h(argv, svn, out, config):
|
||||||
out.write(get_svn_root_url(svn) + '\n')
|
out.write(get_svn_root_url(svn) + '\n')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user