Patchwork D2188: narrowrevlog: add what little I can remember about rename filtering

login
register
mail settings
Submitter phabricator
Date Feb. 12, 2018, 8:03 p.m.
Message ID <differential-rev-PHID-DREV-k7pxgqwv5oznxvwojocp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27681/
State Superseded
Headers show

Comments

phabricator - Feb. 12, 2018, 8:03 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2188

AFFECTED FILES
  hgext/narrow/narrowrevlog.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/narrow/narrowrevlog.py b/hgext/narrow/narrowrevlog.py
--- a/hgext/narrow/narrowrevlog.py
+++ b/hgext/narrow/narrowrevlog.py
@@ -139,6 +139,12 @@ 
 def makenarrowfilelog(fl, narrowmatch):
     class narrowfilelog(fl.__class__):
         def renamed(self, node):
+            # Renames that come from outside the narrowspec are
+            # problematic at least for git-diffs, because we lack the
+            # base text for the rename. This logic was introduced in
+            # 3cd72b1 of narrowhg (authored by martinvonz, reviewed by
+            # adgar), but that revision doesn't have any additional
+            # commentary on what problems we can encounter.
             m = super(narrowfilelog, self).renamed(node)
             if m and not narrowmatch(m[0]):
                 return None