[PATCH 1 of 3] copies: introduce a "silent" option for _computenonoverlap

Gábor Stefanik gabor.stefanik at nng.com
Thu Aug 4 15:22:59 UTC 2016


# HG changeset patch
# User Gábor Stefanik <gabor.stefanik at nng.com>
# Date 1470321442 -7200
#      Thu Aug 04 16:37:22 2016 +0200
# Node ID 74f67f7f8cf5a21b3107437df65afdcc34575217
# Parent  73ff159923c1f05899c27238409ca398342d9ae0
copies: introduce a "silent" option for _computenonoverlap

This enables computing exclusive files without printing debug messages.

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -231,7 +231,7 @@
     return _chain(x, y, _backwardrenames(x, a),
                   _forwardcopies(a, y, match=match))
 
-def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2):
+def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, silent=False):
     """Computes, based on addedinm1 and addedinm2, the files exclusive to c1
     and c2. This is its own function so extensions can easily wrap this call
     to see what files mergecopies is about to process.
@@ -242,10 +242,10 @@
     u1 = sorted(addedinm1 - addedinm2)
     u2 = sorted(addedinm2 - addedinm1)
 
-    if u1:
+    if u1 and not silent:
         repo.ui.debug("  unmatched files in local:\n   %s\n"
                       % "\n   ".join(u1))
-    if u2:
+    if u2 and not silent:
         repo.ui.debug("  unmatched files in other:\n   %s\n"
                       % "\n   ".join(u2))
     return u1, u2


More information about the Mercurial-devel mailing list