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

Siddharth Agarwal sid0 at fb.com
Sat Jan 2 05:25:08 CST 2016


# HG changeset patch
# User Siddharth Agarwal <sid0 at 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.

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)


More information about the Mercurial-devel mailing list