Mercurial > hg-stable
comparison hgext/win32text.py @ 35675:01496e9269f9
win32text: use 'tiprev' when appropriate
This is cleaner than the current 'len(repo) - 1' form.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 17 Jan 2018 13:02:42 +0100 |
parents | f84358f75978 |
children | f0b6fbea00cf |
comparison
equal
deleted
inserted
replaced
35674:e711906aa42c | 35675:01496e9269f9 |
---|---|
137 # oldest, so that if we see a file multiple times, we take the | 137 # oldest, so that if we see a file multiple times, we take the |
138 # newest version as canonical. this prevents us from blocking a | 138 # newest version as canonical. this prevents us from blocking a |
139 # changegroup that contains an unacceptable commit followed later | 139 # changegroup that contains an unacceptable commit followed later |
140 # by a commit that fixes the problem. | 140 # by a commit that fixes the problem. |
141 tip = repo['tip'] | 141 tip = repo['tip'] |
142 for rev in xrange(len(repo) - 1, repo[node].rev() - 1, -1): | 142 for rev in xrange(repo.changelog.tiprev(), repo[node].rev() - 1, -1): |
143 c = repo[rev] | 143 c = repo[rev] |
144 for f in c.files(): | 144 for f in c.files(): |
145 if f in seen or f not in tip or f not in c: | 145 if f in seen or f not in tip or f not in c: |
146 continue | 146 continue |
147 seen.add(f) | 147 seen.add(f) |