summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.hgext/hgshelve.py33
1 files changed, 15 insertions, 18 deletions
diff --git a/.hgext/hgshelve.py b/.hgext/hgshelve.py
index 4e0c121..6d7b27d 100644
--- a/.hgext/hgshelve.py
+++ b/.hgext/hgshelve.py
@@ -36,7 +36,8 @@ def internalpatch(patchobj, ui, strip, cwd, reverse=False, files={}):
curdir = os.getcwd()
os.chdir(cwd)
try:
- ret = patch.applydiff(ui, fp, files, strip=strip, eol=eol)
+ ret = patch.applydiff(ui, fp, files, strip=strip,
+ reverse=reverse, eol=eol)
finally:
if cwd:
os.chdir(curdir)
@@ -303,7 +304,6 @@ def filterpatch(ui, chunks, shouldprompt=True):
if resp_file[0] is not None:
return resp_file[0]
while True:
- resps = _('[Ynsfdaq?]')
choices = (_('&Yes, shelve this change'),
_('&No, skip this change'),
_('&Skip remaining changes to this file'),
@@ -312,27 +312,24 @@ def filterpatch(ui, chunks, shouldprompt=True):
_('Shelve &all changes to all remaining files'),
_('&Quit, shelving no changes'),
_('&?'))
- r = ui.promptchoice("%s %s " % (query, resps), choices)
- if r == 7:
+ r = (ui.prompt(query + _(' [Ynsfdaq?] '), choices)
+ or 'y').lower()
+ if r == '?':
c = shelve.__doc__.find('y - shelve this change')
for l in shelve.__doc__[c:].splitlines():
if l: ui.write(_(l.strip()) + '\n')
continue
- elif r == 0: # yes
- ret = 'y'
- elif r == 1: # no
- ret = 'n'
- elif r == 2: # Skip
- ret = resp_file[0] = 'n'
- elif r == 3: # file (shelve remaining)
- ret = resp_file[0] = 'y'
- elif r == 4: # done, skip remaining
- ret = resp_all[0] = 'n'
- elif r == 5: # all
- ret = resp_all[0] = 'y'
- elif r == 6: # quit
+ elif r == 's':
+ r = resp_file[0] = 'n'
+ elif r == 'f':
+ r = resp_file[0] = 'y'
+ elif r == 'd':
+ r = resp_all[0] = 'n'
+ elif r == 'a':
+ r = resp_all[0] = 'y'
+ elif r == 'q':
raise util.Abort(_('user quit'))
- return ret
+ return r
while chunks:
chunk = chunks.pop()
if isinstance(chunk, header):