Patchwork [4,of,4] largefiles: stylistic cleanup of filemerge

login
register
mail settings
Submitter Mads Kiilerich
Date Jan. 12, 2014, 10:54 p.m.
Message ID <88e340720dc2ea9204da.1389567293@localhost.localdomain>
Download mbox | patch
Permalink /patch/3319/
State Accepted
Commit 9d350fa0708e56333270e2a606f42c3422f23258
Headers show

Comments

Mads Kiilerich - Jan. 12, 2014, 10:54 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1384635281 18000
#      Sat Nov 16 15:54:41 2013 -0500
# Node ID 88e340720dc2ea9204daf5e8803f87f43789f66e
# Parent  0d349e04802a28e57f0490ba414b267bebd3e04e
largefiles: stylistic cleanup of filemerge
Matt Mackall - Jan. 18, 2014, 4:09 a.m.
On Sun, 2014-01-12 at 23:54 +0100, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1384635281 18000
> #      Sat Nov 16 15:54:41 2013 -0500
> # Node ID 88e340720dc2ea9204daf5e8803f87f43789f66e
> # Parent  0d349e04802a28e57f0490ba414b267bebd3e04e
> largefiles: stylistic cleanup of filemerge

These are queued for default, thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -417,26 +417,21 @@  def overridemanifestmerge(origfn, repo, 
 # Override filemerge to prompt the user about how they wish to merge
 # largefiles. This will handle identical edits without prompting the user.
 def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca):
-    # Use better variable names here. Because this is a wrapper we cannot
-    # change the variable names in the function declaration.
-    fcdest, fcother, fcancestor = fcd, fco, fca
     if not lfutil.isstandin(orig):
-        return origfn(repo, mynode, orig, fcdest, fcother, fcancestor)
-    else:
-        if not fcother.cmp(fcdest): # files identical?
-            return None
+        return origfn(repo, mynode, orig, fcd, fco, fca)
 
-        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())
-            return 0
+    if not fco.cmp(fcd): # files identical?
+        return None
+
+    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) == 1:
+        repo.wwrite(fcd.path(), fco.data(), fco.flags())
+    return 0
 
 # Copy first changes the matchers to match standins instead of
 # largefiles.  Then it overrides util.copyfile in that function it