Show More
@@ -2474,10 +2474,20 b' def sort(repo, subset, x, order):' | |||||
2474 | return revs |
|
2474 | return revs | |
2475 | elif keyflags[0][0] == b"topo": |
|
2475 | elif keyflags[0][0] == b"topo": | |
2476 | firstbranch = () |
|
2476 | firstbranch = () | |
|
2477 | parentrevs = repo.changelog.parentrevs | |||
|
2478 | parentsfunc = parentrevs | |||
|
2479 | if wdirrev in revs: | |||
|
2480 | ||||
|
2481 | def parentsfunc(r): | |||
|
2482 | try: | |||
|
2483 | return parentrevs(r) | |||
|
2484 | except error.WdirUnsupported: | |||
|
2485 | return [p.rev() for p in repo[None].parents()] | |||
|
2486 | ||||
2477 | if b'topo.firstbranch' in opts: |
|
2487 | if b'topo.firstbranch' in opts: | |
2478 | firstbranch = getset(repo, subset, opts[b'topo.firstbranch']) |
|
2488 | firstbranch = getset(repo, subset, opts[b'topo.firstbranch']) | |
2479 | revs = baseset( |
|
2489 | revs = baseset( | |
2480 |
dagop.toposort(revs, |
|
2490 | dagop.toposort(revs, parentsfunc, firstbranch), | |
2481 | istopo=True, |
|
2491 | istopo=True, | |
2482 | ) |
|
2492 | ) | |
2483 | if keyflags[0][1]: |
|
2493 | if keyflags[0][1]: |
@@ -1487,6 +1487,13 b' prepare repository that has "default" br' | |||||
1487 | -1 |
|
1487 | -1 | |
1488 | $ log 'roots(wdir())' |
|
1488 | $ log 'roots(wdir())' | |
1489 | 2147483647 |
|
1489 | 2147483647 | |
|
1490 | $ log 'sort(., -topo)' | |||
|
1491 | -1 | |||
|
1492 | $ log 'sort(. or wdir(), -topo)' | |||
|
1493 | -1 | |||
|
1494 | 2147483647 | |||
|
1495 | $ log 'sort(wdir(), -topo)' | |||
|
1496 | 2147483647 | |||
1490 |
|
1497 | |||
1491 | $ echo default0 >> a |
|
1498 | $ echo default0 >> a | |
1492 | $ hg ci -Aqm0 |
|
1499 | $ hg ci -Aqm0 | |
@@ -1509,6 +1516,12 b' prepare repository that has "default" br' | |||||
1509 | 5 |
|
1516 | 5 | |
1510 | $ log 'roots(wdir())' |
|
1517 | $ log 'roots(wdir())' | |
1511 | 2147483647 |
|
1518 | 2147483647 | |
|
1519 | $ log 'sort(. or wdir() or .^, -topo)' | |||
|
1520 | 4 | |||
|
1521 | 5 | |||
|
1522 | 2147483647 | |||
|
1523 | $ log 'sort(wdir(), -topo)' | |||
|
1524 | 2147483647 | |||
1512 |
|
1525 | |||
1513 | "null" revision belongs to "default" branch (issue4683) |
|
1526 | "null" revision belongs to "default" branch (issue4683) | |
1514 |
|
1527 |
General Comments 0
You need to be logged in to leave comments.
Login now