summaryrefslogtreecommitdiff
path: root/.hgext/hgshelve.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-11-12 01:12:07 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-11-12 01:12:07 +0100
commitd7cb71a927bf3d2d085fc0d3342f81a51eb93879 (patch)
treefce77e5d366ec3acb35c8969df3f0d6d8be902d5 /.hgext/hgshelve.py
parent6cc703479f7af518534a33de8a7c1c1bf01af6d2 (diff)
downloaddotfiles-d7cb71a927bf3d2d085fc0d3342f81a51eb93879.tar.gz
dotfiles-d7cb71a927bf3d2d085fc0d3342f81a51eb93879.tar.bz2
dotfiles-d7cb71a927bf3d2d085fc0d3342f81a51eb93879.zip
Well ... now hgshelve was more up2date than hg ^^.
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):