# HG changeset patch # User Pierre-Yves David # Date 1476741643 -7200 # Node ID d738cda708945469fb852aeac8225e1a5375a438 # Parent 88626de195f80753e144ed9e36ede7c9d9c4d2f5 copies: make it possible to distinguish betwen _computenonoverlap invocations _computenonoverlap needs to be invoked twice during a graft, and debugging messages should be distinguishable between the two invocations diff -r 88626de195f8 -r d738cda70894 mercurial/copies.py --- a/mercurial/copies.py Thu Oct 13 02:03:54 2016 +0200 +++ b/mercurial/copies.py Tue Oct 18 00:00:43 2016 +0200 @@ -231,23 +231,27 @@ 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, baselabel=''): """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. Even though c1 and c2 are not used in this function, they are useful in other extensions for being able to read the file nodes of the changed files. + + "baselabel" can be passed to help distinguish the multiple computations + done in the graft case. """ u1 = sorted(addedinm1 - addedinm2) u2 = sorted(addedinm2 - addedinm1) + header = " unmatched files in %s" + if baselabel: + header += ' (from %s)' % baselabel if u1: - repo.ui.debug(" unmatched files in local:\n %s\n" - % "\n ".join(u1)) + repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1))) if u2: - repo.ui.debug(" unmatched files in other:\n %s\n" - % "\n ".join(u2)) + repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2))) return u1, u2 def _makegetfctx(ctx):