Patchwork merge: remove confusing comment about --force

login
register
mail settings
Submitter Martin von Zweigbergk
Date Nov. 19, 2014, 4:51 p.m.
Message ID <c040fe749c072b4db299.1416415871@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6799/
State Accepted
Commit cc83cac41619b32375b28f821237fb0747010b80
Headers show

Comments

Martin von Zweigbergk - Nov. 19, 2014, 4:51 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1416415808 28800
#      Wed Nov 19 08:50:08 2014 -0800
# Node ID c040fe749c072b4db2990660da682a8db919fc83
# Parent  e63941631a3f61b3323dbcc2545689b1eb34e308
merge: remove confusing comment about --force

manifestmerge() has a piece of code that's roughly:

  if not force and different:
      abort
  else:
      # if different: old untracked f may be overwritten and lost
      ...

The comment only talks about what happens when 'different' is true,
and in combination with the if-block above, that must mean that it is
only about what happens when 'force and different'. It seems quite
fine that files are overwritten when 'force' is true, so let's remove
the comment. As it stands, it can easily be interpreted as a TODO
(which is how I interpreted it at first).
Matt Mackall - Nov. 19, 2014, 5:02 p.m.
On Wed, 2014-11-19 at 08:51 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1416415808 28800
> #      Wed Nov 19 08:50:08 2014 -0800
> # Node ID c040fe749c072b4db2990660da682a8db919fc83
> # Parent  e63941631a3f61b3323dbcc2545689b1eb34e308
> merge: remove confusing comment about --force

Sure, queued for default.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -512,7 +512,6 @@ 
             if not force and different:
                 aborts.append((f, "ud"))
             else:
-                # if different: old untracked f may be overwritten and lost
                 if acceptremote:
                     actions['g'].append((f, (fl2,), "remote recreating"))
                 else: