Show More
@@ -1,368 +1,369 | |||||
1 | # bundlerepo.py - repository class for viewing uncompressed bundles |
|
1 | # bundlerepo.py - repository class for viewing uncompressed bundles | |
2 | # |
|
2 | # | |
3 | # Copyright 2006, 2007 Benoit Boissinot <bboissin@gmail.com> |
|
3 | # Copyright 2006, 2007 Benoit Boissinot <bboissin@gmail.com> | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | """Repository class for viewing uncompressed bundles. |
|
8 | """Repository class for viewing uncompressed bundles. | |
9 |
|
9 | |||
10 | This provides a read-only repository interface to bundles as if they |
|
10 | This provides a read-only repository interface to bundles as if they | |
11 | were part of the actual repository. |
|
11 | were part of the actual repository. | |
12 | """ |
|
12 | """ | |
13 |
|
13 | |||
14 | from node import nullid |
|
14 | from node import nullid | |
15 | from i18n import _ |
|
15 | from i18n import _ | |
16 | import os, tempfile, shutil |
|
16 | import os, tempfile, shutil | |
17 | import changegroup, util, mdiff, discovery, cmdutil |
|
17 | import changegroup, util, mdiff, discovery, cmdutil | |
18 | import localrepo, changelog, manifest, filelog, revlog, error |
|
18 | import localrepo, changelog, manifest, filelog, revlog, error | |
19 |
|
19 | |||
20 | class bundlerevlog(revlog.revlog): |
|
20 | class bundlerevlog(revlog.revlog): | |
21 | def __init__(self, opener, indexfile, bundle, linkmapper): |
|
21 | def __init__(self, opener, indexfile, bundle, linkmapper): | |
22 | # How it works: |
|
22 | # How it works: | |
23 | # to retrieve a revision, we need to know the offset of |
|
23 | # to retrieve a revision, we need to know the offset of | |
24 | # the revision in the bundle (an unbundle object). |
|
24 | # the revision in the bundle (an unbundle object). | |
25 | # |
|
25 | # | |
26 | # We store this offset in the index (start), to differentiate a |
|
26 | # We store this offset in the index (start), to differentiate a | |
27 | # rev in the bundle and from a rev in the revlog, we check |
|
27 | # rev in the bundle and from a rev in the revlog, we check | |
28 | # len(index[r]). If the tuple is bigger than 7, it is a bundle |
|
28 | # len(index[r]). If the tuple is bigger than 7, it is a bundle | |
29 | # (it is bigger since we store the node to which the delta is) |
|
29 | # (it is bigger since we store the node to which the delta is) | |
30 | # |
|
30 | # | |
31 | revlog.revlog.__init__(self, opener, indexfile) |
|
31 | revlog.revlog.__init__(self, opener, indexfile) | |
32 | self.bundle = bundle |
|
32 | self.bundle = bundle | |
33 | self.basemap = {} |
|
33 | self.basemap = {} | |
34 | n = len(self) |
|
34 | n = len(self) | |
35 | chain = None |
|
35 | chain = None | |
36 | while True: |
|
36 | while True: | |
37 | chunkdata = bundle.deltachunk(chain) |
|
37 | chunkdata = bundle.deltachunk(chain) | |
38 | if not chunkdata: |
|
38 | if not chunkdata: | |
39 | break |
|
39 | break | |
40 | node = chunkdata['node'] |
|
40 | node = chunkdata['node'] | |
41 | p1 = chunkdata['p1'] |
|
41 | p1 = chunkdata['p1'] | |
42 | p2 = chunkdata['p2'] |
|
42 | p2 = chunkdata['p2'] | |
43 | cs = chunkdata['cs'] |
|
43 | cs = chunkdata['cs'] | |
44 | deltabase = chunkdata['deltabase'] |
|
44 | deltabase = chunkdata['deltabase'] | |
45 | delta = chunkdata['delta'] |
|
45 | delta = chunkdata['delta'] | |
46 |
|
46 | |||
47 | size = len(delta) |
|
47 | size = len(delta) | |
48 | start = bundle.tell() - size |
|
48 | start = bundle.tell() - size | |
49 |
|
49 | |||
50 | link = linkmapper(cs) |
|
50 | link = linkmapper(cs) | |
51 | if node in self.nodemap: |
|
51 | if node in self.nodemap: | |
52 | # this can happen if two branches make the same change |
|
52 | # this can happen if two branches make the same change | |
53 | chain = node |
|
53 | chain = node | |
54 | continue |
|
54 | continue | |
55 |
|
55 | |||
56 | for p in (p1, p2): |
|
56 | for p in (p1, p2): | |
57 | if not p in self.nodemap: |
|
57 | if not p in self.nodemap: | |
58 | raise error.LookupError(p, self.indexfile, |
|
58 | raise error.LookupError(p, self.indexfile, | |
59 | _("unknown parent")) |
|
59 | _("unknown parent")) | |
60 | # start, size, full unc. size, base (unused), link, p1, p2, node |
|
60 | # start, size, full unc. size, base (unused), link, p1, p2, node | |
61 | e = (revlog.offset_type(start, 0), size, -1, -1, link, |
|
61 | e = (revlog.offset_type(start, 0), size, -1, -1, link, | |
62 | self.rev(p1), self.rev(p2), node) |
|
62 | self.rev(p1), self.rev(p2), node) | |
63 | self.basemap[n] = deltabase |
|
63 | self.basemap[n] = deltabase | |
64 | self.index.insert(-1, e) |
|
64 | self.index.insert(-1, e) | |
65 | self.nodemap[node] = n |
|
65 | self.nodemap[node] = n | |
66 | chain = node |
|
66 | chain = node | |
67 | n += 1 |
|
67 | n += 1 | |
68 |
|
68 | |||
69 | def inbundle(self, rev): |
|
69 | def inbundle(self, rev): | |
70 | """is rev from the bundle""" |
|
70 | """is rev from the bundle""" | |
71 | if rev < 0: |
|
71 | if rev < 0: | |
72 | return False |
|
72 | return False | |
73 | return rev in self.basemap |
|
73 | return rev in self.basemap | |
74 | def bundlebase(self, rev): |
|
74 | def bundlebase(self, rev): | |
75 | return self.basemap[rev] |
|
75 | return self.basemap[rev] | |
76 | def _chunk(self, rev): |
|
76 | def _chunk(self, rev): | |
77 | # Warning: in case of bundle, the diff is against bundlebase, |
|
77 | # Warning: in case of bundle, the diff is against bundlebase, | |
78 | # not against rev - 1 |
|
78 | # not against rev - 1 | |
79 | # XXX: could use some caching |
|
79 | # XXX: could use some caching | |
80 | if not self.inbundle(rev): |
|
80 | if not self.inbundle(rev): | |
81 | return revlog.revlog._chunk(self, rev) |
|
81 | return revlog.revlog._chunk(self, rev) | |
82 | self.bundle.seek(self.start(rev)) |
|
82 | self.bundle.seek(self.start(rev)) | |
83 | return self.bundle.read(self.length(rev)) |
|
83 | return self.bundle.read(self.length(rev)) | |
84 |
|
84 | |||
85 | def revdiff(self, rev1, rev2): |
|
85 | def revdiff(self, rev1, rev2): | |
86 | """return or calculate a delta between two revisions""" |
|
86 | """return or calculate a delta between two revisions""" | |
87 | if self.inbundle(rev1) and self.inbundle(rev2): |
|
87 | if self.inbundle(rev1) and self.inbundle(rev2): | |
88 | # hot path for bundle |
|
88 | # hot path for bundle | |
89 | revb = self.rev(self.bundlebase(rev2)) |
|
89 | revb = self.rev(self.bundlebase(rev2)) | |
90 | if revb == rev1: |
|
90 | if revb == rev1: | |
91 | return self._chunk(rev2) |
|
91 | return self._chunk(rev2) | |
92 | elif not self.inbundle(rev1) and not self.inbundle(rev2): |
|
92 | elif not self.inbundle(rev1) and not self.inbundle(rev2): | |
93 | return revlog.revlog.revdiff(self, rev1, rev2) |
|
93 | return revlog.revlog.revdiff(self, rev1, rev2) | |
94 |
|
94 | |||
95 | return mdiff.textdiff(self.revision(self.node(rev1)), |
|
95 | return mdiff.textdiff(self.revision(self.node(rev1)), | |
96 | self.revision(self.node(rev2))) |
|
96 | self.revision(self.node(rev2))) | |
97 |
|
97 | |||
98 | def revision(self, node): |
|
98 | def revision(self, node): | |
99 | """return an uncompressed revision of a given""" |
|
99 | """return an uncompressed revision of a given""" | |
100 | if node == nullid: |
|
100 | if node == nullid: | |
101 | return "" |
|
101 | return "" | |
102 |
|
102 | |||
103 | text = None |
|
103 | text = None | |
104 | chain = [] |
|
104 | chain = [] | |
105 | iter_node = node |
|
105 | iter_node = node | |
106 | rev = self.rev(iter_node) |
|
106 | rev = self.rev(iter_node) | |
107 | # reconstruct the revision if it is from a changegroup |
|
107 | # reconstruct the revision if it is from a changegroup | |
108 | while self.inbundle(rev): |
|
108 | while self.inbundle(rev): | |
109 | if self._cache and self._cache[0] == iter_node: |
|
109 | if self._cache and self._cache[0] == iter_node: | |
110 | text = self._cache[2] |
|
110 | text = self._cache[2] | |
111 | break |
|
111 | break | |
112 | chain.append(rev) |
|
112 | chain.append(rev) | |
113 | iter_node = self.bundlebase(rev) |
|
113 | iter_node = self.bundlebase(rev) | |
114 | rev = self.rev(iter_node) |
|
114 | rev = self.rev(iter_node) | |
115 | if text is None: |
|
115 | if text is None: | |
116 | text = revlog.revlog.revision(self, iter_node) |
|
116 | text = revlog.revlog.revision(self, iter_node) | |
117 |
|
117 | |||
118 | while chain: |
|
118 | while chain: | |
119 | delta = self._chunk(chain.pop()) |
|
119 | delta = self._chunk(chain.pop()) | |
120 | text = mdiff.patches(text, [delta]) |
|
120 | text = mdiff.patches(text, [delta]) | |
121 |
|
121 | |||
122 | p1, p2 = self.parents(node) |
|
122 | p1, p2 = self.parents(node) | |
123 | if node != revlog.hash(text, p1, p2): |
|
123 | if node != revlog.hash(text, p1, p2): | |
124 | raise error.RevlogError(_("integrity check failed on %s:%d") |
|
124 | raise error.RevlogError(_("integrity check failed on %s:%d") | |
125 | % (self.datafile, self.rev(node))) |
|
125 | % (self.datafile, self.rev(node))) | |
126 |
|
126 | |||
127 | self._cache = (node, self.rev(node), text) |
|
127 | self._cache = (node, self.rev(node), text) | |
128 | return text |
|
128 | return text | |
129 |
|
129 | |||
130 | def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): |
|
130 | def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): | |
131 | raise NotImplementedError |
|
131 | raise NotImplementedError | |
132 | def addgroup(self, revs, linkmapper, transaction): |
|
132 | def addgroup(self, revs, linkmapper, transaction): | |
133 | raise NotImplementedError |
|
133 | raise NotImplementedError | |
134 | def strip(self, rev, minlink): |
|
134 | def strip(self, rev, minlink): | |
135 | raise NotImplementedError |
|
135 | raise NotImplementedError | |
136 | def checksize(self): |
|
136 | def checksize(self): | |
137 | raise NotImplementedError |
|
137 | raise NotImplementedError | |
138 |
|
138 | |||
139 | class bundlechangelog(bundlerevlog, changelog.changelog): |
|
139 | class bundlechangelog(bundlerevlog, changelog.changelog): | |
140 | def __init__(self, opener, bundle): |
|
140 | def __init__(self, opener, bundle): | |
141 | changelog.changelog.__init__(self, opener) |
|
141 | changelog.changelog.__init__(self, opener) | |
142 | linkmapper = lambda x: x |
|
142 | linkmapper = lambda x: x | |
143 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, |
|
143 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, | |
144 | linkmapper) |
|
144 | linkmapper) | |
145 |
|
145 | |||
146 | class bundlemanifest(bundlerevlog, manifest.manifest): |
|
146 | class bundlemanifest(bundlerevlog, manifest.manifest): | |
147 | def __init__(self, opener, bundle, linkmapper): |
|
147 | def __init__(self, opener, bundle, linkmapper): | |
148 | manifest.manifest.__init__(self, opener) |
|
148 | manifest.manifest.__init__(self, opener) | |
149 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, |
|
149 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, | |
150 | linkmapper) |
|
150 | linkmapper) | |
151 |
|
151 | |||
152 | class bundlefilelog(bundlerevlog, filelog.filelog): |
|
152 | class bundlefilelog(bundlerevlog, filelog.filelog): | |
153 | def __init__(self, opener, path, bundle, linkmapper, repo): |
|
153 | def __init__(self, opener, path, bundle, linkmapper, repo): | |
154 | filelog.filelog.__init__(self, opener, path) |
|
154 | filelog.filelog.__init__(self, opener, path) | |
155 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, |
|
155 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, | |
156 | linkmapper) |
|
156 | linkmapper) | |
157 | self._repo = repo |
|
157 | self._repo = repo | |
158 |
|
158 | |||
159 | def _file(self, f): |
|
159 | def _file(self, f): | |
160 | self._repo.file(f) |
|
160 | self._repo.file(f) | |
161 |
|
161 | |||
162 | class bundlerepository(localrepo.localrepository): |
|
162 | class bundlerepository(localrepo.localrepository): | |
163 | def __init__(self, ui, path, bundlename): |
|
163 | def __init__(self, ui, path, bundlename): | |
164 | self._tempparent = None |
|
164 | self._tempparent = None | |
165 | try: |
|
165 | try: | |
166 | localrepo.localrepository.__init__(self, ui, path) |
|
166 | localrepo.localrepository.__init__(self, ui, path) | |
167 | except error.RepoError: |
|
167 | except error.RepoError: | |
168 | self._tempparent = tempfile.mkdtemp() |
|
168 | self._tempparent = tempfile.mkdtemp() | |
169 | localrepo.instance(ui, self._tempparent, 1) |
|
169 | localrepo.instance(ui, self._tempparent, 1) | |
170 | localrepo.localrepository.__init__(self, ui, self._tempparent) |
|
170 | localrepo.localrepository.__init__(self, ui, self._tempparent) | |
|
171 | self.ui.setconfig('phases', 'publish', False) | |||
171 |
|
172 | |||
172 | if path: |
|
173 | if path: | |
173 | self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename |
|
174 | self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename | |
174 | else: |
|
175 | else: | |
175 | self._url = 'bundle:' + bundlename |
|
176 | self._url = 'bundle:' + bundlename | |
176 |
|
177 | |||
177 | self.tempfile = None |
|
178 | self.tempfile = None | |
178 | f = util.posixfile(bundlename, "rb") |
|
179 | f = util.posixfile(bundlename, "rb") | |
179 | self.bundle = changegroup.readbundle(f, bundlename) |
|
180 | self.bundle = changegroup.readbundle(f, bundlename) | |
180 | if self.bundle.compressed(): |
|
181 | if self.bundle.compressed(): | |
181 | fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-", |
|
182 | fdtemp, temp = tempfile.mkstemp(prefix="hg-bundle-", | |
182 | suffix=".hg10un", dir=self.path) |
|
183 | suffix=".hg10un", dir=self.path) | |
183 | self.tempfile = temp |
|
184 | self.tempfile = temp | |
184 | fptemp = os.fdopen(fdtemp, 'wb') |
|
185 | fptemp = os.fdopen(fdtemp, 'wb') | |
185 |
|
186 | |||
186 | try: |
|
187 | try: | |
187 | fptemp.write("HG10UN") |
|
188 | fptemp.write("HG10UN") | |
188 | while True: |
|
189 | while True: | |
189 | chunk = self.bundle.read(2**18) |
|
190 | chunk = self.bundle.read(2**18) | |
190 | if not chunk: |
|
191 | if not chunk: | |
191 | break |
|
192 | break | |
192 | fptemp.write(chunk) |
|
193 | fptemp.write(chunk) | |
193 | finally: |
|
194 | finally: | |
194 | fptemp.close() |
|
195 | fptemp.close() | |
195 |
|
196 | |||
196 | f = util.posixfile(self.tempfile, "rb") |
|
197 | f = util.posixfile(self.tempfile, "rb") | |
197 | self.bundle = changegroup.readbundle(f, bundlename) |
|
198 | self.bundle = changegroup.readbundle(f, bundlename) | |
198 |
|
199 | |||
199 | # dict with the mapping 'filename' -> position in the bundle |
|
200 | # dict with the mapping 'filename' -> position in the bundle | |
200 | self.bundlefilespos = {} |
|
201 | self.bundlefilespos = {} | |
201 |
|
202 | |||
202 | @util.propertycache |
|
203 | @util.propertycache | |
203 | def changelog(self): |
|
204 | def changelog(self): | |
204 | # consume the header if it exists |
|
205 | # consume the header if it exists | |
205 | self.bundle.changelogheader() |
|
206 | self.bundle.changelogheader() | |
206 | c = bundlechangelog(self.sopener, self.bundle) |
|
207 | c = bundlechangelog(self.sopener, self.bundle) | |
207 | self.manstart = self.bundle.tell() |
|
208 | self.manstart = self.bundle.tell() | |
208 | return c |
|
209 | return c | |
209 |
|
210 | |||
210 | @util.propertycache |
|
211 | @util.propertycache | |
211 | def manifest(self): |
|
212 | def manifest(self): | |
212 | self.bundle.seek(self.manstart) |
|
213 | self.bundle.seek(self.manstart) | |
213 | # consume the header if it exists |
|
214 | # consume the header if it exists | |
214 | self.bundle.manifestheader() |
|
215 | self.bundle.manifestheader() | |
215 | m = bundlemanifest(self.sopener, self.bundle, self.changelog.rev) |
|
216 | m = bundlemanifest(self.sopener, self.bundle, self.changelog.rev) | |
216 | self.filestart = self.bundle.tell() |
|
217 | self.filestart = self.bundle.tell() | |
217 | return m |
|
218 | return m | |
218 |
|
219 | |||
219 | @util.propertycache |
|
220 | @util.propertycache | |
220 | def manstart(self): |
|
221 | def manstart(self): | |
221 | self.changelog |
|
222 | self.changelog | |
222 | return self.manstart |
|
223 | return self.manstart | |
223 |
|
224 | |||
224 | @util.propertycache |
|
225 | @util.propertycache | |
225 | def filestart(self): |
|
226 | def filestart(self): | |
226 | self.manifest |
|
227 | self.manifest | |
227 | return self.filestart |
|
228 | return self.filestart | |
228 |
|
229 | |||
229 | def url(self): |
|
230 | def url(self): | |
230 | return self._url |
|
231 | return self._url | |
231 |
|
232 | |||
232 | def file(self, f): |
|
233 | def file(self, f): | |
233 | if not self.bundlefilespos: |
|
234 | if not self.bundlefilespos: | |
234 | self.bundle.seek(self.filestart) |
|
235 | self.bundle.seek(self.filestart) | |
235 | while True: |
|
236 | while True: | |
236 | chunkdata = self.bundle.filelogheader() |
|
237 | chunkdata = self.bundle.filelogheader() | |
237 | if not chunkdata: |
|
238 | if not chunkdata: | |
238 | break |
|
239 | break | |
239 | fname = chunkdata['filename'] |
|
240 | fname = chunkdata['filename'] | |
240 | self.bundlefilespos[fname] = self.bundle.tell() |
|
241 | self.bundlefilespos[fname] = self.bundle.tell() | |
241 | while True: |
|
242 | while True: | |
242 | c = self.bundle.deltachunk(None) |
|
243 | c = self.bundle.deltachunk(None) | |
243 | if not c: |
|
244 | if not c: | |
244 | break |
|
245 | break | |
245 |
|
246 | |||
246 | if f[0] == '/': |
|
247 | if f[0] == '/': | |
247 | f = f[1:] |
|
248 | f = f[1:] | |
248 | if f in self.bundlefilespos: |
|
249 | if f in self.bundlefilespos: | |
249 | self.bundle.seek(self.bundlefilespos[f]) |
|
250 | self.bundle.seek(self.bundlefilespos[f]) | |
250 | return bundlefilelog(self.sopener, f, self.bundle, |
|
251 | return bundlefilelog(self.sopener, f, self.bundle, | |
251 | self.changelog.rev, self) |
|
252 | self.changelog.rev, self) | |
252 | else: |
|
253 | else: | |
253 | return filelog.filelog(self.sopener, f) |
|
254 | return filelog.filelog(self.sopener, f) | |
254 |
|
255 | |||
255 | def close(self): |
|
256 | def close(self): | |
256 | """Close assigned bundle file immediately.""" |
|
257 | """Close assigned bundle file immediately.""" | |
257 | self.bundle.close() |
|
258 | self.bundle.close() | |
258 | if self.tempfile is not None: |
|
259 | if self.tempfile is not None: | |
259 | os.unlink(self.tempfile) |
|
260 | os.unlink(self.tempfile) | |
260 | if self._tempparent: |
|
261 | if self._tempparent: | |
261 | shutil.rmtree(self._tempparent, True) |
|
262 | shutil.rmtree(self._tempparent, True) | |
262 |
|
263 | |||
263 | def cancopy(self): |
|
264 | def cancopy(self): | |
264 | return False |
|
265 | return False | |
265 |
|
266 | |||
266 | def getcwd(self): |
|
267 | def getcwd(self): | |
267 | return os.getcwd() # always outside the repo |
|
268 | return os.getcwd() # always outside the repo | |
268 |
|
269 | |||
269 | def _writebranchcache(self, branches, tip, tiprev): |
|
270 | def _writebranchcache(self, branches, tip, tiprev): | |
270 | # don't overwrite the disk cache with bundle-augmented data |
|
271 | # don't overwrite the disk cache with bundle-augmented data | |
271 | pass |
|
272 | pass | |
272 |
|
273 | |||
273 | def instance(ui, path, create): |
|
274 | def instance(ui, path, create): | |
274 | if create: |
|
275 | if create: | |
275 | raise util.Abort(_('cannot create new bundle repository')) |
|
276 | raise util.Abort(_('cannot create new bundle repository')) | |
276 | parentpath = ui.config("bundle", "mainreporoot", "") |
|
277 | parentpath = ui.config("bundle", "mainreporoot", "") | |
277 | if not parentpath: |
|
278 | if not parentpath: | |
278 | # try to find the correct path to the working directory repo |
|
279 | # try to find the correct path to the working directory repo | |
279 | parentpath = cmdutil.findrepo(os.getcwd()) |
|
280 | parentpath = cmdutil.findrepo(os.getcwd()) | |
280 | if parentpath is None: |
|
281 | if parentpath is None: | |
281 | parentpath = '' |
|
282 | parentpath = '' | |
282 | if parentpath: |
|
283 | if parentpath: | |
283 | # Try to make the full path relative so we get a nice, short URL. |
|
284 | # Try to make the full path relative so we get a nice, short URL. | |
284 | # In particular, we don't want temp dir names in test outputs. |
|
285 | # In particular, we don't want temp dir names in test outputs. | |
285 | cwd = os.getcwd() |
|
286 | cwd = os.getcwd() | |
286 | if parentpath == cwd: |
|
287 | if parentpath == cwd: | |
287 | parentpath = '' |
|
288 | parentpath = '' | |
288 | else: |
|
289 | else: | |
289 | cwd = os.path.join(cwd,'') |
|
290 | cwd = os.path.join(cwd,'') | |
290 | if parentpath.startswith(cwd): |
|
291 | if parentpath.startswith(cwd): | |
291 | parentpath = parentpath[len(cwd):] |
|
292 | parentpath = parentpath[len(cwd):] | |
292 | u = util.url(path) |
|
293 | u = util.url(path) | |
293 | path = u.localpath() |
|
294 | path = u.localpath() | |
294 | if u.scheme == 'bundle': |
|
295 | if u.scheme == 'bundle': | |
295 | s = path.split("+", 1) |
|
296 | s = path.split("+", 1) | |
296 | if len(s) == 1: |
|
297 | if len(s) == 1: | |
297 | repopath, bundlename = parentpath, s[0] |
|
298 | repopath, bundlename = parentpath, s[0] | |
298 | else: |
|
299 | else: | |
299 | repopath, bundlename = s |
|
300 | repopath, bundlename = s | |
300 | else: |
|
301 | else: | |
301 | repopath, bundlename = parentpath, path |
|
302 | repopath, bundlename = parentpath, path | |
302 | return bundlerepository(ui, repopath, bundlename) |
|
303 | return bundlerepository(ui, repopath, bundlename) | |
303 |
|
304 | |||
304 | def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None, |
|
305 | def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None, | |
305 | force=False): |
|
306 | force=False): | |
306 | '''obtains a bundle of changes incoming from other |
|
307 | '''obtains a bundle of changes incoming from other | |
307 |
|
308 | |||
308 | "onlyheads" restricts the returned changes to those reachable from the |
|
309 | "onlyheads" restricts the returned changes to those reachable from the | |
309 | specified heads. |
|
310 | specified heads. | |
310 | "bundlename", if given, stores the bundle to this file path permanently; |
|
311 | "bundlename", if given, stores the bundle to this file path permanently; | |
311 | otherwise it's stored to a temp file and gets deleted again when you call |
|
312 | otherwise it's stored to a temp file and gets deleted again when you call | |
312 | the returned "cleanupfn". |
|
313 | the returned "cleanupfn". | |
313 | "force" indicates whether to proceed on unrelated repos. |
|
314 | "force" indicates whether to proceed on unrelated repos. | |
314 |
|
315 | |||
315 | Returns a tuple (local, csets, cleanupfn): |
|
316 | Returns a tuple (local, csets, cleanupfn): | |
316 |
|
317 | |||
317 | "local" is a local repo from which to obtain the actual incoming changesets; it |
|
318 | "local" is a local repo from which to obtain the actual incoming changesets; it | |
318 | is a bundlerepo for the obtained bundle when the original "other" is remote. |
|
319 | is a bundlerepo for the obtained bundle when the original "other" is remote. | |
319 | "csets" lists the incoming changeset node ids. |
|
320 | "csets" lists the incoming changeset node ids. | |
320 | "cleanupfn" must be called without arguments when you're done processing the |
|
321 | "cleanupfn" must be called without arguments when you're done processing the | |
321 | changes; it closes both the original "other" and the one returned here. |
|
322 | changes; it closes both the original "other" and the one returned here. | |
322 | ''' |
|
323 | ''' | |
323 | tmp = discovery.findcommonincoming(repo, other, heads=onlyheads, force=force) |
|
324 | tmp = discovery.findcommonincoming(repo, other, heads=onlyheads, force=force) | |
324 | common, incoming, rheads = tmp |
|
325 | common, incoming, rheads = tmp | |
325 | if not incoming: |
|
326 | if not incoming: | |
326 | try: |
|
327 | try: | |
327 | if bundlename: |
|
328 | if bundlename: | |
328 | os.unlink(bundlename) |
|
329 | os.unlink(bundlename) | |
329 | except OSError: |
|
330 | except OSError: | |
330 | pass |
|
331 | pass | |
331 | return other, [], other.close |
|
332 | return other, [], other.close | |
332 |
|
333 | |||
333 | bundle = None |
|
334 | bundle = None | |
334 | bundlerepo = None |
|
335 | bundlerepo = None | |
335 | localrepo = other |
|
336 | localrepo = other | |
336 | if bundlename or not other.local(): |
|
337 | if bundlename or not other.local(): | |
337 | # create a bundle (uncompressed if other repo is not local) |
|
338 | # create a bundle (uncompressed if other repo is not local) | |
338 |
|
339 | |||
339 | if other.capable('getbundle'): |
|
340 | if other.capable('getbundle'): | |
340 | cg = other.getbundle('incoming', common=common, heads=rheads) |
|
341 | cg = other.getbundle('incoming', common=common, heads=rheads) | |
341 | elif onlyheads is None and not other.capable('changegroupsubset'): |
|
342 | elif onlyheads is None and not other.capable('changegroupsubset'): | |
342 | # compat with older servers when pulling all remote heads |
|
343 | # compat with older servers when pulling all remote heads | |
343 | cg = other.changegroup(incoming, "incoming") |
|
344 | cg = other.changegroup(incoming, "incoming") | |
344 | rheads = None |
|
345 | rheads = None | |
345 | else: |
|
346 | else: | |
346 | cg = other.changegroupsubset(incoming, rheads, 'incoming') |
|
347 | cg = other.changegroupsubset(incoming, rheads, 'incoming') | |
347 | bundletype = other.local() and "HG10BZ" or "HG10UN" |
|
348 | bundletype = other.local() and "HG10BZ" or "HG10UN" | |
348 | fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) |
|
349 | fname = bundle = changegroup.writebundle(cg, bundlename, bundletype) | |
349 | # keep written bundle? |
|
350 | # keep written bundle? | |
350 | if bundlename: |
|
351 | if bundlename: | |
351 | bundle = None |
|
352 | bundle = None | |
352 | if not other.local(): |
|
353 | if not other.local(): | |
353 | # use the created uncompressed bundlerepo |
|
354 | # use the created uncompressed bundlerepo | |
354 | localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) |
|
355 | localrepo = bundlerepo = bundlerepository(ui, repo.root, fname) | |
355 | # this repo contains local and other now, so filter out local again |
|
356 | # this repo contains local and other now, so filter out local again | |
356 | common = repo.heads() |
|
357 | common = repo.heads() | |
357 |
|
358 | |||
358 | csets = localrepo.changelog.findmissing(common, rheads) |
|
359 | csets = localrepo.changelog.findmissing(common, rheads) | |
359 |
|
360 | |||
360 | def cleanup(): |
|
361 | def cleanup(): | |
361 | if bundlerepo: |
|
362 | if bundlerepo: | |
362 | bundlerepo.close() |
|
363 | bundlerepo.close() | |
363 | if bundle: |
|
364 | if bundle: | |
364 | os.unlink(bundle) |
|
365 | os.unlink(bundle) | |
365 | other.close() |
|
366 | other.close() | |
366 |
|
367 | |||
367 | return (localrepo, csets, cleanup) |
|
368 | return (localrepo, csets, cleanup) | |
368 |
|
369 |
@@ -1,1023 +1,1055 | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > graphlog= |
|
3 | > graphlog= | |
4 | > EOF |
|
4 | > EOF | |
5 | $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; } |
|
5 | $ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; } | |
6 |
|
6 | |||
7 | $ mkcommit() { |
|
7 | $ mkcommit() { | |
8 | > echo "$1" > "$1" |
|
8 | > echo "$1" > "$1" | |
9 | > hg add "$1" |
|
9 | > hg add "$1" | |
10 | > message="$1" |
|
10 | > message="$1" | |
11 | > shift |
|
11 | > shift | |
12 | > hg ci -m "$message" $* |
|
12 | > hg ci -m "$message" $* | |
13 | > } |
|
13 | > } | |
14 |
|
14 | |||
15 | $ hg init alpha |
|
15 | $ hg init alpha | |
16 | $ cd alpha |
|
16 | $ cd alpha | |
17 | $ mkcommit a-A |
|
17 | $ mkcommit a-A | |
18 | $ mkcommit a-B |
|
18 | $ mkcommit a-B | |
19 | $ mkcommit a-C |
|
19 | $ mkcommit a-C | |
20 | $ mkcommit a-D |
|
20 | $ mkcommit a-D | |
21 | $ hgph |
|
21 | $ hgph | |
22 | @ 3 draft a-D - b555f63b6063 |
|
22 | @ 3 draft a-D - b555f63b6063 | |
23 | | |
|
23 | | | |
24 | o 2 draft a-C - 54acac6f23ab |
|
24 | o 2 draft a-C - 54acac6f23ab | |
25 | | |
|
25 | | | |
26 | o 1 draft a-B - 548a3d25dbf0 |
|
26 | o 1 draft a-B - 548a3d25dbf0 | |
27 | | |
|
27 | | | |
28 | o 0 draft a-A - 054250a37db4 |
|
28 | o 0 draft a-A - 054250a37db4 | |
29 |
|
29 | |||
30 |
|
30 | |||
31 | $ hg init ../beta |
|
31 | $ hg init ../beta | |
32 | $ hg push -r 1 ../beta |
|
32 | $ hg push -r 1 ../beta | |
33 | pushing to ../beta |
|
33 | pushing to ../beta | |
34 | searching for changes |
|
34 | searching for changes | |
35 | adding changesets |
|
35 | adding changesets | |
36 | adding manifests |
|
36 | adding manifests | |
37 | adding file changes |
|
37 | adding file changes | |
38 | added 2 changesets with 2 changes to 2 files |
|
38 | added 2 changesets with 2 changes to 2 files | |
39 | $ hgph |
|
39 | $ hgph | |
40 | @ 3 draft a-D - b555f63b6063 |
|
40 | @ 3 draft a-D - b555f63b6063 | |
41 | | |
|
41 | | | |
42 | o 2 draft a-C - 54acac6f23ab |
|
42 | o 2 draft a-C - 54acac6f23ab | |
43 | | |
|
43 | | | |
44 | o 1 public a-B - 548a3d25dbf0 |
|
44 | o 1 public a-B - 548a3d25dbf0 | |
45 | | |
|
45 | | | |
46 | o 0 public a-A - 054250a37db4 |
|
46 | o 0 public a-A - 054250a37db4 | |
47 |
|
47 | |||
48 |
|
48 | |||
49 | $ cd ../beta |
|
49 | $ cd ../beta | |
50 | $ hgph |
|
50 | $ hgph | |
51 | o 1 public a-B - 548a3d25dbf0 |
|
51 | o 1 public a-B - 548a3d25dbf0 | |
52 | | |
|
52 | | | |
53 | o 0 public a-A - 054250a37db4 |
|
53 | o 0 public a-A - 054250a37db4 | |
54 |
|
54 | |||
55 | $ hg up -q |
|
55 | $ hg up -q | |
56 | $ mkcommit b-A |
|
56 | $ mkcommit b-A | |
57 | $ hgph |
|
57 | $ hgph | |
58 | @ 2 draft b-A - f54f1bb90ff3 |
|
58 | @ 2 draft b-A - f54f1bb90ff3 | |
59 | | |
|
59 | | | |
60 | o 1 public a-B - 548a3d25dbf0 |
|
60 | o 1 public a-B - 548a3d25dbf0 | |
61 | | |
|
61 | | | |
62 | o 0 public a-A - 054250a37db4 |
|
62 | o 0 public a-A - 054250a37db4 | |
63 |
|
63 | |||
64 | $ hg pull ../alpha |
|
64 | $ hg pull ../alpha | |
65 | pulling from ../alpha |
|
65 | pulling from ../alpha | |
66 | searching for changes |
|
66 | searching for changes | |
67 | adding changesets |
|
67 | adding changesets | |
68 | adding manifests |
|
68 | adding manifests | |
69 | adding file changes |
|
69 | adding file changes | |
70 | added 2 changesets with 2 changes to 2 files (+1 heads) |
|
70 | added 2 changesets with 2 changes to 2 files (+1 heads) | |
71 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
71 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
72 | $ hgph |
|
72 | $ hgph | |
73 | o 4 public a-D - b555f63b6063 |
|
73 | o 4 public a-D - b555f63b6063 | |
74 | | |
|
74 | | | |
75 | o 3 public a-C - 54acac6f23ab |
|
75 | o 3 public a-C - 54acac6f23ab | |
76 | | |
|
76 | | | |
77 | | @ 2 draft b-A - f54f1bb90ff3 |
|
77 | | @ 2 draft b-A - f54f1bb90ff3 | |
78 | |/ |
|
78 | |/ | |
79 | o 1 public a-B - 548a3d25dbf0 |
|
79 | o 1 public a-B - 548a3d25dbf0 | |
80 | | |
|
80 | | | |
81 | o 0 public a-A - 054250a37db4 |
|
81 | o 0 public a-A - 054250a37db4 | |
82 |
|
82 | |||
83 |
|
83 | |||
84 | pull did not updated ../alpha state. |
|
84 | pull did not updated ../alpha state. | |
85 | push from alpha to beta should update phase even if nothing is transfered |
|
85 | push from alpha to beta should update phase even if nothing is transfered | |
86 |
|
86 | |||
87 | $ cd ../alpha |
|
87 | $ cd ../alpha | |
88 | $ hgph # not updated by remote pull |
|
88 | $ hgph # not updated by remote pull | |
89 | @ 3 draft a-D - b555f63b6063 |
|
89 | @ 3 draft a-D - b555f63b6063 | |
90 | | |
|
90 | | | |
91 | o 2 draft a-C - 54acac6f23ab |
|
91 | o 2 draft a-C - 54acac6f23ab | |
92 | | |
|
92 | | | |
93 | o 1 public a-B - 548a3d25dbf0 |
|
93 | o 1 public a-B - 548a3d25dbf0 | |
94 | | |
|
94 | | | |
95 | o 0 public a-A - 054250a37db4 |
|
95 | o 0 public a-A - 054250a37db4 | |
96 |
|
96 | |||
97 | $ hg push ../beta |
|
97 | $ hg push ../beta | |
98 | pushing to ../beta |
|
98 | pushing to ../beta | |
99 | searching for changes |
|
99 | searching for changes | |
100 | no changes found |
|
100 | no changes found | |
101 | [1] |
|
101 | [1] | |
102 | $ hgph |
|
102 | $ hgph | |
103 | @ 3 public a-D - b555f63b6063 |
|
103 | @ 3 public a-D - b555f63b6063 | |
104 | | |
|
104 | | | |
105 | o 2 public a-C - 54acac6f23ab |
|
105 | o 2 public a-C - 54acac6f23ab | |
106 | | |
|
106 | | | |
107 | o 1 public a-B - 548a3d25dbf0 |
|
107 | o 1 public a-B - 548a3d25dbf0 | |
108 | | |
|
108 | | | |
109 | o 0 public a-A - 054250a37db4 |
|
109 | o 0 public a-A - 054250a37db4 | |
110 |
|
110 | |||
111 |
|
111 | |||
112 | update must update phase of common changeset too |
|
112 | update must update phase of common changeset too | |
113 |
|
113 | |||
114 | $ hg pull ../beta # getting b-A |
|
114 | $ hg pull ../beta # getting b-A | |
115 | pulling from ../beta |
|
115 | pulling from ../beta | |
116 | searching for changes |
|
116 | searching for changes | |
117 | adding changesets |
|
117 | adding changesets | |
118 | adding manifests |
|
118 | adding manifests | |
119 | adding file changes |
|
119 | adding file changes | |
120 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
120 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
121 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
121 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
122 |
|
122 | |||
123 | $ cd ../beta |
|
123 | $ cd ../beta | |
124 | $ hgph # not updated by remote pull |
|
124 | $ hgph # not updated by remote pull | |
125 | o 4 public a-D - b555f63b6063 |
|
125 | o 4 public a-D - b555f63b6063 | |
126 | | |
|
126 | | | |
127 | o 3 public a-C - 54acac6f23ab |
|
127 | o 3 public a-C - 54acac6f23ab | |
128 | | |
|
128 | | | |
129 | | @ 2 draft b-A - f54f1bb90ff3 |
|
129 | | @ 2 draft b-A - f54f1bb90ff3 | |
130 | |/ |
|
130 | |/ | |
131 | o 1 public a-B - 548a3d25dbf0 |
|
131 | o 1 public a-B - 548a3d25dbf0 | |
132 | | |
|
132 | | | |
133 | o 0 public a-A - 054250a37db4 |
|
133 | o 0 public a-A - 054250a37db4 | |
134 |
|
134 | |||
135 | $ hg pull ../alpha |
|
135 | $ hg pull ../alpha | |
136 | pulling from ../alpha |
|
136 | pulling from ../alpha | |
137 | searching for changes |
|
137 | searching for changes | |
138 | no changes found |
|
138 | no changes found | |
139 | $ hgph |
|
139 | $ hgph | |
140 | o 4 public a-D - b555f63b6063 |
|
140 | o 4 public a-D - b555f63b6063 | |
141 | | |
|
141 | | | |
142 | o 3 public a-C - 54acac6f23ab |
|
142 | o 3 public a-C - 54acac6f23ab | |
143 | | |
|
143 | | | |
144 | | @ 2 public b-A - f54f1bb90ff3 |
|
144 | | @ 2 public b-A - f54f1bb90ff3 | |
145 | |/ |
|
145 | |/ | |
146 | o 1 public a-B - 548a3d25dbf0 |
|
146 | o 1 public a-B - 548a3d25dbf0 | |
147 | | |
|
147 | | | |
148 | o 0 public a-A - 054250a37db4 |
|
148 | o 0 public a-A - 054250a37db4 | |
149 |
|
149 | |||
150 |
|
150 | |||
151 | Publish configuration option |
|
151 | Publish configuration option | |
152 | ---------------------------- |
|
152 | ---------------------------- | |
153 |
|
153 | |||
154 | Pull |
|
154 | Pull | |
155 | ```` |
|
155 | ```` | |
156 |
|
156 | |||
157 | changegroup are added without phase movement |
|
157 | changegroup are added without phase movement | |
158 |
|
158 | |||
159 | $ hg bundle -a ../base.bundle |
|
159 | $ hg bundle -a ../base.bundle | |
160 | 5 changesets found |
|
160 | 5 changesets found | |
161 | $ cd .. |
|
161 | $ cd .. | |
162 | $ hg init mu |
|
162 | $ hg init mu | |
163 | $ cd mu |
|
163 | $ cd mu | |
164 | $ cat > .hg/hgrc << EOF |
|
164 | $ cat > .hg/hgrc << EOF | |
165 | > [phases] |
|
165 | > [phases] | |
166 | > publish=0 |
|
166 | > publish=0 | |
167 | > EOF |
|
167 | > EOF | |
168 | $ hg unbundle ../base.bundle |
|
168 | $ hg unbundle ../base.bundle | |
169 | adding changesets |
|
169 | adding changesets | |
170 | adding manifests |
|
170 | adding manifests | |
171 | adding file changes |
|
171 | adding file changes | |
172 | added 5 changesets with 5 changes to 5 files (+1 heads) |
|
172 | added 5 changesets with 5 changes to 5 files (+1 heads) | |
173 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
173 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
174 | $ hgph |
|
174 | $ hgph | |
175 | o 4 draft a-D - b555f63b6063 |
|
175 | o 4 draft a-D - b555f63b6063 | |
176 | | |
|
176 | | | |
177 | o 3 draft a-C - 54acac6f23ab |
|
177 | o 3 draft a-C - 54acac6f23ab | |
178 | | |
|
178 | | | |
179 | | o 2 draft b-A - f54f1bb90ff3 |
|
179 | | o 2 draft b-A - f54f1bb90ff3 | |
180 | |/ |
|
180 | |/ | |
181 | o 1 draft a-B - 548a3d25dbf0 |
|
181 | o 1 draft a-B - 548a3d25dbf0 | |
182 | | |
|
182 | | | |
183 | o 0 draft a-A - 054250a37db4 |
|
183 | o 0 draft a-A - 054250a37db4 | |
184 |
|
184 | |||
185 | $ cd .. |
|
185 | $ cd .. | |
186 |
|
186 | |||
187 | Pulling from publish=False to publish=False does not move boundary. |
|
187 | Pulling from publish=False to publish=False does not move boundary. | |
188 |
|
188 | |||
189 | $ hg init nu |
|
189 | $ hg init nu | |
190 | $ cd nu |
|
190 | $ cd nu | |
191 | $ cat > .hg/hgrc << EOF |
|
191 | $ cat > .hg/hgrc << EOF | |
192 | > [phases] |
|
192 | > [phases] | |
193 | > publish=0 |
|
193 | > publish=0 | |
194 | > EOF |
|
194 | > EOF | |
195 | $ hg pull ../mu -r 54acac6f23ab |
|
195 | $ hg pull ../mu -r 54acac6f23ab | |
196 | pulling from ../mu |
|
196 | pulling from ../mu | |
197 | adding changesets |
|
197 | adding changesets | |
198 | adding manifests |
|
198 | adding manifests | |
199 | adding file changes |
|
199 | adding file changes | |
200 | added 3 changesets with 3 changes to 3 files |
|
200 | added 3 changesets with 3 changes to 3 files | |
201 | (run 'hg update' to get a working copy) |
|
201 | (run 'hg update' to get a working copy) | |
202 | $ hgph |
|
202 | $ hgph | |
203 | o 2 draft a-C - 54acac6f23ab |
|
203 | o 2 draft a-C - 54acac6f23ab | |
204 | | |
|
204 | | | |
205 | o 1 draft a-B - 548a3d25dbf0 |
|
205 | o 1 draft a-B - 548a3d25dbf0 | |
206 | | |
|
206 | | | |
207 | o 0 draft a-A - 054250a37db4 |
|
207 | o 0 draft a-A - 054250a37db4 | |
208 |
|
208 | |||
209 |
|
209 | |||
210 | Even for common |
|
210 | Even for common | |
211 |
|
211 | |||
212 | $ hg pull ../mu -r f54f1bb90ff3 |
|
212 | $ hg pull ../mu -r f54f1bb90ff3 | |
213 | pulling from ../mu |
|
213 | pulling from ../mu | |
214 | searching for changes |
|
214 | searching for changes | |
215 | adding changesets |
|
215 | adding changesets | |
216 | adding manifests |
|
216 | adding manifests | |
217 | adding file changes |
|
217 | adding file changes | |
218 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
218 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
219 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
219 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
220 | $ hgph |
|
220 | $ hgph | |
221 | o 3 draft b-A - f54f1bb90ff3 |
|
221 | o 3 draft b-A - f54f1bb90ff3 | |
222 | | |
|
222 | | | |
223 | | o 2 draft a-C - 54acac6f23ab |
|
223 | | o 2 draft a-C - 54acac6f23ab | |
224 | |/ |
|
224 | |/ | |
225 | o 1 draft a-B - 548a3d25dbf0 |
|
225 | o 1 draft a-B - 548a3d25dbf0 | |
226 | | |
|
226 | | | |
227 | o 0 draft a-A - 054250a37db4 |
|
227 | o 0 draft a-A - 054250a37db4 | |
228 |
|
228 | |||
229 |
|
229 | |||
230 |
|
230 | |||
231 | Pulling from Publish=True to Publish=False move boundary in common set. |
|
231 | Pulling from Publish=True to Publish=False move boundary in common set. | |
232 | we are in nu |
|
232 | we are in nu | |
233 |
|
233 | |||
234 | $ hg pull ../alpha -r b555f63b6063 |
|
234 | $ hg pull ../alpha -r b555f63b6063 | |
235 | pulling from ../alpha |
|
235 | pulling from ../alpha | |
236 | searching for changes |
|
236 | searching for changes | |
237 | adding changesets |
|
237 | adding changesets | |
238 | adding manifests |
|
238 | adding manifests | |
239 | adding file changes |
|
239 | adding file changes | |
240 | added 1 changesets with 1 changes to 1 files |
|
240 | added 1 changesets with 1 changes to 1 files | |
241 | (run 'hg update' to get a working copy) |
|
241 | (run 'hg update' to get a working copy) | |
242 | $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r |
|
242 | $ hgph # f54f1bb90ff3 stay draft, not ancestor of -r | |
243 | o 4 public a-D - b555f63b6063 |
|
243 | o 4 public a-D - b555f63b6063 | |
244 | | |
|
244 | | | |
245 | | o 3 draft b-A - f54f1bb90ff3 |
|
245 | | o 3 draft b-A - f54f1bb90ff3 | |
246 | | | |
|
246 | | | | |
247 | o | 2 public a-C - 54acac6f23ab |
|
247 | o | 2 public a-C - 54acac6f23ab | |
248 | |/ |
|
248 | |/ | |
249 | o 1 public a-B - 548a3d25dbf0 |
|
249 | o 1 public a-B - 548a3d25dbf0 | |
250 | | |
|
250 | | | |
251 | o 0 public a-A - 054250a37db4 |
|
251 | o 0 public a-A - 054250a37db4 | |
252 |
|
252 | |||
253 |
|
253 | |||
254 | pulling from Publish=False to publish=False with some public |
|
254 | pulling from Publish=False to publish=False with some public | |
255 |
|
255 | |||
256 | $ hg up -q f54f1bb90ff3 |
|
256 | $ hg up -q f54f1bb90ff3 | |
257 | $ mkcommit n-A |
|
257 | $ mkcommit n-A | |
258 | $ mkcommit n-B |
|
258 | $ mkcommit n-B | |
259 | $ hgph |
|
259 | $ hgph | |
260 | @ 6 draft n-B - 145e75495359 |
|
260 | @ 6 draft n-B - 145e75495359 | |
261 | | |
|
261 | | | |
262 | o 5 draft n-A - d6bcb4f74035 |
|
262 | o 5 draft n-A - d6bcb4f74035 | |
263 | | |
|
263 | | | |
264 | | o 4 public a-D - b555f63b6063 |
|
264 | | o 4 public a-D - b555f63b6063 | |
265 | | | |
|
265 | | | | |
266 | o | 3 draft b-A - f54f1bb90ff3 |
|
266 | o | 3 draft b-A - f54f1bb90ff3 | |
267 | | | |
|
267 | | | | |
268 | | o 2 public a-C - 54acac6f23ab |
|
268 | | o 2 public a-C - 54acac6f23ab | |
269 | |/ |
|
269 | |/ | |
270 | o 1 public a-B - 548a3d25dbf0 |
|
270 | o 1 public a-B - 548a3d25dbf0 | |
271 | | |
|
271 | | | |
272 | o 0 public a-A - 054250a37db4 |
|
272 | o 0 public a-A - 054250a37db4 | |
273 |
|
273 | |||
274 | $ cd ../mu |
|
274 | $ cd ../mu | |
275 | $ hg pull ../nu |
|
275 | $ hg pull ../nu | |
276 | pulling from ../nu |
|
276 | pulling from ../nu | |
277 | searching for changes |
|
277 | searching for changes | |
278 | adding changesets |
|
278 | adding changesets | |
279 | adding manifests |
|
279 | adding manifests | |
280 | adding file changes |
|
280 | adding file changes | |
281 | added 2 changesets with 2 changes to 2 files |
|
281 | added 2 changesets with 2 changes to 2 files | |
282 | (run 'hg update' to get a working copy) |
|
282 | (run 'hg update' to get a working copy) | |
283 | $ hgph |
|
283 | $ hgph | |
284 | o 6 draft n-B - 145e75495359 |
|
284 | o 6 draft n-B - 145e75495359 | |
285 | | |
|
285 | | | |
286 | o 5 draft n-A - d6bcb4f74035 |
|
286 | o 5 draft n-A - d6bcb4f74035 | |
287 | | |
|
287 | | | |
288 | | o 4 public a-D - b555f63b6063 |
|
288 | | o 4 public a-D - b555f63b6063 | |
289 | | | |
|
289 | | | | |
290 | | o 3 public a-C - 54acac6f23ab |
|
290 | | o 3 public a-C - 54acac6f23ab | |
291 | | | |
|
291 | | | | |
292 | o | 2 draft b-A - f54f1bb90ff3 |
|
292 | o | 2 draft b-A - f54f1bb90ff3 | |
293 | |/ |
|
293 | |/ | |
294 | o 1 public a-B - 548a3d25dbf0 |
|
294 | o 1 public a-B - 548a3d25dbf0 | |
295 | | |
|
295 | | | |
296 | o 0 public a-A - 054250a37db4 |
|
296 | o 0 public a-A - 054250a37db4 | |
297 |
|
297 | |||
298 | $ cd .. |
|
298 | $ cd .. | |
299 |
|
299 | |||
300 | pulling into publish=True |
|
300 | pulling into publish=True | |
301 |
|
301 | |||
302 | $ cd alpha |
|
302 | $ cd alpha | |
303 | $ hgph |
|
303 | $ hgph | |
304 | o 4 public b-A - f54f1bb90ff3 |
|
304 | o 4 public b-A - f54f1bb90ff3 | |
305 | | |
|
305 | | | |
306 | | @ 3 public a-D - b555f63b6063 |
|
306 | | @ 3 public a-D - b555f63b6063 | |
307 | | | |
|
307 | | | | |
308 | | o 2 public a-C - 54acac6f23ab |
|
308 | | o 2 public a-C - 54acac6f23ab | |
309 | |/ |
|
309 | |/ | |
310 | o 1 public a-B - 548a3d25dbf0 |
|
310 | o 1 public a-B - 548a3d25dbf0 | |
311 | | |
|
311 | | | |
312 | o 0 public a-A - 054250a37db4 |
|
312 | o 0 public a-A - 054250a37db4 | |
313 |
|
313 | |||
314 | $ hg pull ../mu |
|
314 | $ hg pull ../mu | |
315 | pulling from ../mu |
|
315 | pulling from ../mu | |
316 | searching for changes |
|
316 | searching for changes | |
317 | adding changesets |
|
317 | adding changesets | |
318 | adding manifests |
|
318 | adding manifests | |
319 | adding file changes |
|
319 | adding file changes | |
320 | added 2 changesets with 2 changes to 2 files |
|
320 | added 2 changesets with 2 changes to 2 files | |
321 | (run 'hg update' to get a working copy) |
|
321 | (run 'hg update' to get a working copy) | |
322 | $ hgph |
|
322 | $ hgph | |
323 | o 6 draft n-B - 145e75495359 |
|
323 | o 6 draft n-B - 145e75495359 | |
324 | | |
|
324 | | | |
325 | o 5 draft n-A - d6bcb4f74035 |
|
325 | o 5 draft n-A - d6bcb4f74035 | |
326 | | |
|
326 | | | |
327 | o 4 public b-A - f54f1bb90ff3 |
|
327 | o 4 public b-A - f54f1bb90ff3 | |
328 | | |
|
328 | | | |
329 | | @ 3 public a-D - b555f63b6063 |
|
329 | | @ 3 public a-D - b555f63b6063 | |
330 | | | |
|
330 | | | | |
331 | | o 2 public a-C - 54acac6f23ab |
|
331 | | o 2 public a-C - 54acac6f23ab | |
332 | |/ |
|
332 | |/ | |
333 | o 1 public a-B - 548a3d25dbf0 |
|
333 | o 1 public a-B - 548a3d25dbf0 | |
334 | | |
|
334 | | | |
335 | o 0 public a-A - 054250a37db4 |
|
335 | o 0 public a-A - 054250a37db4 | |
336 |
|
336 | |||
337 | $ cd .. |
|
337 | $ cd .. | |
338 |
|
338 | |||
339 | pulling back into original repo |
|
339 | pulling back into original repo | |
340 |
|
340 | |||
341 | $ cd nu |
|
341 | $ cd nu | |
342 | $ hg pull ../alpha |
|
342 | $ hg pull ../alpha | |
343 | pulling from ../alpha |
|
343 | pulling from ../alpha | |
344 | searching for changes |
|
344 | searching for changes | |
345 | no changes found |
|
345 | no changes found | |
346 | $ hgph |
|
346 | $ hgph | |
347 | @ 6 public n-B - 145e75495359 |
|
347 | @ 6 public n-B - 145e75495359 | |
348 | | |
|
348 | | | |
349 | o 5 public n-A - d6bcb4f74035 |
|
349 | o 5 public n-A - d6bcb4f74035 | |
350 | | |
|
350 | | | |
351 | | o 4 public a-D - b555f63b6063 |
|
351 | | o 4 public a-D - b555f63b6063 | |
352 | | | |
|
352 | | | | |
353 | o | 3 public b-A - f54f1bb90ff3 |
|
353 | o | 3 public b-A - f54f1bb90ff3 | |
354 | | | |
|
354 | | | | |
355 | | o 2 public a-C - 54acac6f23ab |
|
355 | | o 2 public a-C - 54acac6f23ab | |
356 | |/ |
|
356 | |/ | |
357 | o 1 public a-B - 548a3d25dbf0 |
|
357 | o 1 public a-B - 548a3d25dbf0 | |
358 | | |
|
358 | | | |
359 | o 0 public a-A - 054250a37db4 |
|
359 | o 0 public a-A - 054250a37db4 | |
360 |
|
360 | |||
361 |
|
361 | |||
362 | Push |
|
362 | Push | |
363 | ```` |
|
363 | ```` | |
364 |
|
364 | |||
365 | (inserted) |
|
365 | (inserted) | |
366 |
|
366 | |||
367 | Test that phase are pushed even when they are nothing to pus |
|
367 | Test that phase are pushed even when they are nothing to pus | |
368 | (this might be tested later bu are very convenient to not alter too much test) |
|
368 | (this might be tested later bu are very convenient to not alter too much test) | |
369 |
|
369 | |||
370 | Push back to alpha |
|
370 | Push back to alpha | |
371 |
|
371 | |||
372 | $ hg push ../alpha # from nu |
|
372 | $ hg push ../alpha # from nu | |
373 | pushing to ../alpha |
|
373 | pushing to ../alpha | |
374 | searching for changes |
|
374 | searching for changes | |
375 | no changes found |
|
375 | no changes found | |
376 | [1] |
|
376 | [1] | |
377 | $ cd .. |
|
377 | $ cd .. | |
378 | $ cd alpha |
|
378 | $ cd alpha | |
379 | $ hgph |
|
379 | $ hgph | |
380 | o 6 public n-B - 145e75495359 |
|
380 | o 6 public n-B - 145e75495359 | |
381 | | |
|
381 | | | |
382 | o 5 public n-A - d6bcb4f74035 |
|
382 | o 5 public n-A - d6bcb4f74035 | |
383 | | |
|
383 | | | |
384 | o 4 public b-A - f54f1bb90ff3 |
|
384 | o 4 public b-A - f54f1bb90ff3 | |
385 | | |
|
385 | | | |
386 | | @ 3 public a-D - b555f63b6063 |
|
386 | | @ 3 public a-D - b555f63b6063 | |
387 | | | |
|
387 | | | | |
388 | | o 2 public a-C - 54acac6f23ab |
|
388 | | o 2 public a-C - 54acac6f23ab | |
389 | |/ |
|
389 | |/ | |
390 | o 1 public a-B - 548a3d25dbf0 |
|
390 | o 1 public a-B - 548a3d25dbf0 | |
391 | | |
|
391 | | | |
392 | o 0 public a-A - 054250a37db4 |
|
392 | o 0 public a-A - 054250a37db4 | |
393 |
|
393 | |||
394 |
|
394 | |||
395 | (end insertion) |
|
395 | (end insertion) | |
396 |
|
396 | |||
397 |
|
397 | |||
398 | initial setup |
|
398 | initial setup | |
399 |
|
399 | |||
400 | $ hg glog # of alpha |
|
400 | $ hg glog # of alpha | |
401 | o changeset: 6:145e75495359 |
|
401 | o changeset: 6:145e75495359 | |
402 | | tag: tip |
|
402 | | tag: tip | |
403 | | user: test |
|
403 | | user: test | |
404 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
404 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
405 | | summary: n-B |
|
405 | | summary: n-B | |
406 | | |
|
406 | | | |
407 | o changeset: 5:d6bcb4f74035 |
|
407 | o changeset: 5:d6bcb4f74035 | |
408 | | user: test |
|
408 | | user: test | |
409 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
410 | | summary: n-A |
|
410 | | summary: n-A | |
411 | | |
|
411 | | | |
412 | o changeset: 4:f54f1bb90ff3 |
|
412 | o changeset: 4:f54f1bb90ff3 | |
413 | | parent: 1:548a3d25dbf0 |
|
413 | | parent: 1:548a3d25dbf0 | |
414 | | user: test |
|
414 | | user: test | |
415 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
415 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
416 | | summary: b-A |
|
416 | | summary: b-A | |
417 | | |
|
417 | | | |
418 | | @ changeset: 3:b555f63b6063 |
|
418 | | @ changeset: 3:b555f63b6063 | |
419 | | | user: test |
|
419 | | | user: test | |
420 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
420 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
421 | | | summary: a-D |
|
421 | | | summary: a-D | |
422 | | | |
|
422 | | | | |
423 | | o changeset: 2:54acac6f23ab |
|
423 | | o changeset: 2:54acac6f23ab | |
424 | |/ user: test |
|
424 | |/ user: test | |
425 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
425 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
426 | | summary: a-C |
|
426 | | summary: a-C | |
427 | | |
|
427 | | | |
428 | o changeset: 1:548a3d25dbf0 |
|
428 | o changeset: 1:548a3d25dbf0 | |
429 | | user: test |
|
429 | | user: test | |
430 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
430 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
431 | | summary: a-B |
|
431 | | summary: a-B | |
432 | | |
|
432 | | | |
433 | o changeset: 0:054250a37db4 |
|
433 | o changeset: 0:054250a37db4 | |
434 | user: test |
|
434 | user: test | |
435 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
435 | date: Thu Jan 01 00:00:00 1970 +0000 | |
436 | summary: a-A |
|
436 | summary: a-A | |
437 |
|
437 | |||
438 | $ mkcommit a-E |
|
438 | $ mkcommit a-E | |
439 | $ mkcommit a-F |
|
439 | $ mkcommit a-F | |
440 | $ mkcommit a-G |
|
440 | $ mkcommit a-G | |
441 | $ hg up d6bcb4f74035 -q |
|
441 | $ hg up d6bcb4f74035 -q | |
442 | $ mkcommit a-H |
|
442 | $ mkcommit a-H | |
443 | created new head |
|
443 | created new head | |
444 | $ hgph |
|
444 | $ hgph | |
445 | @ 10 draft a-H - 967b449fbc94 |
|
445 | @ 10 draft a-H - 967b449fbc94 | |
446 | | |
|
446 | | | |
447 | | o 9 draft a-G - 3e27b6f1eee1 |
|
447 | | o 9 draft a-G - 3e27b6f1eee1 | |
448 | | | |
|
448 | | | | |
449 | | o 8 draft a-F - b740e3e5c05d |
|
449 | | o 8 draft a-F - b740e3e5c05d | |
450 | | | |
|
450 | | | | |
451 | | o 7 draft a-E - e9f537e46dea |
|
451 | | o 7 draft a-E - e9f537e46dea | |
452 | | | |
|
452 | | | | |
453 | +---o 6 public n-B - 145e75495359 |
|
453 | +---o 6 public n-B - 145e75495359 | |
454 | | | |
|
454 | | | | |
455 | o | 5 public n-A - d6bcb4f74035 |
|
455 | o | 5 public n-A - d6bcb4f74035 | |
456 | | | |
|
456 | | | | |
457 | o | 4 public b-A - f54f1bb90ff3 |
|
457 | o | 4 public b-A - f54f1bb90ff3 | |
458 | | | |
|
458 | | | | |
459 | | o 3 public a-D - b555f63b6063 |
|
459 | | o 3 public a-D - b555f63b6063 | |
460 | | | |
|
460 | | | | |
461 | | o 2 public a-C - 54acac6f23ab |
|
461 | | o 2 public a-C - 54acac6f23ab | |
462 | |/ |
|
462 | |/ | |
463 | o 1 public a-B - 548a3d25dbf0 |
|
463 | o 1 public a-B - 548a3d25dbf0 | |
464 | | |
|
464 | | | |
465 | o 0 public a-A - 054250a37db4 |
|
465 | o 0 public a-A - 054250a37db4 | |
466 |
|
466 | |||
467 |
|
467 | |||
|
468 | Pulling from bundle does not alter phases of changeset not present in the bundle | |||
|
469 | ||||
|
470 | $ hg bundle --base 1 -r 6 -r 3 ../partial-bundle.hg | |||
|
471 | 5 changesets found | |||
|
472 | $ hg pull ../partial-bundle.hg | |||
|
473 | pulling from ../partial-bundle.hg | |||
|
474 | searching for changes | |||
|
475 | no changes found | |||
|
476 | $ hgph | |||
|
477 | @ 10 draft a-H - 967b449fbc94 | |||
|
478 | | | |||
|
479 | | o 9 draft a-G - 3e27b6f1eee1 | |||
|
480 | | | | |||
|
481 | | o 8 draft a-F - b740e3e5c05d | |||
|
482 | | | | |||
|
483 | | o 7 draft a-E - e9f537e46dea | |||
|
484 | | | | |||
|
485 | +---o 6 public n-B - 145e75495359 | |||
|
486 | | | | |||
|
487 | o | 5 public n-A - d6bcb4f74035 | |||
|
488 | | | | |||
|
489 | o | 4 public b-A - f54f1bb90ff3 | |||
|
490 | | | | |||
|
491 | | o 3 public a-D - b555f63b6063 | |||
|
492 | | | | |||
|
493 | | o 2 public a-C - 54acac6f23ab | |||
|
494 | |/ | |||
|
495 | o 1 public a-B - 548a3d25dbf0 | |||
|
496 | | | |||
|
497 | o 0 public a-A - 054250a37db4 | |||
|
498 | ||||
|
499 | ||||
468 | Pushing to Publish=False (unknown changeset) |
|
500 | Pushing to Publish=False (unknown changeset) | |
469 |
|
501 | |||
470 | $ hg push ../mu -r b740e3e5c05d # a-F |
|
502 | $ hg push ../mu -r b740e3e5c05d # a-F | |
471 | pushing to ../mu |
|
503 | pushing to ../mu | |
472 | searching for changes |
|
504 | searching for changes | |
473 | adding changesets |
|
505 | adding changesets | |
474 | adding manifests |
|
506 | adding manifests | |
475 | adding file changes |
|
507 | adding file changes | |
476 | added 2 changesets with 2 changes to 2 files |
|
508 | added 2 changesets with 2 changes to 2 files | |
477 | $ hgph |
|
509 | $ hgph | |
478 | @ 10 draft a-H - 967b449fbc94 |
|
510 | @ 10 draft a-H - 967b449fbc94 | |
479 | | |
|
511 | | | |
480 | | o 9 draft a-G - 3e27b6f1eee1 |
|
512 | | o 9 draft a-G - 3e27b6f1eee1 | |
481 | | | |
|
513 | | | | |
482 | | o 8 draft a-F - b740e3e5c05d |
|
514 | | o 8 draft a-F - b740e3e5c05d | |
483 | | | |
|
515 | | | | |
484 | | o 7 draft a-E - e9f537e46dea |
|
516 | | o 7 draft a-E - e9f537e46dea | |
485 | | | |
|
517 | | | | |
486 | +---o 6 public n-B - 145e75495359 |
|
518 | +---o 6 public n-B - 145e75495359 | |
487 | | | |
|
519 | | | | |
488 | o | 5 public n-A - d6bcb4f74035 |
|
520 | o | 5 public n-A - d6bcb4f74035 | |
489 | | | |
|
521 | | | | |
490 | o | 4 public b-A - f54f1bb90ff3 |
|
522 | o | 4 public b-A - f54f1bb90ff3 | |
491 | | | |
|
523 | | | | |
492 | | o 3 public a-D - b555f63b6063 |
|
524 | | o 3 public a-D - b555f63b6063 | |
493 | | | |
|
525 | | | | |
494 | | o 2 public a-C - 54acac6f23ab |
|
526 | | o 2 public a-C - 54acac6f23ab | |
495 | |/ |
|
527 | |/ | |
496 | o 1 public a-B - 548a3d25dbf0 |
|
528 | o 1 public a-B - 548a3d25dbf0 | |
497 | | |
|
529 | | | |
498 | o 0 public a-A - 054250a37db4 |
|
530 | o 0 public a-A - 054250a37db4 | |
499 |
|
531 | |||
500 |
|
532 | |||
501 | $ cd ../mu |
|
533 | $ cd ../mu | |
502 | $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft, |
|
534 | $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft, | |
503 | > # not ancestor of -r |
|
535 | > # not ancestor of -r | |
504 | o 8 draft a-F - b740e3e5c05d |
|
536 | o 8 draft a-F - b740e3e5c05d | |
505 | | |
|
537 | | | |
506 | o 7 draft a-E - e9f537e46dea |
|
538 | o 7 draft a-E - e9f537e46dea | |
507 | | |
|
539 | | | |
508 | | o 6 draft n-B - 145e75495359 |
|
540 | | o 6 draft n-B - 145e75495359 | |
509 | | | |
|
541 | | | | |
510 | | o 5 draft n-A - d6bcb4f74035 |
|
542 | | o 5 draft n-A - d6bcb4f74035 | |
511 | | | |
|
543 | | | | |
512 | o | 4 public a-D - b555f63b6063 |
|
544 | o | 4 public a-D - b555f63b6063 | |
513 | | | |
|
545 | | | | |
514 | o | 3 public a-C - 54acac6f23ab |
|
546 | o | 3 public a-C - 54acac6f23ab | |
515 | | | |
|
547 | | | | |
516 | | o 2 draft b-A - f54f1bb90ff3 |
|
548 | | o 2 draft b-A - f54f1bb90ff3 | |
517 | |/ |
|
549 | |/ | |
518 | o 1 public a-B - 548a3d25dbf0 |
|
550 | o 1 public a-B - 548a3d25dbf0 | |
519 | | |
|
551 | | | |
520 | o 0 public a-A - 054250a37db4 |
|
552 | o 0 public a-A - 054250a37db4 | |
521 |
|
553 | |||
522 |
|
554 | |||
523 | Pushing to Publish=True (unknown changeset) |
|
555 | Pushing to Publish=True (unknown changeset) | |
524 |
|
556 | |||
525 | $ hg push ../beta -r b740e3e5c05d |
|
557 | $ hg push ../beta -r b740e3e5c05d | |
526 | pushing to ../beta |
|
558 | pushing to ../beta | |
527 | searching for changes |
|
559 | searching for changes | |
528 | adding changesets |
|
560 | adding changesets | |
529 | adding manifests |
|
561 | adding manifests | |
530 | adding file changes |
|
562 | adding file changes | |
531 | added 2 changesets with 2 changes to 2 files |
|
563 | added 2 changesets with 2 changes to 2 files | |
532 | $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft, |
|
564 | $ hgph # again f54f1bb90ff3, d6bcb4f74035 and 145e75495359 stay draft, | |
533 | > # not ancestor of -r |
|
565 | > # not ancestor of -r | |
534 | o 8 public a-F - b740e3e5c05d |
|
566 | o 8 public a-F - b740e3e5c05d | |
535 | | |
|
567 | | | |
536 | o 7 public a-E - e9f537e46dea |
|
568 | o 7 public a-E - e9f537e46dea | |
537 | | |
|
569 | | | |
538 | | o 6 draft n-B - 145e75495359 |
|
570 | | o 6 draft n-B - 145e75495359 | |
539 | | | |
|
571 | | | | |
540 | | o 5 draft n-A - d6bcb4f74035 |
|
572 | | o 5 draft n-A - d6bcb4f74035 | |
541 | | | |
|
573 | | | | |
542 | o | 4 public a-D - b555f63b6063 |
|
574 | o | 4 public a-D - b555f63b6063 | |
543 | | | |
|
575 | | | | |
544 | o | 3 public a-C - 54acac6f23ab |
|
576 | o | 3 public a-C - 54acac6f23ab | |
545 | | | |
|
577 | | | | |
546 | | o 2 draft b-A - f54f1bb90ff3 |
|
578 | | o 2 draft b-A - f54f1bb90ff3 | |
547 | |/ |
|
579 | |/ | |
548 | o 1 public a-B - 548a3d25dbf0 |
|
580 | o 1 public a-B - 548a3d25dbf0 | |
549 | | |
|
581 | | | |
550 | o 0 public a-A - 054250a37db4 |
|
582 | o 0 public a-A - 054250a37db4 | |
551 |
|
583 | |||
552 |
|
584 | |||
553 | Pushing to Publish=True (common changeset) |
|
585 | Pushing to Publish=True (common changeset) | |
554 |
|
586 | |||
555 | $ cd ../beta |
|
587 | $ cd ../beta | |
556 | $ hg push ../alpha |
|
588 | $ hg push ../alpha | |
557 | pushing to ../alpha |
|
589 | pushing to ../alpha | |
558 | searching for changes |
|
590 | searching for changes | |
559 | no changes found |
|
591 | no changes found | |
560 | [1] |
|
592 | [1] | |
561 | $ hgph |
|
593 | $ hgph | |
562 | o 6 public a-F - b740e3e5c05d |
|
594 | o 6 public a-F - b740e3e5c05d | |
563 | | |
|
595 | | | |
564 | o 5 public a-E - e9f537e46dea |
|
596 | o 5 public a-E - e9f537e46dea | |
565 | | |
|
597 | | | |
566 | o 4 public a-D - b555f63b6063 |
|
598 | o 4 public a-D - b555f63b6063 | |
567 | | |
|
599 | | | |
568 | o 3 public a-C - 54acac6f23ab |
|
600 | o 3 public a-C - 54acac6f23ab | |
569 | | |
|
601 | | | |
570 | | @ 2 public b-A - f54f1bb90ff3 |
|
602 | | @ 2 public b-A - f54f1bb90ff3 | |
571 | |/ |
|
603 | |/ | |
572 | o 1 public a-B - 548a3d25dbf0 |
|
604 | o 1 public a-B - 548a3d25dbf0 | |
573 | | |
|
605 | | | |
574 | o 0 public a-A - 054250a37db4 |
|
606 | o 0 public a-A - 054250a37db4 | |
575 |
|
607 | |||
576 | $ cd ../alpha |
|
608 | $ cd ../alpha | |
577 | $ hgph |
|
609 | $ hgph | |
578 | @ 10 draft a-H - 967b449fbc94 |
|
610 | @ 10 draft a-H - 967b449fbc94 | |
579 | | |
|
611 | | | |
580 | | o 9 draft a-G - 3e27b6f1eee1 |
|
612 | | o 9 draft a-G - 3e27b6f1eee1 | |
581 | | | |
|
613 | | | | |
582 | | o 8 public a-F - b740e3e5c05d |
|
614 | | o 8 public a-F - b740e3e5c05d | |
583 | | | |
|
615 | | | | |
584 | | o 7 public a-E - e9f537e46dea |
|
616 | | o 7 public a-E - e9f537e46dea | |
585 | | | |
|
617 | | | | |
586 | +---o 6 public n-B - 145e75495359 |
|
618 | +---o 6 public n-B - 145e75495359 | |
587 | | | |
|
619 | | | | |
588 | o | 5 public n-A - d6bcb4f74035 |
|
620 | o | 5 public n-A - d6bcb4f74035 | |
589 | | | |
|
621 | | | | |
590 | o | 4 public b-A - f54f1bb90ff3 |
|
622 | o | 4 public b-A - f54f1bb90ff3 | |
591 | | | |
|
623 | | | | |
592 | | o 3 public a-D - b555f63b6063 |
|
624 | | o 3 public a-D - b555f63b6063 | |
593 | | | |
|
625 | | | | |
594 | | o 2 public a-C - 54acac6f23ab |
|
626 | | o 2 public a-C - 54acac6f23ab | |
595 | |/ |
|
627 | |/ | |
596 | o 1 public a-B - 548a3d25dbf0 |
|
628 | o 1 public a-B - 548a3d25dbf0 | |
597 | | |
|
629 | | | |
598 | o 0 public a-A - 054250a37db4 |
|
630 | o 0 public a-A - 054250a37db4 | |
599 |
|
631 | |||
600 |
|
632 | |||
601 | Pushing to Publish=False (common changeset that change phase + unknown one) |
|
633 | Pushing to Publish=False (common changeset that change phase + unknown one) | |
602 |
|
634 | |||
603 | $ hg push ../mu -r 967b449fbc94 -f |
|
635 | $ hg push ../mu -r 967b449fbc94 -f | |
604 | pushing to ../mu |
|
636 | pushing to ../mu | |
605 | searching for changes |
|
637 | searching for changes | |
606 | adding changesets |
|
638 | adding changesets | |
607 | adding manifests |
|
639 | adding manifests | |
608 | adding file changes |
|
640 | adding file changes | |
609 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
641 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
610 | $ hgph |
|
642 | $ hgph | |
611 | @ 10 draft a-H - 967b449fbc94 |
|
643 | @ 10 draft a-H - 967b449fbc94 | |
612 | | |
|
644 | | | |
613 | | o 9 draft a-G - 3e27b6f1eee1 |
|
645 | | o 9 draft a-G - 3e27b6f1eee1 | |
614 | | | |
|
646 | | | | |
615 | | o 8 public a-F - b740e3e5c05d |
|
647 | | o 8 public a-F - b740e3e5c05d | |
616 | | | |
|
648 | | | | |
617 | | o 7 public a-E - e9f537e46dea |
|
649 | | o 7 public a-E - e9f537e46dea | |
618 | | | |
|
650 | | | | |
619 | +---o 6 public n-B - 145e75495359 |
|
651 | +---o 6 public n-B - 145e75495359 | |
620 | | | |
|
652 | | | | |
621 | o | 5 public n-A - d6bcb4f74035 |
|
653 | o | 5 public n-A - d6bcb4f74035 | |
622 | | | |
|
654 | | | | |
623 | o | 4 public b-A - f54f1bb90ff3 |
|
655 | o | 4 public b-A - f54f1bb90ff3 | |
624 | | | |
|
656 | | | | |
625 | | o 3 public a-D - b555f63b6063 |
|
657 | | o 3 public a-D - b555f63b6063 | |
626 | | | |
|
658 | | | | |
627 | | o 2 public a-C - 54acac6f23ab |
|
659 | | o 2 public a-C - 54acac6f23ab | |
628 | |/ |
|
660 | |/ | |
629 | o 1 public a-B - 548a3d25dbf0 |
|
661 | o 1 public a-B - 548a3d25dbf0 | |
630 | | |
|
662 | | | |
631 | o 0 public a-A - 054250a37db4 |
|
663 | o 0 public a-A - 054250a37db4 | |
632 |
|
664 | |||
633 | $ cd ../mu |
|
665 | $ cd ../mu | |
634 | $ hgph # d6bcb4f74035 should have changed phase |
|
666 | $ hgph # d6bcb4f74035 should have changed phase | |
635 | > # 145e75495359 is still draft. not ancestor of -r |
|
667 | > # 145e75495359 is still draft. not ancestor of -r | |
636 | o 9 draft a-H - 967b449fbc94 |
|
668 | o 9 draft a-H - 967b449fbc94 | |
637 | | |
|
669 | | | |
638 | | o 8 public a-F - b740e3e5c05d |
|
670 | | o 8 public a-F - b740e3e5c05d | |
639 | | | |
|
671 | | | | |
640 | | o 7 public a-E - e9f537e46dea |
|
672 | | o 7 public a-E - e9f537e46dea | |
641 | | | |
|
673 | | | | |
642 | +---o 6 draft n-B - 145e75495359 |
|
674 | +---o 6 draft n-B - 145e75495359 | |
643 | | | |
|
675 | | | | |
644 | o | 5 public n-A - d6bcb4f74035 |
|
676 | o | 5 public n-A - d6bcb4f74035 | |
645 | | | |
|
677 | | | | |
646 | | o 4 public a-D - b555f63b6063 |
|
678 | | o 4 public a-D - b555f63b6063 | |
647 | | | |
|
679 | | | | |
648 | | o 3 public a-C - 54acac6f23ab |
|
680 | | o 3 public a-C - 54acac6f23ab | |
649 | | | |
|
681 | | | | |
650 | o | 2 public b-A - f54f1bb90ff3 |
|
682 | o | 2 public b-A - f54f1bb90ff3 | |
651 | |/ |
|
683 | |/ | |
652 | o 1 public a-B - 548a3d25dbf0 |
|
684 | o 1 public a-B - 548a3d25dbf0 | |
653 | | |
|
685 | | | |
654 | o 0 public a-A - 054250a37db4 |
|
686 | o 0 public a-A - 054250a37db4 | |
655 |
|
687 | |||
656 |
|
688 | |||
657 |
|
689 | |||
658 | Pushing to Publish=True (common changeset from publish=False) |
|
690 | Pushing to Publish=True (common changeset from publish=False) | |
659 |
|
691 | |||
660 | (in mu) |
|
692 | (in mu) | |
661 | $ hg push ../alpha |
|
693 | $ hg push ../alpha | |
662 | pushing to ../alpha |
|
694 | pushing to ../alpha | |
663 | searching for changes |
|
695 | searching for changes | |
664 | no changes found |
|
696 | no changes found | |
665 | [1] |
|
697 | [1] | |
666 | $ hgph |
|
698 | $ hgph | |
667 | o 9 public a-H - 967b449fbc94 |
|
699 | o 9 public a-H - 967b449fbc94 | |
668 | | |
|
700 | | | |
669 | | o 8 public a-F - b740e3e5c05d |
|
701 | | o 8 public a-F - b740e3e5c05d | |
670 | | | |
|
702 | | | | |
671 | | o 7 public a-E - e9f537e46dea |
|
703 | | o 7 public a-E - e9f537e46dea | |
672 | | | |
|
704 | | | | |
673 | +---o 6 public n-B - 145e75495359 |
|
705 | +---o 6 public n-B - 145e75495359 | |
674 | | | |
|
706 | | | | |
675 | o | 5 public n-A - d6bcb4f74035 |
|
707 | o | 5 public n-A - d6bcb4f74035 | |
676 | | | |
|
708 | | | | |
677 | | o 4 public a-D - b555f63b6063 |
|
709 | | o 4 public a-D - b555f63b6063 | |
678 | | | |
|
710 | | | | |
679 | | o 3 public a-C - 54acac6f23ab |
|
711 | | o 3 public a-C - 54acac6f23ab | |
680 | | | |
|
712 | | | | |
681 | o | 2 public b-A - f54f1bb90ff3 |
|
713 | o | 2 public b-A - f54f1bb90ff3 | |
682 | |/ |
|
714 | |/ | |
683 | o 1 public a-B - 548a3d25dbf0 |
|
715 | o 1 public a-B - 548a3d25dbf0 | |
684 | | |
|
716 | | | |
685 | o 0 public a-A - 054250a37db4 |
|
717 | o 0 public a-A - 054250a37db4 | |
686 |
|
718 | |||
687 | $ hgph -R ../alpha # a-H should have been synced to 0 |
|
719 | $ hgph -R ../alpha # a-H should have been synced to 0 | |
688 | @ 10 public a-H - 967b449fbc94 |
|
720 | @ 10 public a-H - 967b449fbc94 | |
689 | | |
|
721 | | | |
690 | | o 9 draft a-G - 3e27b6f1eee1 |
|
722 | | o 9 draft a-G - 3e27b6f1eee1 | |
691 | | | |
|
723 | | | | |
692 | | o 8 public a-F - b740e3e5c05d |
|
724 | | o 8 public a-F - b740e3e5c05d | |
693 | | | |
|
725 | | | | |
694 | | o 7 public a-E - e9f537e46dea |
|
726 | | o 7 public a-E - e9f537e46dea | |
695 | | | |
|
727 | | | | |
696 | +---o 6 public n-B - 145e75495359 |
|
728 | +---o 6 public n-B - 145e75495359 | |
697 | | | |
|
729 | | | | |
698 | o | 5 public n-A - d6bcb4f74035 |
|
730 | o | 5 public n-A - d6bcb4f74035 | |
699 | | | |
|
731 | | | | |
700 | o | 4 public b-A - f54f1bb90ff3 |
|
732 | o | 4 public b-A - f54f1bb90ff3 | |
701 | | | |
|
733 | | | | |
702 | | o 3 public a-D - b555f63b6063 |
|
734 | | o 3 public a-D - b555f63b6063 | |
703 | | | |
|
735 | | | | |
704 | | o 2 public a-C - 54acac6f23ab |
|
736 | | o 2 public a-C - 54acac6f23ab | |
705 | |/ |
|
737 | |/ | |
706 | o 1 public a-B - 548a3d25dbf0 |
|
738 | o 1 public a-B - 548a3d25dbf0 | |
707 | | |
|
739 | | | |
708 | o 0 public a-A - 054250a37db4 |
|
740 | o 0 public a-A - 054250a37db4 | |
709 |
|
741 | |||
710 |
|
742 | |||
711 |
|
743 | |||
712 | Discovery locally secret changeset on a remote repository: |
|
744 | Discovery locally secret changeset on a remote repository: | |
713 |
|
745 | |||
714 | - should make it non-secret |
|
746 | - should make it non-secret | |
715 |
|
747 | |||
716 | $ cd ../alpha |
|
748 | $ cd ../alpha | |
717 | $ mkcommit A-secret --config phases.new-commit=2 |
|
749 | $ mkcommit A-secret --config phases.new-commit=2 | |
718 | $ hgph |
|
750 | $ hgph | |
719 | @ 11 secret A-secret - 435b5d83910c |
|
751 | @ 11 secret A-secret - 435b5d83910c | |
720 | | |
|
752 | | | |
721 | o 10 public a-H - 967b449fbc94 |
|
753 | o 10 public a-H - 967b449fbc94 | |
722 | | |
|
754 | | | |
723 | | o 9 draft a-G - 3e27b6f1eee1 |
|
755 | | o 9 draft a-G - 3e27b6f1eee1 | |
724 | | | |
|
756 | | | | |
725 | | o 8 public a-F - b740e3e5c05d |
|
757 | | o 8 public a-F - b740e3e5c05d | |
726 | | | |
|
758 | | | | |
727 | | o 7 public a-E - e9f537e46dea |
|
759 | | o 7 public a-E - e9f537e46dea | |
728 | | | |
|
760 | | | | |
729 | +---o 6 public n-B - 145e75495359 |
|
761 | +---o 6 public n-B - 145e75495359 | |
730 | | | |
|
762 | | | | |
731 | o | 5 public n-A - d6bcb4f74035 |
|
763 | o | 5 public n-A - d6bcb4f74035 | |
732 | | | |
|
764 | | | | |
733 | o | 4 public b-A - f54f1bb90ff3 |
|
765 | o | 4 public b-A - f54f1bb90ff3 | |
734 | | | |
|
766 | | | | |
735 | | o 3 public a-D - b555f63b6063 |
|
767 | | o 3 public a-D - b555f63b6063 | |
736 | | | |
|
768 | | | | |
737 | | o 2 public a-C - 54acac6f23ab |
|
769 | | o 2 public a-C - 54acac6f23ab | |
738 | |/ |
|
770 | |/ | |
739 | o 1 public a-B - 548a3d25dbf0 |
|
771 | o 1 public a-B - 548a3d25dbf0 | |
740 | | |
|
772 | | | |
741 | o 0 public a-A - 054250a37db4 |
|
773 | o 0 public a-A - 054250a37db4 | |
742 |
|
774 | |||
743 | $ hg bundle --base 'parents(.)' -r . ../secret-bundle.hg |
|
775 | $ hg bundle --base 'parents(.)' -r . ../secret-bundle.hg | |
744 | 1 changesets found |
|
776 | 1 changesets found | |
745 | $ hg -R ../mu unbundle ../secret-bundle.hg |
|
777 | $ hg -R ../mu unbundle ../secret-bundle.hg | |
746 | adding changesets |
|
778 | adding changesets | |
747 | adding manifests |
|
779 | adding manifests | |
748 | adding file changes |
|
780 | adding file changes | |
749 | added 1 changesets with 1 changes to 1 files |
|
781 | added 1 changesets with 1 changes to 1 files | |
750 | (run 'hg update' to get a working copy) |
|
782 | (run 'hg update' to get a working copy) | |
751 | $ hgph -R ../mu |
|
783 | $ hgph -R ../mu | |
752 | o 10 draft A-secret - 435b5d83910c |
|
784 | o 10 draft A-secret - 435b5d83910c | |
753 | | |
|
785 | | | |
754 | o 9 public a-H - 967b449fbc94 |
|
786 | o 9 public a-H - 967b449fbc94 | |
755 | | |
|
787 | | | |
756 | | o 8 public a-F - b740e3e5c05d |
|
788 | | o 8 public a-F - b740e3e5c05d | |
757 | | | |
|
789 | | | | |
758 | | o 7 public a-E - e9f537e46dea |
|
790 | | o 7 public a-E - e9f537e46dea | |
759 | | | |
|
791 | | | | |
760 | +---o 6 public n-B - 145e75495359 |
|
792 | +---o 6 public n-B - 145e75495359 | |
761 | | | |
|
793 | | | | |
762 | o | 5 public n-A - d6bcb4f74035 |
|
794 | o | 5 public n-A - d6bcb4f74035 | |
763 | | | |
|
795 | | | | |
764 | | o 4 public a-D - b555f63b6063 |
|
796 | | o 4 public a-D - b555f63b6063 | |
765 | | | |
|
797 | | | | |
766 | | o 3 public a-C - 54acac6f23ab |
|
798 | | o 3 public a-C - 54acac6f23ab | |
767 | | | |
|
799 | | | | |
768 | o | 2 public b-A - f54f1bb90ff3 |
|
800 | o | 2 public b-A - f54f1bb90ff3 | |
769 | |/ |
|
801 | |/ | |
770 | o 1 public a-B - 548a3d25dbf0 |
|
802 | o 1 public a-B - 548a3d25dbf0 | |
771 | | |
|
803 | | | |
772 | o 0 public a-A - 054250a37db4 |
|
804 | o 0 public a-A - 054250a37db4 | |
773 |
|
805 | |||
774 | $ hg pull ../mu |
|
806 | $ hg pull ../mu | |
775 | pulling from ../mu |
|
807 | pulling from ../mu | |
776 | searching for changes |
|
808 | searching for changes | |
777 | no changes found |
|
809 | no changes found | |
778 | $ hgph |
|
810 | $ hgph | |
779 | @ 11 draft A-secret - 435b5d83910c |
|
811 | @ 11 draft A-secret - 435b5d83910c | |
780 | | |
|
812 | | | |
781 | o 10 public a-H - 967b449fbc94 |
|
813 | o 10 public a-H - 967b449fbc94 | |
782 | | |
|
814 | | | |
783 | | o 9 draft a-G - 3e27b6f1eee1 |
|
815 | | o 9 draft a-G - 3e27b6f1eee1 | |
784 | | | |
|
816 | | | | |
785 | | o 8 public a-F - b740e3e5c05d |
|
817 | | o 8 public a-F - b740e3e5c05d | |
786 | | | |
|
818 | | | | |
787 | | o 7 public a-E - e9f537e46dea |
|
819 | | o 7 public a-E - e9f537e46dea | |
788 | | | |
|
820 | | | | |
789 | +---o 6 public n-B - 145e75495359 |
|
821 | +---o 6 public n-B - 145e75495359 | |
790 | | | |
|
822 | | | | |
791 | o | 5 public n-A - d6bcb4f74035 |
|
823 | o | 5 public n-A - d6bcb4f74035 | |
792 | | | |
|
824 | | | | |
793 | o | 4 public b-A - f54f1bb90ff3 |
|
825 | o | 4 public b-A - f54f1bb90ff3 | |
794 | | | |
|
826 | | | | |
795 | | o 3 public a-D - b555f63b6063 |
|
827 | | o 3 public a-D - b555f63b6063 | |
796 | | | |
|
828 | | | | |
797 | | o 2 public a-C - 54acac6f23ab |
|
829 | | o 2 public a-C - 54acac6f23ab | |
798 | |/ |
|
830 | |/ | |
799 | o 1 public a-B - 548a3d25dbf0 |
|
831 | o 1 public a-B - 548a3d25dbf0 | |
800 | | |
|
832 | | | |
801 | o 0 public a-A - 054250a37db4 |
|
833 | o 0 public a-A - 054250a37db4 | |
802 |
|
834 | |||
803 |
|
835 | |||
804 | pushing a locally public and draft changesets remotly secret should make them appear on the remote side |
|
836 | pushing a locally public and draft changesets remotly secret should make them appear on the remote side | |
805 |
|
837 | |||
806 | $ hg -R ../mu phase --secret --force 967b449fbc94 |
|
838 | $ hg -R ../mu phase --secret --force 967b449fbc94 | |
807 | $ hg push -r 435b5d83910c ../mu |
|
839 | $ hg push -r 435b5d83910c ../mu | |
808 | pushing to ../mu |
|
840 | pushing to ../mu | |
809 | searching for changes |
|
841 | searching for changes | |
810 | adding changesets |
|
842 | adding changesets | |
811 | adding manifests |
|
843 | adding manifests | |
812 | adding file changes |
|
844 | adding file changes | |
813 | added 0 changesets with 0 changes to 2 files |
|
845 | added 0 changesets with 0 changes to 2 files | |
814 | $ hgph -R ../mu |
|
846 | $ hgph -R ../mu | |
815 | o 10 draft A-secret - 435b5d83910c |
|
847 | o 10 draft A-secret - 435b5d83910c | |
816 | | |
|
848 | | | |
817 | o 9 public a-H - 967b449fbc94 |
|
849 | o 9 public a-H - 967b449fbc94 | |
818 | | |
|
850 | | | |
819 | | o 8 public a-F - b740e3e5c05d |
|
851 | | o 8 public a-F - b740e3e5c05d | |
820 | | | |
|
852 | | | | |
821 | | o 7 public a-E - e9f537e46dea |
|
853 | | o 7 public a-E - e9f537e46dea | |
822 | | | |
|
854 | | | | |
823 | +---o 6 public n-B - 145e75495359 |
|
855 | +---o 6 public n-B - 145e75495359 | |
824 | | | |
|
856 | | | | |
825 | o | 5 public n-A - d6bcb4f74035 |
|
857 | o | 5 public n-A - d6bcb4f74035 | |
826 | | | |
|
858 | | | | |
827 | | o 4 public a-D - b555f63b6063 |
|
859 | | o 4 public a-D - b555f63b6063 | |
828 | | | |
|
860 | | | | |
829 | | o 3 public a-C - 54acac6f23ab |
|
861 | | o 3 public a-C - 54acac6f23ab | |
830 | | | |
|
862 | | | | |
831 | o | 2 public b-A - f54f1bb90ff3 |
|
863 | o | 2 public b-A - f54f1bb90ff3 | |
832 | |/ |
|
864 | |/ | |
833 | o 1 public a-B - 548a3d25dbf0 |
|
865 | o 1 public a-B - 548a3d25dbf0 | |
834 | | |
|
866 | | | |
835 | o 0 public a-A - 054250a37db4 |
|
867 | o 0 public a-A - 054250a37db4 | |
836 |
|
868 | |||
837 |
|
869 | |||
838 | pull new changeset with common draft locally |
|
870 | pull new changeset with common draft locally | |
839 |
|
871 | |||
840 | $ hg up -q 967b449fbc94 # create a new root for draft |
|
872 | $ hg up -q 967b449fbc94 # create a new root for draft | |
841 | $ mkcommit 'alpha-more' |
|
873 | $ mkcommit 'alpha-more' | |
842 | created new head |
|
874 | created new head | |
843 | $ hg push -fr . ../mu |
|
875 | $ hg push -fr . ../mu | |
844 | pushing to ../mu |
|
876 | pushing to ../mu | |
845 | searching for changes |
|
877 | searching for changes | |
846 | adding changesets |
|
878 | adding changesets | |
847 | adding manifests |
|
879 | adding manifests | |
848 | adding file changes |
|
880 | adding file changes | |
849 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
881 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
850 | $ cd ../mu |
|
882 | $ cd ../mu | |
851 | $ hg phase --secret --force 1c5cfd894796 |
|
883 | $ hg phase --secret --force 1c5cfd894796 | |
852 | $ hg up -q 435b5d83910c |
|
884 | $ hg up -q 435b5d83910c | |
853 | $ mkcommit 'mu-more' |
|
885 | $ mkcommit 'mu-more' | |
854 | $ cd ../alpha |
|
886 | $ cd ../alpha | |
855 | $ hg pull ../mu |
|
887 | $ hg pull ../mu | |
856 | pulling from ../mu |
|
888 | pulling from ../mu | |
857 | searching for changes |
|
889 | searching for changes | |
858 | adding changesets |
|
890 | adding changesets | |
859 | adding manifests |
|
891 | adding manifests | |
860 | adding file changes |
|
892 | adding file changes | |
861 | added 1 changesets with 1 changes to 1 files |
|
893 | added 1 changesets with 1 changes to 1 files | |
862 | (run 'hg update' to get a working copy) |
|
894 | (run 'hg update' to get a working copy) | |
863 | $ hgph |
|
895 | $ hgph | |
864 | o 13 draft mu-more - 5237fb433fc8 |
|
896 | o 13 draft mu-more - 5237fb433fc8 | |
865 | | |
|
897 | | | |
866 | | @ 12 draft alpha-more - 1c5cfd894796 |
|
898 | | @ 12 draft alpha-more - 1c5cfd894796 | |
867 | | | |
|
899 | | | | |
868 | o | 11 draft A-secret - 435b5d83910c |
|
900 | o | 11 draft A-secret - 435b5d83910c | |
869 | |/ |
|
901 | |/ | |
870 | o 10 public a-H - 967b449fbc94 |
|
902 | o 10 public a-H - 967b449fbc94 | |
871 | | |
|
903 | | | |
872 | | o 9 draft a-G - 3e27b6f1eee1 |
|
904 | | o 9 draft a-G - 3e27b6f1eee1 | |
873 | | | |
|
905 | | | | |
874 | | o 8 public a-F - b740e3e5c05d |
|
906 | | o 8 public a-F - b740e3e5c05d | |
875 | | | |
|
907 | | | | |
876 | | o 7 public a-E - e9f537e46dea |
|
908 | | o 7 public a-E - e9f537e46dea | |
877 | | | |
|
909 | | | | |
878 | +---o 6 public n-B - 145e75495359 |
|
910 | +---o 6 public n-B - 145e75495359 | |
879 | | | |
|
911 | | | | |
880 | o | 5 public n-A - d6bcb4f74035 |
|
912 | o | 5 public n-A - d6bcb4f74035 | |
881 | | | |
|
913 | | | | |
882 | o | 4 public b-A - f54f1bb90ff3 |
|
914 | o | 4 public b-A - f54f1bb90ff3 | |
883 | | | |
|
915 | | | | |
884 | | o 3 public a-D - b555f63b6063 |
|
916 | | o 3 public a-D - b555f63b6063 | |
885 | | | |
|
917 | | | | |
886 | | o 2 public a-C - 54acac6f23ab |
|
918 | | o 2 public a-C - 54acac6f23ab | |
887 | |/ |
|
919 | |/ | |
888 | o 1 public a-B - 548a3d25dbf0 |
|
920 | o 1 public a-B - 548a3d25dbf0 | |
889 | | |
|
921 | | | |
890 | o 0 public a-A - 054250a37db4 |
|
922 | o 0 public a-A - 054250a37db4 | |
891 |
|
923 | |||
892 |
|
924 | |||
893 | Test that test are properly ignored on remote event when existing locally |
|
925 | Test that test are properly ignored on remote event when existing locally | |
894 |
|
926 | |||
895 | $ cd .. |
|
927 | $ cd .. | |
896 | $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma |
|
928 | $ hg clone -qU -r b555f63b6063 -r f54f1bb90ff3 beta gamma | |
897 |
|
929 | |||
898 | # pathological case are |
|
930 | # pathological case are | |
899 | # |
|
931 | # | |
900 | # * secret remotely |
|
932 | # * secret remotely | |
901 | # * known locally |
|
933 | # * known locally | |
902 | # * repo have uncommon changeset |
|
934 | # * repo have uncommon changeset | |
903 |
|
935 | |||
904 | $ hg -R beta phase --secret --force f54f1bb90ff3 |
|
936 | $ hg -R beta phase --secret --force f54f1bb90ff3 | |
905 | $ hg -R gamma phase --draft --force f54f1bb90ff3 |
|
937 | $ hg -R gamma phase --draft --force f54f1bb90ff3 | |
906 |
|
938 | |||
907 | $ cd gamma |
|
939 | $ cd gamma | |
908 | $ hg pull ../beta |
|
940 | $ hg pull ../beta | |
909 | pulling from ../beta |
|
941 | pulling from ../beta | |
910 | searching for changes |
|
942 | searching for changes | |
911 | adding changesets |
|
943 | adding changesets | |
912 | adding manifests |
|
944 | adding manifests | |
913 | adding file changes |
|
945 | adding file changes | |
914 | added 2 changesets with 2 changes to 2 files |
|
946 | added 2 changesets with 2 changes to 2 files | |
915 | (run 'hg update' to get a working copy) |
|
947 | (run 'hg update' to get a working copy) | |
916 | $ hg phase f54f1bb90ff3 |
|
948 | $ hg phase f54f1bb90ff3 | |
917 | 2: draft |
|
949 | 2: draft | |
918 |
|
950 | |||
919 | same over the wire |
|
951 | same over the wire | |
920 |
|
952 | |||
921 | $ cd ../beta |
|
953 | $ cd ../beta | |
922 | $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log |
|
954 | $ hg serve -p $HGPORT -d --pid-file=../beta.pid -E ../beta-error.log | |
923 | $ cat ../beta.pid >> $DAEMON_PIDS |
|
955 | $ cat ../beta.pid >> $DAEMON_PIDS | |
924 | $ cd ../gamma |
|
956 | $ cd ../gamma | |
925 |
|
957 | |||
926 | $ hg pull http://localhost:$HGPORT/ |
|
958 | $ hg pull http://localhost:$HGPORT/ | |
927 | pulling from http://localhost:$HGPORT/ |
|
959 | pulling from http://localhost:$HGPORT/ | |
928 | searching for changes |
|
960 | searching for changes | |
929 | no changes found |
|
961 | no changes found | |
930 | $ hg phase f54f1bb90ff3 |
|
962 | $ hg phase f54f1bb90ff3 | |
931 | 2: draft |
|
963 | 2: draft | |
932 |
|
964 | |||
933 | check that secret local on both side are not synced to public |
|
965 | check that secret local on both side are not synced to public | |
934 |
|
966 | |||
935 | $ hg push -r b555f63b6063 http://localhost:$HGPORT/ |
|
967 | $ hg push -r b555f63b6063 http://localhost:$HGPORT/ | |
936 | pushing to http://localhost:$HGPORT/ |
|
968 | pushing to http://localhost:$HGPORT/ | |
937 | searching for changes |
|
969 | searching for changes | |
938 | no changes found |
|
970 | no changes found | |
939 | [1] |
|
971 | [1] | |
940 | $ hg phase f54f1bb90ff3 |
|
972 | $ hg phase f54f1bb90ff3 | |
941 | 2: draft |
|
973 | 2: draft | |
942 |
|
974 | |||
943 | put the changeset in the draft state again |
|
975 | put the changeset in the draft state again | |
944 | (first test after this one expect to be able to copy) |
|
976 | (first test after this one expect to be able to copy) | |
945 |
|
977 | |||
946 | $ cd .. |
|
978 | $ cd .. | |
947 |
|
979 | |||
948 |
|
980 | |||
949 | Test Clone behavior |
|
981 | Test Clone behavior | |
950 |
|
982 | |||
951 | A. Clone without secret changeset |
|
983 | A. Clone without secret changeset | |
952 |
|
984 | |||
953 | 1. cloning non-publishing repository |
|
985 | 1. cloning non-publishing repository | |
954 | (Phase should be preserved) |
|
986 | (Phase should be preserved) | |
955 |
|
987 | |||
956 | # make sure there is no secret so we can use a copy clone |
|
988 | # make sure there is no secret so we can use a copy clone | |
957 |
|
989 | |||
958 | $ hg -R mu phase --draft 'secret()' |
|
990 | $ hg -R mu phase --draft 'secret()' | |
959 |
|
991 | |||
960 | $ hg clone -U mu Tau |
|
992 | $ hg clone -U mu Tau | |
961 | $ hgph -R Tau |
|
993 | $ hgph -R Tau | |
962 | o 12 draft mu-more - 5237fb433fc8 |
|
994 | o 12 draft mu-more - 5237fb433fc8 | |
963 | | |
|
995 | | | |
964 | | o 11 draft alpha-more - 1c5cfd894796 |
|
996 | | o 11 draft alpha-more - 1c5cfd894796 | |
965 | | | |
|
997 | | | | |
966 | o | 10 draft A-secret - 435b5d83910c |
|
998 | o | 10 draft A-secret - 435b5d83910c | |
967 | |/ |
|
999 | |/ | |
968 | o 9 public a-H - 967b449fbc94 |
|
1000 | o 9 public a-H - 967b449fbc94 | |
969 | | |
|
1001 | | | |
970 | | o 8 public a-F - b740e3e5c05d |
|
1002 | | o 8 public a-F - b740e3e5c05d | |
971 | | | |
|
1003 | | | | |
972 | | o 7 public a-E - e9f537e46dea |
|
1004 | | o 7 public a-E - e9f537e46dea | |
973 | | | |
|
1005 | | | | |
974 | +---o 6 public n-B - 145e75495359 |
|
1006 | +---o 6 public n-B - 145e75495359 | |
975 | | | |
|
1007 | | | | |
976 | o | 5 public n-A - d6bcb4f74035 |
|
1008 | o | 5 public n-A - d6bcb4f74035 | |
977 | | | |
|
1009 | | | | |
978 | | o 4 public a-D - b555f63b6063 |
|
1010 | | o 4 public a-D - b555f63b6063 | |
979 | | | |
|
1011 | | | | |
980 | | o 3 public a-C - 54acac6f23ab |
|
1012 | | o 3 public a-C - 54acac6f23ab | |
981 | | | |
|
1013 | | | | |
982 | o | 2 public b-A - f54f1bb90ff3 |
|
1014 | o | 2 public b-A - f54f1bb90ff3 | |
983 | |/ |
|
1015 | |/ | |
984 | o 1 public a-B - 548a3d25dbf0 |
|
1016 | o 1 public a-B - 548a3d25dbf0 | |
985 | | |
|
1017 | | | |
986 | o 0 public a-A - 054250a37db4 |
|
1018 | o 0 public a-A - 054250a37db4 | |
987 |
|
1019 | |||
988 |
|
1020 | |||
989 | 2. cloning publishing repository |
|
1021 | 2. cloning publishing repository | |
990 |
|
1022 | |||
991 | (everything should be public) |
|
1023 | (everything should be public) | |
992 |
|
1024 | |||
993 | $ hg clone -U alpha Upsilon |
|
1025 | $ hg clone -U alpha Upsilon | |
994 | $ hgph -R Upsilon |
|
1026 | $ hgph -R Upsilon | |
995 | o 13 public mu-more - 5237fb433fc8 |
|
1027 | o 13 public mu-more - 5237fb433fc8 | |
996 | | |
|
1028 | | | |
997 | | o 12 public alpha-more - 1c5cfd894796 |
|
1029 | | o 12 public alpha-more - 1c5cfd894796 | |
998 | | | |
|
1030 | | | | |
999 | o | 11 public A-secret - 435b5d83910c |
|
1031 | o | 11 public A-secret - 435b5d83910c | |
1000 | |/ |
|
1032 | |/ | |
1001 | o 10 public a-H - 967b449fbc94 |
|
1033 | o 10 public a-H - 967b449fbc94 | |
1002 | | |
|
1034 | | | |
1003 | | o 9 public a-G - 3e27b6f1eee1 |
|
1035 | | o 9 public a-G - 3e27b6f1eee1 | |
1004 | | | |
|
1036 | | | | |
1005 | | o 8 public a-F - b740e3e5c05d |
|
1037 | | o 8 public a-F - b740e3e5c05d | |
1006 | | | |
|
1038 | | | | |
1007 | | o 7 public a-E - e9f537e46dea |
|
1039 | | o 7 public a-E - e9f537e46dea | |
1008 | | | |
|
1040 | | | | |
1009 | +---o 6 public n-B - 145e75495359 |
|
1041 | +---o 6 public n-B - 145e75495359 | |
1010 | | | |
|
1042 | | | | |
1011 | o | 5 public n-A - d6bcb4f74035 |
|
1043 | o | 5 public n-A - d6bcb4f74035 | |
1012 | | | |
|
1044 | | | | |
1013 | o | 4 public b-A - f54f1bb90ff3 |
|
1045 | o | 4 public b-A - f54f1bb90ff3 | |
1014 | | | |
|
1046 | | | | |
1015 | | o 3 public a-D - b555f63b6063 |
|
1047 | | o 3 public a-D - b555f63b6063 | |
1016 | | | |
|
1048 | | | | |
1017 | | o 2 public a-C - 54acac6f23ab |
|
1049 | | o 2 public a-C - 54acac6f23ab | |
1018 | |/ |
|
1050 | |/ | |
1019 | o 1 public a-B - 548a3d25dbf0 |
|
1051 | o 1 public a-B - 548a3d25dbf0 | |
1020 | | |
|
1052 | | | |
1021 | o 0 public a-A - 054250a37db4 |
|
1053 | o 0 public a-A - 054250a37db4 | |
1022 |
|
1054 | |||
1023 |
|
1055 |
General Comments 0
You need to be logged in to leave comments.
Login now