Commits

Yuya Nishihara  committed 41f14e3

chunks: use regexp to capture .rej filename from non-English message

If "saving rejects to file %s" is translated, it does not always end with
".rej".

  • Participants
  • Parent commits c04997b
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/chunks.py

 # of the GNU General Public License, incorporated herein by reference.
 
 import cStringIO
-import os
+import os, re
 
 from mercurial import hg, util, patch, commands, cmdutil
 from mercurial import match as matchmod, ui as uimod
         except (patch.PatchError, EnvironmentError), err:
             ok = False
             self.showMessage.emit(hglib.tounicode(str(err)))
+        rejfilere = re.compile(r'\b%s\.rej\b' % re.escape(wfile))
         for line in ui.popbuffer().splitlines():
-            if line.endswith(wfile + '.rej'):
+            if rejfilere.search(line):
                 if qtlib.QuestionMsgBox(_('Manually resolve rejected chunks?'),
                                         hglib.tounicode(line) + u'<br><br>' +
                                         _('Edit patched file and rejects?'),