From patchwork Sat Jan 2 11:25:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,7,checkunknown] checkunknownfiles: make control flow clearer From: Siddharth Agarwal X-Patchwork-Id: 12473 Message-Id: <4aa62d749fccdbc64ac4.1451733907@dev666.prn1.facebook.com> To: Date: Sat, 2 Jan 2016 03:25:07 -0800 # HG changeset patch # User Siddharth Agarwal # 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. 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':