Mercurial > hg
comparison mercurial/context.py @ 31991:55987fc8aba1
context: add an assertion checking linerange consistency in blockdescendants()
If this assertion fails, this indicates a flaw in the algorithm. So fail fast
instead of possibly producing wrong results.
Also extend the target line range in test to catch a merge changeset with all
its parents.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Fri, 14 Apr 2017 14:09:26 +0200 |
parents | 4c2c30bc38b4 |
children | 3e47a40d7a7a |
comparison
equal
deleted
inserted
replaced
31990:3e03a4b9ec8c | 31991:55987fc8aba1 |
---|---|
1224 except KeyError: | 1224 except KeyError: |
1225 # nullrev or other branch | 1225 # nullrev or other branch |
1226 continue | 1226 continue |
1227 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts) | 1227 inrangep, linerange1 = _changesrange(c, p, linerange2, diffopts) |
1228 inrange = inrange or inrangep | 1228 inrange = inrange or inrangep |
1229 # If revision 'i' has been seen (it's a merge), we assume that its | |
1230 # line range is the same independently of which parents was used | |
1231 # to compute it. | |
1232 assert i not in seen or seen[i][1] == linerange1, ( | |
1233 'computed line range for %s is not consistent between ' | |
1234 'ancestor branches' % c) | |
1229 seen[i] = c, linerange1 | 1235 seen[i] = c, linerange1 |
1230 if inrange: | 1236 if inrange: |
1231 yield c, linerange1 | 1237 yield c, linerange1 |
1232 | 1238 |
1233 class committablectx(basectx): | 1239 class committablectx(basectx): |