[PATCH 3 of 4] largefiles: show hashes before prompting for conflict resolution

Mads Kiilerich mads at kiilerich.com
Sun Jan 12 16:54:52 CST 2014


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1384634789 18000
#      Sat Nov 16 15:46:29 2013 -0500
# Node ID 0d349e04802a28e57f0490ba414b267bebd3e04e
# Parent  b9f519eaee350620586fd098f6379a307e333834
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.

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -426,10 +426,13 @@ def overridefilemerge(origfn, repo, myno
         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())
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -1375,7 +1375,9 @@ correctly.
   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


More information about the Mercurial-devel mailing list