Patchwork [4,of,7,checkunknown] _checkunknownfiles: turn 'conflicts' into a set

login
register
mail settings
Submitter Siddharth Agarwal
Date Jan. 2, 2016, 11:25 a.m.
Message ID <34ef5002224a71e6a48c.1451733908@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/12477/
State Accepted
Delegated to: Martin von Zweigbergk
Headers show

Comments

Siddharth Agarwal - Jan. 2, 2016, 11:25 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1451732577 28800
#      Sat Jan 02 03:02:57 2016 -0800
# Node ID 34ef5002224a71e6a48c2c5e7f1bb180ec1a8e12
# Parent  4aa62d749fccdbc64ac464c69cf3b34a9ed9beb9
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 34ef5002224a
_checkunknownfiles: turn 'conflicts' into a set

We'll check for membership in this set in an upcoming patch.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -570,15 +570,15 @@  def _checkunknownfiles(repo, wctx, mctx,
     files. For some actions, the result is to abort; for others, it is to
     choose a different action.
     """
-    conflicts = []
+    conflicts = set()
     if not force:
         for f, (m, args, msg) in actions.iteritems():
             if m in ('c', 'dc'):
                 if _checkunknownfile(repo, wctx, mctx, f):
-                    conflicts.append(f)
+                    conflicts.add(f)
             elif m == 'dg':
                 if _checkunknownfile(repo, wctx, mctx, f, args[0]):
-                    conflicts.append(f)
+                    conflicts.add(f)
 
         for f in sorted(conflicts):
             repo.ui.warn(_("%s: untracked file differs\n") % f)