##// END OF EJS Templates
Merge with stable
Martin Geisler -
r10049:5b9709f8 merge default
parent child Browse files
Show More
@@ -1096,12 +1096,6 b' class queue(object):'
1096 1096 m, a, r, d = repo.status(qp, top)[:4]
1097 1097 if d:
1098 1098 raise util.Abort(_("deletions found between repo revs"))
1099 for f in m:
1100 getfile(f, mmap[f], mmap.flags(f))
1101 for f in r:
1102 getfile(f, mmap[f], mmap.flags(f))
1103 for f in m + r:
1104 repo.dirstate.normal(f)
1105 1099 for f in a:
1106 1100 try:
1107 1101 os.unlink(repo.wjoin(f))
@@ -1111,6 +1105,12 b' class queue(object):'
1111 1105 try: os.removedirs(os.path.dirname(repo.wjoin(f)))
1112 1106 except: pass
1113 1107 repo.dirstate.forget(f)
1108 for f in m:
1109 getfile(f, mmap[f], mmap.flags(f))
1110 for f in r:
1111 getfile(f, mmap[f], mmap.flags(f))
1112 for f in m + r:
1113 repo.dirstate.normal(f)
1114 1114 repo.dirstate.setparents(qp, nullid)
1115 1115 for patch in reversed(self.applied[start:end]):
1116 1116 self.ui.status(_("popping %s\n") % patch.name)
@@ -579,7 +579,13 b' class revlog(object):'
579 579 return reachable
580 580
581 581 def ancestors(self, *revs):
582 'Generate the ancestors of revs using a breadth-first visit'
582 """Generate the ancestors of 'revs' in reverse topological order.
583
584 Yield a sequence of revision numbers starting with the parents
585 of each revision in revs, i.e., each revision is *not* considered
586 an ancestor of itself. Results are in breadth-first order:
587 parents of each rev in revs, then parents of those, etc. Result
588 does not include the null revision."""
583 589 visit = list(revs)
584 590 seen = set([nullrev])
585 591 while visit:
@@ -590,7 +596,12 b' class revlog(object):'
590 596 yield parent
591 597
592 598 def descendants(self, *revs):
593 'Generate the descendants of revs in topological order'
599 """Generate the descendants of 'revs' in revision order.
600
601 Yield a sequence of revision numbers starting with a child of
602 some rev in revs, i.e., each revision is *not* considered a
603 descendant of itself. Results are ordered by revision number (a
604 topological sort)."""
594 605 seen = set(revs)
595 606 for i in xrange(min(revs) + 1, len(self)):
596 607 for x in self.parentrevs(i):
@@ -600,15 +611,20 b' class revlog(object):'
600 611 break
601 612
602 613 def findmissing(self, common=None, heads=None):
603 '''
604 returns the topologically sorted list of nodes from the set:
605 missing = (ancestors(heads) \ ancestors(common))
614 """Return the ancestors of heads that are not ancestors of common.
615
616 More specifically, return a list of nodes N such that every N
617 satisfies the following constraints:
606 618
607 where ancestors() is the set of ancestors from heads, heads included
619 1. N is an ancestor of some node in 'heads'
620 2. N is not an ancestor of any node in 'common'
608 621
609 if heads is None, the heads of the revlog are used
610 if common is None, nullid is assumed to be a common node
611 '''
622 The list is sorted by revision number, meaning it is
623 topologically sorted.
624
625 'heads' and 'common' are both lists of node IDs. If heads is
626 not supplied, uses all of the revlog's heads. If common is not
627 supplied, uses nullid."""
612 628 if common is None:
613 629 common = [nullid]
614 630 if heads is None:
@@ -639,20 +655,26 b' class revlog(object):'
639 655 return [self.node(r) for r in missing]
640 656
641 657 def nodesbetween(self, roots=None, heads=None):
642 """Return a tuple containing three elements. Elements 1 and 2 contain
643 a final list bases and heads after all the unreachable ones have been
644 pruned. Element 0 contains a topologically sorted list of all
658 """Return a topological path from 'roots' to 'heads'.
659
660 Return a tuple (nodes, outroots, outheads) where 'nodes' is a
661 topologically sorted list of all nodes N that satisfy both of
662 these constraints:
663
664 1. N is a descendant of some node in 'roots'
665 2. N is an ancestor of some node in 'heads'
645 666
646 nodes that satisfy these constraints:
647 1. All nodes must be descended from a node in roots (the nodes on
648 roots are considered descended from themselves).
649 2. All nodes must also be ancestors of a node in heads (the nodes in
650 heads are considered to be their own ancestors).
667 Every node is considered to be both a descendant and an ancestor
668 of itself, so every reachable node in 'roots' and 'heads' will be
669 included in 'nodes'.
651 670
652 If roots is unspecified, nullid is assumed as the only root.
653 If heads is unspecified, it is taken to be the output of the
654 heads method (i.e. a list of all nodes in the repository that
655 have no children)."""
671 'outroots' is the list of reachable nodes in 'roots', i.e., the
672 subset of 'roots' that is returned in 'nodes'. Likewise,
673 'outheads' is the subset of 'heads' that is also in 'nodes'.
674
675 'roots' and 'heads' are both lists of node IDs. If 'roots' is
676 unspecified, uses nullid as the only root. If 'heads' is
677 unspecified, uses list of all of the revlog's heads."""
656 678 nonodes = ([], [], [])
657 679 if roots is not None:
658 680 roots = list(roots)
@@ -561,3 +561,23 b' echo % test popping revisions not in wor'
561 561 hg qseries -v
562 562 hg up qparent
563 563 hg qpop
564
565 cd ..
566 hg init deletion-order
567 cd deletion-order
568
569 touch a
570 hg ci -Aqm0
571
572 hg qnew rename-dir
573 hg rm a
574 hg qrefresh
575
576 mkdir a b
577 touch a/a b/b
578 hg add -q a b
579 hg qrefresh
580
581 echo % test popping must remove files added in subdirectories first
582 hg qpop
583 cd ..
@@ -612,3 +612,6 b' 0 A empty'
612 612 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
613 613 popping empty
614 614 patch queue now empty
615 % test popping must remove files added in subdirectories first
616 popping rename-dir
617 patch queue now empty
General Comments 0
You need to be logged in to leave comments. Login now