equal
deleted
inserted
replaced
46 from mercurial.i18n import _ |
46 from mercurial.i18n import _ |
47 from mercurial.node import short |
47 from mercurial.node import short |
48 from mercurial import ( |
48 from mercurial import ( |
49 cmdutil, |
49 cmdutil, |
50 extensions, |
50 extensions, |
51 pycompat, |
|
52 registrar, |
51 registrar, |
53 ) |
52 ) |
54 from mercurial.utils import stringutil |
53 from mercurial.utils import stringutil |
55 |
54 |
56 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
55 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
154 # oldest, so that if we see a file multiple times, we take the |
153 # oldest, so that if we see a file multiple times, we take the |
155 # newest version as canonical. this prevents us from blocking a |
154 # newest version as canonical. this prevents us from blocking a |
156 # changegroup that contains an unacceptable commit followed later |
155 # changegroup that contains an unacceptable commit followed later |
157 # by a commit that fixes the problem. |
156 # by a commit that fixes the problem. |
158 tip = repo[b'tip'] |
157 tip = repo[b'tip'] |
159 for rev in pycompat.xrange( |
158 for rev in range(repo.changelog.tiprev(), repo[node].rev() - 1, -1): |
160 repo.changelog.tiprev(), repo[node].rev() - 1, -1 |
|
161 ): |
|
162 c = repo[rev] |
159 c = repo[rev] |
163 for f in c.files(): |
160 for f in c.files(): |
164 if f in seen or f not in tip or f not in c: |
161 if f in seen or f not in tip or f not in c: |
165 continue |
162 continue |
166 seen.add(f) |
163 seen.add(f) |