[PATCH] merge: remove confusing comment about --force

Martin von Zweigbergk martinvonz at google.com
Wed Nov 19 16:51:11 UTC 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at 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).

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:



More information about the Mercurial-devel mailing list