Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hg.py @ 191:d7e859cf2f1b
merge: add count of new manifests, files, and revisions
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
merge: add count of new manifests, files, and revisions
manifest hash: ff29e3124693a0172ac936fac03fd73cc91778f5
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCmfrjywK+sNU5EO8RAnHZAJ4gwnv4QUipIcP2PhyFVS1lXh9TQwCgipSi
r+6d9lUHu2U9UJGFkJPyi/4=
=Caod
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Sun, 29 May 2005 09:24:51 -0800 |
parents | 3dd5ce2fddb6 |
children | 5d8553352d2e |
comparison
equal
deleted
inserted
replaced
190:3dd5ce2fddb6 | 191:d7e859cf2f1b |
---|---|
635 if not g: raise "couldn't find change to %s" % f | 635 if not g: raise "couldn't find change to %s" % f |
636 l = struct.pack(">l", len(f)) | 636 l = struct.pack(">l", len(f)) |
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): |
643 self.g = generator | 645 self.g = generator |
644 self.buf = "" | 646 self.buf = "" |
672 | 674 |
673 csg = getchunk() | 675 csg = getchunk() |
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) |
687 | |
688 revisions += self.manifest.rev(mo) - self.manifest.rev(mm) | |
682 | 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 |
686 resolverev = self.changelog.count() | 693 resolverev = self.changelog.count() |
747 fg = getchunk() | 754 fg = getchunk() |
748 self.ui.debug("adding %s revisions\n" % f) | 755 self.ui.debug("adding %s revisions\n" % f) |
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 |
755 nmap[f] = self.merge3(fl, f, o, n, tr, resolverev) | 764 nmap[f] = self.merge3(fl, f, o, n, tr, resolverev) |
756 | 765 |
758 # we need to do trivial merges on local files | 767 # we need to do trivial merges on local files |
759 for f in new: | 768 for f in new: |
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 |
774 self.ui.status("committing merge changeset\n") | 788 self.ui.status("committing merge changeset\n") |
775 if co == cn: cn = -1 | 789 if co == cn: cn = -1 |
777 edittext = "\nHG: merge resolve\n" + \ | 791 edittext = "\nHG: merge resolve\n" + \ |
778 "HG: manifest hash %s\n" % hex(node) + \ | 792 "HG: manifest hash %s\n" % hex(node) + \ |
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 |
785 def merge3(self, fl, fn, my, other, transaction, link): | 803 def merge3(self, fl, fn, my, other, transaction, link): |
786 """perform a 3-way merge and append the result""" | 804 """perform a 3-way merge and append the result""" |