Show More
@@ -24,6 +24,7 b' from . import (' | |||||
24 | registrar, |
|
24 | registrar, | |
25 | repoview, |
|
25 | repoview, | |
26 | revsetlang, |
|
26 | revsetlang, | |
|
27 | scmutil, | |||
27 | smartset, |
|
28 | smartset, | |
28 | util, |
|
29 | util, | |
29 | ) |
|
30 | ) | |
@@ -190,7 +191,7 b' def _getrevsource(repo, r):' | |||||
190 | # operator methods |
|
191 | # operator methods | |
191 |
|
192 | |||
192 | def stringset(repo, subset, x): |
|
193 | def stringset(repo, subset, x): | |
193 |
x = repo[x] |
|
194 | x = scmutil.intrev(repo[x]) | |
194 | if (x in subset |
|
195 | if (x in subset | |
195 | or x == node.nullrev and isinstance(subset, fullreposet)): |
|
196 | or x == node.nullrev and isinstance(subset, fullreposet)): | |
196 | return baseset([x]) |
|
197 | return baseset([x]) | |
@@ -1297,13 +1298,18 b' def node_(repo, subset, x):' | |||||
1297 | if len(n) == 40: |
|
1298 | if len(n) == 40: | |
1298 | try: |
|
1299 | try: | |
1299 | rn = repo.changelog.rev(node.bin(n)) |
|
1300 | rn = repo.changelog.rev(node.bin(n)) | |
|
1301 | except error.WdirUnsupported: | |||
|
1302 | rn = node.wdirrev | |||
1300 | except (LookupError, TypeError): |
|
1303 | except (LookupError, TypeError): | |
1301 | rn = None |
|
1304 | rn = None | |
1302 | else: |
|
1305 | else: | |
1303 | rn = None |
|
1306 | rn = None | |
1304 | pm = repo.changelog._partialmatch(n) |
|
1307 | pm = repo.changelog._partialmatch(n) | |
1305 | if pm is not None: |
|
1308 | if pm is not None: | |
1306 | rn = repo.changelog.rev(pm) |
|
1309 | try: | |
|
1310 | rn = repo.changelog.rev(pm) | |||
|
1311 | except error.WdirUnsupported: | |||
|
1312 | rn = node.wdirrev | |||
1307 |
|
1313 | |||
1308 | if rn is None: |
|
1314 | if rn is None: | |
1309 | return baseset() |
|
1315 | return baseset() | |
@@ -1620,7 +1626,7 b' def rev(repo, subset, x):' | |||||
1620 | except (TypeError, ValueError): |
|
1626 | except (TypeError, ValueError): | |
1621 | # i18n: "rev" is a keyword |
|
1627 | # i18n: "rev" is a keyword | |
1622 | raise error.ParseError(_("rev expects a number")) |
|
1628 | raise error.ParseError(_("rev expects a number")) | |
1623 |
if l not in repo.changelog and l |
|
1629 | if l not in repo.changelog and l not in (node.nullrev, node.wdirrev): | |
1624 | return baseset() |
|
1630 | return baseset() | |
1625 | return subset & baseset([l]) |
|
1631 | return subset & baseset([l]) | |
1626 |
|
1632 |
@@ -1280,6 +1280,20 b' For tests consistency' | |||||
1280 | $ log '(all() + wdir()) & last(. + wdir())' |
|
1280 | $ log '(all() + wdir()) & last(. + wdir())' | |
1281 | 2147483647 |
|
1281 | 2147483647 | |
1282 |
|
1282 | |||
|
1283 | Test working-directory integer revision and node id | |||
|
1284 | (BUG: '0:wdir()' is still needed to populate wdir revision) | |||
|
1285 | ||||
|
1286 | $ hg debugrevspec '0:wdir() & 2147483647' | |||
|
1287 | 2147483647 | |||
|
1288 | $ hg debugrevspec '0:wdir() & rev(2147483647)' | |||
|
1289 | 2147483647 | |||
|
1290 | $ hg debugrevspec '0:wdir() & ffffffffffffffffffffffffffffffffffffffff' | |||
|
1291 | 2147483647 | |||
|
1292 | $ hg debugrevspec '0:wdir() & id(ffffffffffffffffffffffffffffffffffffffff)' | |||
|
1293 | 2147483647 | |||
|
1294 | $ hg debugrevspec '0:wdir() & id(ffffffffffff)' | |||
|
1295 | BROKEN: should be '2147483647' | |||
|
1296 | ||||
1283 | $ log 'outgoing()' |
|
1297 | $ log 'outgoing()' | |
1284 | 8 |
|
1298 | 8 | |
1285 | 9 |
|
1299 | 9 |
General Comments 0
You need to be logged in to leave comments.
Login now