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

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 12, 2014, 10:54 p.m.
Message ID <0d349e04802a28e57f04.1389567292@localhost.localdomain>
Download mbox | patch
Permalink /patch/3318/
State Accepted
Commit 8f412d03417375896e5b76372a706883bbd38d9a
Headers show

Comments

Mads Kiilerich - Jan. 12, 2014, 10:54 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@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.

Patch

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