Patchwork [3,of,7,checkunknown] checkunknownfiles: make control flow clearer

login
register
mail settings
Submitter Siddharth Agarwal
Date Jan. 2, 2016, 11:25 a.m.
Message ID <4aa62d749fccdbc64ac4.1451733907@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/12473/
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 4aa62d749fccdbc64ac464c69cf3b34a9ed9beb9
# Parent  0fe2d217d1a7700f58ddecd081642d2bbe58ce16
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r 4aa62d749fcc
checkunknownfiles: make control flow clearer

In particular, make it clear that we only check for and abort on conflicts if
force is not true.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -580,11 +580,11 @@  def _checkunknownfiles(repo, wctx, mctx,
                 if _checkunknownfile(repo, wctx, mctx, f, args[0]):
                     conflicts.append(f)
 
-    for f in sorted(conflicts):
-        repo.ui.warn(_("%s: untracked file differs\n") % f)
-    if conflicts:
-        raise error.Abort(_("untracked files in working directory differ "
-                           "from files in requested revision"))
+        for f in sorted(conflicts):
+            repo.ui.warn(_("%s: untracked file differs\n") % f)
+        if conflicts:
+            raise error.Abort(_("untracked files in working directory differ "
+                                "from files in requested revision"))
 
     for f, (m, args, msg) in actions.iteritems():
         if m == 'c':