##// END OF EJS Templates
merge: add count of new manifests, files, and revisions...
mpm@selenic.com -
r191:d7e859cf default
parent child Browse files
Show More
@@ -637,6 +637,8 b' class localrepository:'
637 yield "".join([l, f, g])
637 yield "".join([l, f, g])
638
638
639 def addchangegroup(self, generator):
639 def addchangegroup(self, generator):
640 changesets = files = revisions = 0
641
640 self.lock()
642 self.lock()
641 class genread:
643 class genread:
642 def __init__(self, generator):
644 def __init__(self, generator):
@@ -674,12 +676,17 b' class localrepository:'
674 co = self.changelog.tip()
676 co = self.changelog.tip()
675 cn = self.changelog.addgroup(csg, report, tr)
677 cn = self.changelog.addgroup(csg, report, tr)
676
678
679 revisions = self.changelog.rev(cn) - self.changelog.rev(co)
680 changesets = revisions
681
677 self.ui.status("adding manifests\n")
682 self.ui.status("adding manifests\n")
678 # pull off the manifest group
683 # pull off the manifest group
679 mfg = getchunk()
684 mfg = getchunk()
680 mm = self.manifest.tip()
685 mm = self.manifest.tip()
681 mo = self.manifest.addgroup(mfg, lambda x: self.changelog.rev(x), tr)
686 mo = self.manifest.addgroup(mfg, lambda x: self.changelog.rev(x), tr)
682
687
688 revisions += self.manifest.rev(mo) - self.manifest.rev(mm)
689
683 # do we need a resolve?
690 # do we need a resolve?
684 if self.changelog.ancestor(co, cn) != co:
691 if self.changelog.ancestor(co, cn) != co:
685 simple = False
692 simple = False
@@ -749,6 +756,8 b' class localrepository:'
749 fl = self.file(f)
756 fl = self.file(f)
750 o = fl.tip()
757 o = fl.tip()
751 n = fl.addgroup(fg, lambda x: self.changelog.rev(x), tr)
758 n = fl.addgroup(fg, lambda x: self.changelog.rev(x), tr)
759 revisions += fl.rev(n) - fl.rev(o)
760 files += 1
752 if f in need:
761 if f in need:
753 del need[f]
762 del need[f]
754 # manifest resolve determined we need to merge the tips
763 # manifest resolve determined we need to merge the tips
@@ -760,14 +769,19 b' class localrepository:'
760 if f not in need: continue
769 if f not in need: continue
761 fl = self.file(f)
770 fl = self.file(f)
762 nmap[f] = self.merge3(fl, f, need[f], fl.tip(), tr, resolverev)
771 nmap[f] = self.merge3(fl, f, need[f], fl.tip(), tr, resolverev)
772 revisions += 1
763
773
764 # For simple merges, we don't need to resolve manifests or changesets
774 # For simple merges, we don't need to resolve manifests or changesets
765 if simple:
775 if simple:
766 self.ui.debug("simple merge, skipping resolve\n")
776 self.ui.debug("simple merge, skipping resolve\n")
777 self.ui.status(("added %d changesets, %d files," +
778 " and %d new revisions\n")
779 % (changesets, files, revisions))
767 tr.close()
780 tr.close()
768 return
781 return
769
782
770 node = self.manifest.add(nmap, tr, resolverev, mm, mo)
783 node = self.manifest.add(nmap, tr, resolverev, mm, mo)
784 revisions += 1
771
785
772 # Now all files and manifests are merged, we add the changed files
786 # Now all files and manifests are merged, we add the changed files
773 # and manifest id to the changelog
787 # and manifest id to the changelog
@@ -779,6 +793,10 b' class localrepository:'
779 "".join(["HG: changed %s\n" % f for f in new])
793 "".join(["HG: changed %s\n" % f for f in new])
780 edittext = self.ui.edit(edittext)
794 edittext = self.ui.edit(edittext)
781 n = self.changelog.add(node, new, edittext, tr, co, cn)
795 n = self.changelog.add(node, new, edittext, tr, co, cn)
796 revisions += 1
797
798 self.ui.status("added %d changesets, %d files, and %d new revisions\n"
799 % (changesets, files, revisions))
782
800
783 tr.close()
801 tr.close()
784
802
General Comments 0
You need to be logged in to leave comments. Login now