##// END OF EJS Templates
Fix manifest merge swap bug...
mpm@selenic.com -
r90:ab9ebff0 default
parent child Browse files
Show More
@@ -101,7 +101,7 b' class manifest(revlog):'
101
101
102 def read(self, node):
102 def read(self, node):
103 if self.mapcache and self.mapcache[0] == node:
103 if self.mapcache and self.mapcache[0] == node:
104 return self.mapcache[1]
104 return self.mapcache[1].copy()
105 text = self.revision(node)
105 text = self.revision(node)
106 map = {}
106 map = {}
107 self.listcache = (text, text.splitlines(1))
107 self.listcache = (text, text.splitlines(1))
@@ -402,9 +402,9 b' class localrepository:'
402
402
403 # resolve the manifest to point to all the merged files
403 # resolve the manifest to point to all the merged files
404 self.ui.status("resolving manifests\n")
404 self.ui.status("resolving manifests\n")
405 mmap = self.manifest.read(mm) # mine
406 omap = self.manifest.read(mo) # other
405 omap = self.manifest.read(mo) # other
407 amap = self.manifest.read(ma) # ancestor
406 amap = self.manifest.read(ma) # ancestor
407 mmap = self.manifest.read(mm) # mine
408 nmap = {}
408 nmap = {}
409
409
410 for f, mid in mmap.iteritems():
410 for f, mid in mmap.iteritems():
@@ -776,8 +776,8 b' class localrepository:'
776 self.ui.status("merging manifests\n")
776 self.ui.status("merging manifests\n")
777 # pull off the manifest group
777 # pull off the manifest group
778 mfg = getchunk()
778 mfg = getchunk()
779 mo = self.manifest.tip()
779 mm = self.manifest.tip()
780 mm = self.manifest.addgroup(mfg, lambda x: self.changelog.rev(x), tr)
780 mo = self.manifest.addgroup(mfg, lambda x: self.changelog.rev(x), tr)
781
781
782 # do we need a resolve?
782 # do we need a resolve?
783 if self.changelog.ancestor(co, cn) != co:
783 if self.changelog.ancestor(co, cn) != co:
@@ -797,45 +797,57 b' class localrepository:'
797 n = fl.addgroup(fg, lambda x: self.changelog.rev(x), tr)
797 n = fl.addgroup(fg, lambda x: self.changelog.rev(x), tr)
798 if not simple:
798 if not simple:
799 nn = fl.resolvedag(o, n, tr, resolverev)
799 nn = fl.resolvedag(o, n, tr, resolverev)
800 if nn: new[f] = nn
800 if nn:
801 self.ui.note("merged %s\n", f)
802 new[f] = nn
801
803
802 # For simple merges, we don't need to resolve manifests or changesets
804 # For simple merges, we don't need to resolve manifests or changesets
803 if simple:
805 if simple:
806 self.ui.debug("simple merge, skipping resolve\n")
804 tr.close()
807 tr.close()
805 return
808 return
806
809
807 # resolve the manifest to point to all the merged files
810 # resolve the manifest to point to all the merged files
808 self.ui.status("resolving manifests\n")
811 self.ui.status("resolving manifests\n")
809 ma = self.manifest.ancestor(mm, mo)
812 ma = self.manifest.ancestor(mm, mo)
810 mmap = self.manifest.read(mm) # mine
811 omap = self.manifest.read(mo) # other
813 omap = self.manifest.read(mo) # other
812 amap = self.manifest.read(ma) # ancestor
814 amap = self.manifest.read(ma) # ancestor
815 mmap = self.manifest.read(mm) # mine
816 self.ui.debug("ancestor %s local %s other %s\n" %
817 (short(ma), short(mm), short(mo)))
813 nmap = {}
818 nmap = {}
814
819
815 for f, mid in mmap.iteritems():
820 for f, mid in mmap.iteritems():
816 if f in omap:
821 if f in omap:
817 if mid != omap[f]:
822 if mid != omap[f]:
823 self.ui.debug("%s versions differ\n" % f)
824 if f in new: self.ui.note("%s updated in resolve\n" % f)
818 nmap[f] = new.get(f, mid) # use merged version
825 nmap[f] = new.get(f, mid) # use merged version
819 else:
826 else:
820 nmap[f] = new.get(f, mid) # they're the same
827 nmap[f] = mid # keep ours
821 del omap[f]
828 del omap[f]
822 elif f in amap:
829 elif f in amap:
823 if mid != amap[f]:
830 if mid != amap[f]:
831 self.ui.debug("local changed %s which other deleted\n" % f)
824 pass # we should prompt here
832 pass # we should prompt here
825 else:
833 else:
834 self.ui.debug("other deleted %s\n" % f)
826 pass # other deleted it
835 pass # other deleted it
827 else:
836 else:
828 nmap[f] = new.get(f, mid) # we created it
837 self.ui.debug("local created %s\n" %f)
838 nmap[f] = mid # we created it
829
839
830 del mmap
840 del mmap
831
841
832 for f, oid in omap.iteritems():
842 for f, oid in omap.iteritems():
833 if f in amap:
843 if f in amap:
834 if oid != amap[f]:
844 if oid != amap[f]:
845 self.ui.debug("other changed %s which we deleted\n" % f)
835 pass # this is the nasty case, we should prompt
846 pass # this is the nasty case, we should prompt
836 else:
847 else:
837 pass # probably safe
848 pass # probably safe
838 else:
849 else:
850 self.ui.debug("remote created %s\n" % f)
839 nmap[f] = new.get(f, oid) # remote created it
851 nmap[f] = new.get(f, oid) # remote created it
840
852
841 del omap
853 del omap
General Comments 0
You need to be logged in to leave comments. Login now