Commits

TK Soh committed 276d808

update to upcoming mercurial 1.4 (1de5ebfa5585)

  • Participants
  • Parent commits 3920be7
  • Tags hg-1.4

Comments (0)

Files changed (1)

         curdir = os.getcwd()
         os.chdir(cwd)
     try:
-        ret = patch.applydiff(ui, fp, files, strip=strip, 
-                              reverse=reverse, eol=eol)
+        ret = patch.applydiff(ui, fp, files, strip=strip, eol=eol)
     finally:
         if cwd:
             os.chdir(curdir)
         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'),
                     _('Shelve &all changes to all remaining files'),
                     _('&Quit, shelving no changes'),
                     _('&?'))
-            r = (ui.prompt(query + _(' [Ynsfdaq?] '), choices)
-                 or 'y').lower()
-            if r == '?':
+            r = ui.promptchoice("%s %s " % (query, resps), choices)
+            if r == 7:
                 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 == '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':
+            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
                 raise util.Abort(_('user quit'))
-            return r
+            return ret
     while chunks:
         chunk = chunks.pop()
         if isinstance(chunk, header):