changeset 20297:8f412d034173

largefiles: show hashes before prompting for conflict resolution The largefile hashes are mostly an implementation detail, but they are "leaked" in several places anyway, and showing the hashes is better than not giving the user any information about the options in the prompt. The hashes are long, but it is largefile hashes and it would thus be confusing to shorten them.
author Mads Kiilerich <madski@unity3d.com>
date Sat, 16 Nov 2013 15:46:29 -0500
parents 675f578856dd
children 9d350fa0708e
files hgext/largefiles/overrides.py tests/test-largefiles.t
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py	Sat Nov 16 15:46:29 2013 -0500
+++ b/hgext/largefiles/overrides.py	Sat Nov 16 15:46:29 2013 -0500
@@ -426,10 +426,13 @@
         if not fcother.cmp(fcdest): # files identical?
             return None
 
-        if repo.ui.promptchoice(_('largefile %s has a merge conflict\n'
-                                  'keep (l)ocal or take (o)ther?'
-                                  '$$ &Local $$ &Other') %
-                                lfutil.splitstandin(orig), 0) == 0:
+        if repo.ui.promptchoice(
+            _('largefile %s has a merge conflict\nancestor was %s\n'
+              'keep (l)ocal %s or\ntake (o)ther %s?'
+              '$$ &Local $$ &Other') %
+              (lfutil.splitstandin(orig),
+               fca.data().strip(), fcd.data().strip(), fco.data().strip()),
+            0) == 0:
             return 0
         else:
             repo.wwrite(fcdest.path(), fcother.data(), fcother.flags())
--- a/tests/test-largefiles.t	Sat Nov 16 15:46:29 2013 -0500
+++ b/tests/test-largefiles.t	Sat Nov 16 15:46:29 2013 -0500
@@ -1375,7 +1375,9 @@
   2 largefiles cached
   $ hg merge
   largefile sub/large4 has a merge conflict
-  keep (l)ocal or take (o)ther? l
+  ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
+  keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
+  take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
   3 files updated, 1 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   getting changed largefiles