Patchwork largefiles: remove redundant checks for false modify/delete conflicts

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 5, 2014, 8:04 p.m.
Message ID <0bc1138d98e9dd2f0d2d.1417809848@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7014/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Dec. 5, 2014, 8:04 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417805605 28800
#      Fri Dec 05 10:53:25 2014 -0800
# Node ID 0bc1138d98e9dd2f0d2d1eaad4b31cb7bf04bdfd
# Parent  406dfc63a1ad71213dccc1a45de99a3c5d5ac460
largefiles: remove redundant checks for false modify/delete conflicts

In a34a99181f36 (largefiles: don't show largefile/normal prompts if
one side is unchanged, 2014-12-01), overridecalculateupdates() started
checking for false modify/delete conflicts in large files and their
standins. Then, in the very next changeset, 902554884335 (merge:
before cd/dc prompt, check that changed side really changed,
2014-12-01), calculateupdates() itself started checking for false
modify/delete conflicts in all files. Since "large files and their
standins" is a subset of "all files", we can now drop the checks in
overridecalculateupdates().
Matt Mackall - Dec. 5, 2014, 8:07 p.m.
On Fri, 2014-12-05 at 12:04 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1417805605 28800
> #      Fri Dec 05 10:53:25 2014 -0800
> # Node ID 0bc1138d98e9dd2f0d2d1eaad4b31cb7bf04bdfd
> # Parent  406dfc63a1ad71213dccc1a45de99a3c5d5ac460
> largefiles: remove redundant checks for false modify/delete conflicts

Looks reasonable, queued.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -440,15 +440,7 @@ 
             usermsg = _('remote turned local normal file %s into a largefile\n'
                         'use (l)argefile or keep (n)ormal file?'
                         '$$ &Largefile $$ &Normal file') % lfile
-            if (# local has unchanged normal file, pick remote largefile
-                pas and lfile in pas[0] and
-                not pas[0][lfile].cmp(p1[lfile]) or
-                # if remote has unchanged largefile, pick local normal file
-                not (pas and standin in pas[0] and
-                     not pas[0][standin].cmp(p2[standin])) and
-                # else, prompt
-                repo.ui.promptchoice(usermsg, 0) == 0
-                ): # pick remote largefile
+            if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
                 actions['r'].append((lfile, None, 'replaced by standin'))
                 newglist.append((standin, (p2.flags(standin),), msg))
             else: # keep local normal file
@@ -461,15 +453,7 @@ 
             usermsg = _('remote turned local largefile %s into a normal file\n'
                     'keep (l)argefile or use (n)ormal file?'
                     '$$ &Largefile $$ &Normal file') % lfile
-            if (# if remote has unchanged normal file, pick local largefile
-                pas and f in pas[0] and
-                not pas[0][f].cmp(p2[f]) or
-                # if local has unchanged largefile, pick remote normal file
-                not (pas and standin in pas[0] and
-                     not pas[0][standin].cmp(p1[standin])) and
-                # else, prompt
-                repo.ui.promptchoice(usermsg, 0) == 0
-                ): # keep local largefile
+            if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile
                 if branchmerge:
                     # largefile can be restored from standin safely
                     actions['r'].append((lfile, None, 'replaced by standin'))