##// END OF EJS Templates
bundle --base: use the right set for the base
Benoit Boissinot -
r3318:a225055b default
parent child Browse files
Show More
@@ -789,16 +789,25 b' def bundle(ui, repo, fname, dest=None, *'
789 789 if dest:
790 790 raise util.Abort(_("--base is incompatible with specifiying "
791 791 "a destination"))
792 base = [repo.lookup(rev) for rev in base]
793 # create the right base
794 # XXX: nodesbetween / changegroup* should be "fixed" instead
792 795 o = []
796 has_set = sets.Set(base)
793 797 for n in base:
794 o.extend(repo.changelog.children(repo.lookup(n)))
795 # add common ancestor
798 has_set.update(repo.changelog.reachable(n))
796 799 if revs:
797 all = o + revs
800 visit = list(revs)
798 801 else:
799 all = o + repo.changelog.heads()
800 ancestor = reduce(lambda a, b: repo.changelog.ancestor(a, b), all)
801 o.append(ancestor)
802 visit = repo.changelog.heads()
803 while visit:
804 n = visit.pop(0)
805 parents = [p for p in repo.changelog.parents(n)
806 if p != nullid and p not in has_set]
807 if len(parents) == 0:
808 o.insert(0, n)
809 else:
810 visit.extend(parents)
802 811 else:
803 812 setremoteconfig(ui, opts)
804 813 dest = ui.expandpath(dest or 'default-push', dest or 'default')
@@ -72,7 +72,8 b' hg -R test bundle --base 2 -r tip test-b'
72 72 hg -R test bundle --base 2 -r 7 test-bundle-branch2.hg
73 73 hg -R test bundle --base 2 test-bundle-all.hg
74 74 hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
75 cd test-2
75 hg clone test-2 test-9
76 cd test-9
76 77 echo % 2
77 78 hg tip -q
78 79 hg unbundle ../test-bundle-should-fail.hg
@@ -81,13 +82,28 b' hg tip -q'
81 82 hg unbundle ../test-bundle-all.hg
82 83 echo % 8
83 84 hg tip -q
85 hg verify
84 86 hg rollback
85 87 echo % 2
86 88 hg tip -q
87 89 hg unbundle ../test-bundle-branch1.hg
88 90 echo % 4
89 91 hg tip -q
92 hg verify
93 hg rollback
90 94 hg unbundle ../test-bundle-branch2.hg
91 echo % 8
95 echo % 6
92 96 hg tip -q
93 97 hg verify
98
99 cd ../test
100 hg merge 7
101 hg ci -m merge -d "1000000 0"
102 cd ..
103 hg -R test bundle --base 2 test-bundle-head.hg
104 hg clone test-2 test-10
105 cd test-10
106 hg unbundle ../test-bundle-head.hg
107 echo % 9
108 hg tip -q
109 hg verify
@@ -148,6 +148,7 b' rolling back last transaction'
148 148 % should fail
149 149 abort: --base is incompatible with specifiying a destination
150 150 abort: repository default-push not found!
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 152 % 2
152 153 2:d62976ca1e50
153 154 adding changesets
@@ -163,6 +164,11 b' added 6 changesets with 4 changes to 4 f'
163 164 (run 'hg heads' to see heads, 'hg merge' to merge)
164 165 % 8
165 166 8:836ac62537ab
167 checking changesets
168 checking manifests
169 crosschecking files in changesets and manifests
170 checking files
171 4 files, 9 changesets, 7 total revisions
166 172 rolling back last transaction
167 173 % 2
168 174 2:d62976ca1e50
@@ -173,15 +179,36 b' added 2 changesets with 2 changes to 2 f'
173 179 (run 'hg update' to get a working copy)
174 180 % 4
175 181 4:836ac62537ab
182 checking changesets
183 checking manifests
184 crosschecking files in changesets and manifests
185 checking files
186 2 files, 5 changesets, 5 total revisions
187 rolling back last transaction
176 188 adding changesets
177 189 adding manifests
178 190 adding file changes
179 added 4 changesets with 2 changes to 3 files (+1 heads)
191 added 4 changesets with 3 changes to 3 files (+1 heads)
180 192 (run 'hg heads' to see heads, 'hg merge' to merge)
181 % 8
182 8:80fe151401c2
193 % 6
194 6:80fe151401c2
183 195 checking changesets
184 196 checking manifests
185 197 crosschecking files in changesets and manifests
186 198 checking files
187 4 files, 9 changesets, 7 total revisions
199 3 files, 7 changesets, 6 total revisions
200 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
201 (branch merge, don't forget to commit)
202 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 adding changesets
204 adding manifests
205 adding file changes
206 added 7 changesets with 4 changes to 4 files
207 (run 'hg update' to get a working copy)
208 % 9
209 9:607fe5912aad
210 checking changesets
211 checking manifests
212 crosschecking files in changesets and manifests
213 checking files
214 4 files, 10 changesets, 7 total revisions
General Comments 0
You need to be logged in to leave comments. Login now