Show More
@@ -1,684 +1,694 b'' | |||||
1 | # hg.py - repository classes for mercurial |
|
1 | # hg.py - repository classes for mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
|
3 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> | |
4 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> |
|
4 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> | |
5 | # |
|
5 | # | |
6 | # This software may be used and distributed according to the terms of the |
|
6 | # This software may be used and distributed according to the terms of the | |
7 | # GNU General Public License version 2 or any later version. |
|
7 | # GNU General Public License version 2 or any later version. | |
8 |
|
8 | |||
9 | from i18n import _ |
|
9 | from i18n import _ | |
10 | from lock import release |
|
10 | from lock import release | |
11 | from node import nullid |
|
11 | from node import nullid | |
12 |
|
12 | |||
13 | import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo |
|
13 | import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo | |
14 | import bookmarks, lock, util, extensions, error, node, scmutil, phases, url |
|
14 | import bookmarks, lock, util, extensions, error, node, scmutil, phases, url | |
15 | import cmdutil, discovery, repoview, exchange |
|
15 | import cmdutil, discovery, repoview, exchange | |
16 | import ui as uimod |
|
16 | import ui as uimod | |
17 | import merge as mergemod |
|
17 | import merge as mergemod | |
18 | import verify as verifymod |
|
18 | import verify as verifymod | |
19 | import errno, os, shutil |
|
19 | import errno, os, shutil | |
20 |
|
20 | |||
21 | def _local(path): |
|
21 | def _local(path): | |
22 | path = util.expandpath(util.urllocalpath(path)) |
|
22 | path = util.expandpath(util.urllocalpath(path)) | |
23 | return (os.path.isfile(path) and bundlerepo or localrepo) |
|
23 | return (os.path.isfile(path) and bundlerepo or localrepo) | |
24 |
|
24 | |||
25 | def addbranchrevs(lrepo, other, branches, revs): |
|
25 | def addbranchrevs(lrepo, other, branches, revs): | |
26 | peer = other.peer() # a courtesy to callers using a localrepo for other |
|
26 | peer = other.peer() # a courtesy to callers using a localrepo for other | |
27 | hashbranch, branches = branches |
|
27 | hashbranch, branches = branches | |
28 | if not hashbranch and not branches: |
|
28 | if not hashbranch and not branches: | |
29 | x = revs or None |
|
29 | x = revs or None | |
30 | if util.safehasattr(revs, 'first'): |
|
30 | if util.safehasattr(revs, 'first'): | |
31 | y = revs.first() |
|
31 | y = revs.first() | |
32 | elif revs: |
|
32 | elif revs: | |
33 | y = revs[0] |
|
33 | y = revs[0] | |
34 | else: |
|
34 | else: | |
35 | y = None |
|
35 | y = None | |
36 | return x, y |
|
36 | return x, y | |
37 | if revs: |
|
37 | if revs: | |
38 | revs = list(revs) |
|
38 | revs = list(revs) | |
39 | else: |
|
39 | else: | |
40 | revs = [] |
|
40 | revs = [] | |
41 |
|
41 | |||
42 | if not peer.capable('branchmap'): |
|
42 | if not peer.capable('branchmap'): | |
43 | if branches: |
|
43 | if branches: | |
44 | raise util.Abort(_("remote branch lookup not supported")) |
|
44 | raise util.Abort(_("remote branch lookup not supported")) | |
45 | revs.append(hashbranch) |
|
45 | revs.append(hashbranch) | |
46 | return revs, revs[0] |
|
46 | return revs, revs[0] | |
47 | branchmap = peer.branchmap() |
|
47 | branchmap = peer.branchmap() | |
48 |
|
48 | |||
49 | def primary(branch): |
|
49 | def primary(branch): | |
50 | if branch == '.': |
|
50 | if branch == '.': | |
51 | if not lrepo: |
|
51 | if not lrepo: | |
52 | raise util.Abort(_("dirstate branch not accessible")) |
|
52 | raise util.Abort(_("dirstate branch not accessible")) | |
53 | branch = lrepo.dirstate.branch() |
|
53 | branch = lrepo.dirstate.branch() | |
54 | if branch in branchmap: |
|
54 | if branch in branchmap: | |
55 | revs.extend(node.hex(r) for r in reversed(branchmap[branch])) |
|
55 | revs.extend(node.hex(r) for r in reversed(branchmap[branch])) | |
56 | return True |
|
56 | return True | |
57 | else: |
|
57 | else: | |
58 | return False |
|
58 | return False | |
59 |
|
59 | |||
60 | for branch in branches: |
|
60 | for branch in branches: | |
61 | if not primary(branch): |
|
61 | if not primary(branch): | |
62 | raise error.RepoLookupError(_("unknown branch '%s'") % branch) |
|
62 | raise error.RepoLookupError(_("unknown branch '%s'") % branch) | |
63 | if hashbranch: |
|
63 | if hashbranch: | |
64 | if not primary(hashbranch): |
|
64 | if not primary(hashbranch): | |
65 | revs.append(hashbranch) |
|
65 | revs.append(hashbranch) | |
66 | return revs, revs[0] |
|
66 | return revs, revs[0] | |
67 |
|
67 | |||
68 | def parseurl(path, branches=None): |
|
68 | def parseurl(path, branches=None): | |
69 | '''parse url#branch, returning (url, (branch, branches))''' |
|
69 | '''parse url#branch, returning (url, (branch, branches))''' | |
70 |
|
70 | |||
71 | u = util.url(path) |
|
71 | u = util.url(path) | |
72 | branch = None |
|
72 | branch = None | |
73 | if u.fragment: |
|
73 | if u.fragment: | |
74 | branch = u.fragment |
|
74 | branch = u.fragment | |
75 | u.fragment = None |
|
75 | u.fragment = None | |
76 | return str(u), (branch, branches or []) |
|
76 | return str(u), (branch, branches or []) | |
77 |
|
77 | |||
78 | schemes = { |
|
78 | schemes = { | |
79 | 'bundle': bundlerepo, |
|
79 | 'bundle': bundlerepo, | |
80 | 'union': unionrepo, |
|
80 | 'union': unionrepo, | |
81 | 'file': _local, |
|
81 | 'file': _local, | |
82 | 'http': httppeer, |
|
82 | 'http': httppeer, | |
83 | 'https': httppeer, |
|
83 | 'https': httppeer, | |
84 | 'ssh': sshpeer, |
|
84 | 'ssh': sshpeer, | |
85 | 'static-http': statichttprepo, |
|
85 | 'static-http': statichttprepo, | |
86 | } |
|
86 | } | |
87 |
|
87 | |||
88 | def _peerlookup(path): |
|
88 | def _peerlookup(path): | |
89 | u = util.url(path) |
|
89 | u = util.url(path) | |
90 | scheme = u.scheme or 'file' |
|
90 | scheme = u.scheme or 'file' | |
91 | thing = schemes.get(scheme) or schemes['file'] |
|
91 | thing = schemes.get(scheme) or schemes['file'] | |
92 | try: |
|
92 | try: | |
93 | return thing(path) |
|
93 | return thing(path) | |
94 | except TypeError: |
|
94 | except TypeError: | |
95 | return thing |
|
95 | return thing | |
96 |
|
96 | |||
97 | def islocal(repo): |
|
97 | def islocal(repo): | |
98 | '''return true if repo (or path pointing to repo) is local''' |
|
98 | '''return true if repo (or path pointing to repo) is local''' | |
99 | if isinstance(repo, str): |
|
99 | if isinstance(repo, str): | |
100 | try: |
|
100 | try: | |
101 | return _peerlookup(repo).islocal(repo) |
|
101 | return _peerlookup(repo).islocal(repo) | |
102 | except AttributeError: |
|
102 | except AttributeError: | |
103 | return False |
|
103 | return False | |
104 | return repo.local() |
|
104 | return repo.local() | |
105 |
|
105 | |||
106 | def openpath(ui, path): |
|
106 | def openpath(ui, path): | |
107 | '''open path with open if local, url.open if remote''' |
|
107 | '''open path with open if local, url.open if remote''' | |
108 | pathurl = util.url(path, parsequery=False, parsefragment=False) |
|
108 | pathurl = util.url(path, parsequery=False, parsefragment=False) | |
109 | if pathurl.islocal(): |
|
109 | if pathurl.islocal(): | |
110 | return util.posixfile(pathurl.localpath(), 'rb') |
|
110 | return util.posixfile(pathurl.localpath(), 'rb') | |
111 | else: |
|
111 | else: | |
112 | return url.open(ui, path) |
|
112 | return url.open(ui, path) | |
113 |
|
113 | |||
114 | # a list of (ui, repo) functions called for wire peer initialization |
|
114 | # a list of (ui, repo) functions called for wire peer initialization | |
115 | wirepeersetupfuncs = [] |
|
115 | wirepeersetupfuncs = [] | |
116 |
|
116 | |||
117 | def _peerorrepo(ui, path, create=False): |
|
117 | def _peerorrepo(ui, path, create=False): | |
118 | """return a repository object for the specified path""" |
|
118 | """return a repository object for the specified path""" | |
119 | obj = _peerlookup(path).instance(ui, path, create) |
|
119 | obj = _peerlookup(path).instance(ui, path, create) | |
120 | ui = getattr(obj, "ui", ui) |
|
120 | ui = getattr(obj, "ui", ui) | |
121 | for name, module in extensions.extensions(ui): |
|
121 | for name, module in extensions.extensions(ui): | |
122 | hook = getattr(module, 'reposetup', None) |
|
122 | hook = getattr(module, 'reposetup', None) | |
123 | if hook: |
|
123 | if hook: | |
124 | hook(ui, obj) |
|
124 | hook(ui, obj) | |
125 | if not obj.local(): |
|
125 | if not obj.local(): | |
126 | for f in wirepeersetupfuncs: |
|
126 | for f in wirepeersetupfuncs: | |
127 | f(ui, obj) |
|
127 | f(ui, obj) | |
128 | return obj |
|
128 | return obj | |
129 |
|
129 | |||
130 | def repository(ui, path='', create=False): |
|
130 | def repository(ui, path='', create=False): | |
131 | """return a repository object for the specified path""" |
|
131 | """return a repository object for the specified path""" | |
132 | peer = _peerorrepo(ui, path, create) |
|
132 | peer = _peerorrepo(ui, path, create) | |
133 | repo = peer.local() |
|
133 | repo = peer.local() | |
134 | if not repo: |
|
134 | if not repo: | |
135 | raise util.Abort(_("repository '%s' is not local") % |
|
135 | raise util.Abort(_("repository '%s' is not local") % | |
136 | (path or peer.url())) |
|
136 | (path or peer.url())) | |
137 | return repo.filtered('visible') |
|
137 | return repo.filtered('visible') | |
138 |
|
138 | |||
139 | def peer(uiorrepo, opts, path, create=False): |
|
139 | def peer(uiorrepo, opts, path, create=False): | |
140 | '''return a repository peer for the specified path''' |
|
140 | '''return a repository peer for the specified path''' | |
141 | rui = remoteui(uiorrepo, opts) |
|
141 | rui = remoteui(uiorrepo, opts) | |
142 | return _peerorrepo(rui, path, create).peer() |
|
142 | return _peerorrepo(rui, path, create).peer() | |
143 |
|
143 | |||
144 | def defaultdest(source): |
|
144 | def defaultdest(source): | |
145 | '''return default destination of clone if none is given |
|
145 | '''return default destination of clone if none is given | |
146 |
|
146 | |||
147 | >>> defaultdest('foo') |
|
147 | >>> defaultdest('foo') | |
148 | 'foo' |
|
148 | 'foo' | |
149 | >>> defaultdest('/foo/bar') |
|
149 | >>> defaultdest('/foo/bar') | |
150 | 'bar' |
|
150 | 'bar' | |
151 | >>> defaultdest('/') |
|
151 | >>> defaultdest('/') | |
152 | '' |
|
152 | '' | |
153 | >>> defaultdest('') |
|
153 | >>> defaultdest('') | |
154 | '' |
|
154 | '' | |
155 | >>> defaultdest('http://example.org/') |
|
155 | >>> defaultdest('http://example.org/') | |
156 | '' |
|
156 | '' | |
157 | >>> defaultdest('http://example.org/foo/') |
|
157 | >>> defaultdest('http://example.org/foo/') | |
158 | 'foo' |
|
158 | 'foo' | |
159 | ''' |
|
159 | ''' | |
160 | path = util.url(source).path |
|
160 | path = util.url(source).path | |
161 | if not path: |
|
161 | if not path: | |
162 | return '' |
|
162 | return '' | |
163 | return os.path.basename(os.path.normpath(path)) |
|
163 | return os.path.basename(os.path.normpath(path)) | |
164 |
|
164 | |||
165 | def share(ui, source, dest=None, update=True, bookmarks=True): |
|
165 | def share(ui, source, dest=None, update=True, bookmarks=True): | |
166 | '''create a shared repository''' |
|
166 | '''create a shared repository''' | |
167 |
|
167 | |||
168 | if not islocal(source): |
|
168 | if not islocal(source): | |
169 | raise util.Abort(_('can only share local repositories')) |
|
169 | raise util.Abort(_('can only share local repositories')) | |
170 |
|
170 | |||
171 | if not dest: |
|
171 | if not dest: | |
172 | dest = defaultdest(source) |
|
172 | dest = defaultdest(source) | |
173 | else: |
|
173 | else: | |
174 | dest = ui.expandpath(dest) |
|
174 | dest = ui.expandpath(dest) | |
175 |
|
175 | |||
176 | if isinstance(source, str): |
|
176 | if isinstance(source, str): | |
177 | origsource = ui.expandpath(source) |
|
177 | origsource = ui.expandpath(source) | |
178 | source, branches = parseurl(origsource) |
|
178 | source, branches = parseurl(origsource) | |
179 | srcrepo = repository(ui, source) |
|
179 | srcrepo = repository(ui, source) | |
180 | rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None) |
|
180 | rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None) | |
181 | else: |
|
181 | else: | |
182 | srcrepo = source.local() |
|
182 | srcrepo = source.local() | |
183 | origsource = source = srcrepo.url() |
|
183 | origsource = source = srcrepo.url() | |
184 | checkout = None |
|
184 | checkout = None | |
185 |
|
185 | |||
186 | sharedpath = srcrepo.sharedpath # if our source is already sharing |
|
186 | sharedpath = srcrepo.sharedpath # if our source is already sharing | |
187 |
|
187 | |||
188 | destwvfs = scmutil.vfs(dest, realpath=True) |
|
188 | destwvfs = scmutil.vfs(dest, realpath=True) | |
189 | destvfs = scmutil.vfs(os.path.join(destwvfs.base, '.hg'), realpath=True) |
|
189 | destvfs = scmutil.vfs(os.path.join(destwvfs.base, '.hg'), realpath=True) | |
190 |
|
190 | |||
191 | if destvfs.lexists(): |
|
191 | if destvfs.lexists(): | |
192 | raise util.Abort(_('destination already exists')) |
|
192 | raise util.Abort(_('destination already exists')) | |
193 |
|
193 | |||
194 | if not destwvfs.isdir(): |
|
194 | if not destwvfs.isdir(): | |
195 | destwvfs.mkdir() |
|
195 | destwvfs.mkdir() | |
196 | destvfs.makedir() |
|
196 | destvfs.makedir() | |
197 |
|
197 | |||
198 | requirements = '' |
|
198 | requirements = '' | |
199 | try: |
|
199 | try: | |
200 | requirements = srcrepo.vfs.read('requires') |
|
200 | requirements = srcrepo.vfs.read('requires') | |
201 | except IOError, inst: |
|
201 | except IOError, inst: | |
202 | if inst.errno != errno.ENOENT: |
|
202 | if inst.errno != errno.ENOENT: | |
203 | raise |
|
203 | raise | |
204 |
|
204 | |||
205 | requirements += 'shared\n' |
|
205 | requirements += 'shared\n' | |
206 | destvfs.write('requires', requirements) |
|
206 | destvfs.write('requires', requirements) | |
207 | destvfs.write('sharedpath', sharedpath) |
|
207 | destvfs.write('sharedpath', sharedpath) | |
208 |
|
208 | |||
209 | r = repository(ui, destwvfs.base) |
|
209 | r = repository(ui, destwvfs.base) | |
210 |
|
210 | |||
211 | default = srcrepo.ui.config('paths', 'default') |
|
211 | default = srcrepo.ui.config('paths', 'default') | |
212 | if default: |
|
212 | if default: | |
213 | fp = r.vfs("hgrc", "w", text=True) |
|
213 | fp = r.vfs("hgrc", "w", text=True) | |
214 | fp.write("[paths]\n") |
|
214 | fp.write("[paths]\n") | |
215 | fp.write("default = %s\n" % default) |
|
215 | fp.write("default = %s\n" % default) | |
216 | fp.close() |
|
216 | fp.close() | |
217 |
|
217 | |||
218 | if update: |
|
218 | if update: | |
219 | r.ui.status(_("updating working directory\n")) |
|
219 | r.ui.status(_("updating working directory\n")) | |
220 | if update is not True: |
|
220 | if update is not True: | |
221 | checkout = update |
|
221 | checkout = update | |
222 | for test in (checkout, 'default', 'tip'): |
|
222 | for test in (checkout, 'default', 'tip'): | |
223 | if test is None: |
|
223 | if test is None: | |
224 | continue |
|
224 | continue | |
225 | try: |
|
225 | try: | |
226 | uprev = r.lookup(test) |
|
226 | uprev = r.lookup(test) | |
227 | break |
|
227 | break | |
228 | except error.RepoLookupError: |
|
228 | except error.RepoLookupError: | |
229 | continue |
|
229 | continue | |
230 | _update(r, uprev) |
|
230 | _update(r, uprev) | |
231 |
|
231 | |||
232 | if bookmarks: |
|
232 | if bookmarks: | |
233 | fp = r.vfs('shared', 'w') |
|
233 | fp = r.vfs('shared', 'w') | |
234 | fp.write('bookmarks\n') |
|
234 | fp.write('bookmarks\n') | |
235 | fp.close() |
|
235 | fp.close() | |
236 |
|
236 | |||
237 | def copystore(ui, srcrepo, destpath): |
|
237 | def copystore(ui, srcrepo, destpath): | |
238 | '''copy files from store of srcrepo in destpath |
|
238 | '''copy files from store of srcrepo in destpath | |
239 |
|
239 | |||
240 | returns destlock |
|
240 | returns destlock | |
241 | ''' |
|
241 | ''' | |
242 | destlock = None |
|
242 | destlock = None | |
243 | try: |
|
243 | try: | |
244 | hardlink = None |
|
244 | hardlink = None | |
245 | num = 0 |
|
245 | num = 0 | |
|
246 | closetopic = [None] | |||
|
247 | def prog(topic, pos): | |||
|
248 | if pos is None: | |||
|
249 | closetopic[0] = topic | |||
|
250 | else: | |||
|
251 | ui.progress(topic, pos + num) | |||
246 | srcpublishing = srcrepo.ui.configbool('phases', 'publish', True) |
|
252 | srcpublishing = srcrepo.ui.configbool('phases', 'publish', True) | |
247 | srcvfs = scmutil.vfs(srcrepo.sharedpath) |
|
253 | srcvfs = scmutil.vfs(srcrepo.sharedpath) | |
248 | dstvfs = scmutil.vfs(destpath) |
|
254 | dstvfs = scmutil.vfs(destpath) | |
249 | for f in srcrepo.store.copylist(): |
|
255 | for f in srcrepo.store.copylist(): | |
250 | if srcpublishing and f.endswith('phaseroots'): |
|
256 | if srcpublishing and f.endswith('phaseroots'): | |
251 | continue |
|
257 | continue | |
252 | dstbase = os.path.dirname(f) |
|
258 | dstbase = os.path.dirname(f) | |
253 | if dstbase and not dstvfs.exists(dstbase): |
|
259 | if dstbase and not dstvfs.exists(dstbase): | |
254 | dstvfs.mkdir(dstbase) |
|
260 | dstvfs.mkdir(dstbase) | |
255 | if srcvfs.exists(f): |
|
261 | if srcvfs.exists(f): | |
256 | if f.endswith('data'): |
|
262 | if f.endswith('data'): | |
257 | # 'dstbase' may be empty (e.g. revlog format 0) |
|
263 | # 'dstbase' may be empty (e.g. revlog format 0) | |
258 | lockfile = os.path.join(dstbase, "lock") |
|
264 | lockfile = os.path.join(dstbase, "lock") | |
259 | # lock to avoid premature writing to the target |
|
265 | # lock to avoid premature writing to the target | |
260 | destlock = lock.lock(dstvfs, lockfile) |
|
266 | destlock = lock.lock(dstvfs, lockfile) | |
261 | hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), |
|
267 | hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), | |
262 | hardlink) |
|
268 | hardlink, progress=prog) | |
263 | num += n |
|
269 | num += n | |
264 | if hardlink: |
|
270 | if hardlink: | |
265 | ui.debug("linked %d files\n" % num) |
|
271 | ui.debug("linked %d files\n" % num) | |
|
272 | if closetopic[0]: | |||
|
273 | ui.progress(closetopic[0], None) | |||
266 | else: |
|
274 | else: | |
267 | ui.debug("copied %d files\n" % num) |
|
275 | ui.debug("copied %d files\n" % num) | |
|
276 | if closetopic[0]: | |||
|
277 | ui.progress(closetopic[0], None) | |||
268 | return destlock |
|
278 | return destlock | |
269 | except: # re-raises |
|
279 | except: # re-raises | |
270 | release(destlock) |
|
280 | release(destlock) | |
271 | raise |
|
281 | raise | |
272 |
|
282 | |||
273 | def clone(ui, peeropts, source, dest=None, pull=False, rev=None, |
|
283 | def clone(ui, peeropts, source, dest=None, pull=False, rev=None, | |
274 | update=True, stream=False, branch=None): |
|
284 | update=True, stream=False, branch=None): | |
275 | """Make a copy of an existing repository. |
|
285 | """Make a copy of an existing repository. | |
276 |
|
286 | |||
277 | Create a copy of an existing repository in a new directory. The |
|
287 | Create a copy of an existing repository in a new directory. The | |
278 | source and destination are URLs, as passed to the repository |
|
288 | source and destination are URLs, as passed to the repository | |
279 | function. Returns a pair of repository peers, the source and |
|
289 | function. Returns a pair of repository peers, the source and | |
280 | newly created destination. |
|
290 | newly created destination. | |
281 |
|
291 | |||
282 | The location of the source is added to the new repository's |
|
292 | The location of the source is added to the new repository's | |
283 | .hg/hgrc file, as the default to be used for future pulls and |
|
293 | .hg/hgrc file, as the default to be used for future pulls and | |
284 | pushes. |
|
294 | pushes. | |
285 |
|
295 | |||
286 | If an exception is raised, the partly cloned/updated destination |
|
296 | If an exception is raised, the partly cloned/updated destination | |
287 | repository will be deleted. |
|
297 | repository will be deleted. | |
288 |
|
298 | |||
289 | Arguments: |
|
299 | Arguments: | |
290 |
|
300 | |||
291 | source: repository object or URL |
|
301 | source: repository object or URL | |
292 |
|
302 | |||
293 | dest: URL of destination repository to create (defaults to base |
|
303 | dest: URL of destination repository to create (defaults to base | |
294 | name of source repository) |
|
304 | name of source repository) | |
295 |
|
305 | |||
296 | pull: always pull from source repository, even in local case or if the |
|
306 | pull: always pull from source repository, even in local case or if the | |
297 | server prefers streaming |
|
307 | server prefers streaming | |
298 |
|
308 | |||
299 | stream: stream raw data uncompressed from repository (fast over |
|
309 | stream: stream raw data uncompressed from repository (fast over | |
300 | LAN, slow over WAN) |
|
310 | LAN, slow over WAN) | |
301 |
|
311 | |||
302 | rev: revision to clone up to (implies pull=True) |
|
312 | rev: revision to clone up to (implies pull=True) | |
303 |
|
313 | |||
304 | update: update working directory after clone completes, if |
|
314 | update: update working directory after clone completes, if | |
305 | destination is local repository (True means update to default rev, |
|
315 | destination is local repository (True means update to default rev, | |
306 | anything else is treated as a revision) |
|
316 | anything else is treated as a revision) | |
307 |
|
317 | |||
308 | branch: branches to clone |
|
318 | branch: branches to clone | |
309 | """ |
|
319 | """ | |
310 |
|
320 | |||
311 | if isinstance(source, str): |
|
321 | if isinstance(source, str): | |
312 | origsource = ui.expandpath(source) |
|
322 | origsource = ui.expandpath(source) | |
313 | source, branch = parseurl(origsource, branch) |
|
323 | source, branch = parseurl(origsource, branch) | |
314 | srcpeer = peer(ui, peeropts, source) |
|
324 | srcpeer = peer(ui, peeropts, source) | |
315 | else: |
|
325 | else: | |
316 | srcpeer = source.peer() # in case we were called with a localrepo |
|
326 | srcpeer = source.peer() # in case we were called with a localrepo | |
317 | branch = (None, branch or []) |
|
327 | branch = (None, branch or []) | |
318 | origsource = source = srcpeer.url() |
|
328 | origsource = source = srcpeer.url() | |
319 | rev, checkout = addbranchrevs(srcpeer, srcpeer, branch, rev) |
|
329 | rev, checkout = addbranchrevs(srcpeer, srcpeer, branch, rev) | |
320 |
|
330 | |||
321 | if dest is None: |
|
331 | if dest is None: | |
322 | dest = defaultdest(source) |
|
332 | dest = defaultdest(source) | |
323 | if dest: |
|
333 | if dest: | |
324 | ui.status(_("destination directory: %s\n") % dest) |
|
334 | ui.status(_("destination directory: %s\n") % dest) | |
325 | else: |
|
335 | else: | |
326 | dest = ui.expandpath(dest) |
|
336 | dest = ui.expandpath(dest) | |
327 |
|
337 | |||
328 | dest = util.urllocalpath(dest) |
|
338 | dest = util.urllocalpath(dest) | |
329 | source = util.urllocalpath(source) |
|
339 | source = util.urllocalpath(source) | |
330 |
|
340 | |||
331 | if not dest: |
|
341 | if not dest: | |
332 | raise util.Abort(_("empty destination path is not valid")) |
|
342 | raise util.Abort(_("empty destination path is not valid")) | |
333 |
|
343 | |||
334 | destvfs = scmutil.vfs(dest, expandpath=True) |
|
344 | destvfs = scmutil.vfs(dest, expandpath=True) | |
335 | if destvfs.lexists(): |
|
345 | if destvfs.lexists(): | |
336 | if not destvfs.isdir(): |
|
346 | if not destvfs.isdir(): | |
337 | raise util.Abort(_("destination '%s' already exists") % dest) |
|
347 | raise util.Abort(_("destination '%s' already exists") % dest) | |
338 | elif destvfs.listdir(): |
|
348 | elif destvfs.listdir(): | |
339 | raise util.Abort(_("destination '%s' is not empty") % dest) |
|
349 | raise util.Abort(_("destination '%s' is not empty") % dest) | |
340 |
|
350 | |||
341 | srclock = destlock = cleandir = None |
|
351 | srclock = destlock = cleandir = None | |
342 | srcrepo = srcpeer.local() |
|
352 | srcrepo = srcpeer.local() | |
343 | try: |
|
353 | try: | |
344 | abspath = origsource |
|
354 | abspath = origsource | |
345 | if islocal(origsource): |
|
355 | if islocal(origsource): | |
346 | abspath = os.path.abspath(util.urllocalpath(origsource)) |
|
356 | abspath = os.path.abspath(util.urllocalpath(origsource)) | |
347 |
|
357 | |||
348 | if islocal(dest): |
|
358 | if islocal(dest): | |
349 | cleandir = dest |
|
359 | cleandir = dest | |
350 |
|
360 | |||
351 | copy = False |
|
361 | copy = False | |
352 | if (srcrepo and srcrepo.cancopy() and islocal(dest) |
|
362 | if (srcrepo and srcrepo.cancopy() and islocal(dest) | |
353 | and not phases.hassecret(srcrepo)): |
|
363 | and not phases.hassecret(srcrepo)): | |
354 | copy = not pull and not rev |
|
364 | copy = not pull and not rev | |
355 |
|
365 | |||
356 | if copy: |
|
366 | if copy: | |
357 | try: |
|
367 | try: | |
358 | # we use a lock here because if we race with commit, we |
|
368 | # we use a lock here because if we race with commit, we | |
359 | # can end up with extra data in the cloned revlogs that's |
|
369 | # can end up with extra data in the cloned revlogs that's | |
360 | # not pointed to by changesets, thus causing verify to |
|
370 | # not pointed to by changesets, thus causing verify to | |
361 | # fail |
|
371 | # fail | |
362 | srclock = srcrepo.lock(wait=False) |
|
372 | srclock = srcrepo.lock(wait=False) | |
363 | except error.LockError: |
|
373 | except error.LockError: | |
364 | copy = False |
|
374 | copy = False | |
365 |
|
375 | |||
366 | if copy: |
|
376 | if copy: | |
367 | srcrepo.hook('preoutgoing', throw=True, source='clone') |
|
377 | srcrepo.hook('preoutgoing', throw=True, source='clone') | |
368 | hgdir = os.path.realpath(os.path.join(dest, ".hg")) |
|
378 | hgdir = os.path.realpath(os.path.join(dest, ".hg")) | |
369 | if not os.path.exists(dest): |
|
379 | if not os.path.exists(dest): | |
370 | os.mkdir(dest) |
|
380 | os.mkdir(dest) | |
371 | else: |
|
381 | else: | |
372 | # only clean up directories we create ourselves |
|
382 | # only clean up directories we create ourselves | |
373 | cleandir = hgdir |
|
383 | cleandir = hgdir | |
374 | try: |
|
384 | try: | |
375 | destpath = hgdir |
|
385 | destpath = hgdir | |
376 | util.makedir(destpath, notindexed=True) |
|
386 | util.makedir(destpath, notindexed=True) | |
377 | except OSError, inst: |
|
387 | except OSError, inst: | |
378 | if inst.errno == errno.EEXIST: |
|
388 | if inst.errno == errno.EEXIST: | |
379 | cleandir = None |
|
389 | cleandir = None | |
380 | raise util.Abort(_("destination '%s' already exists") |
|
390 | raise util.Abort(_("destination '%s' already exists") | |
381 | % dest) |
|
391 | % dest) | |
382 | raise |
|
392 | raise | |
383 |
|
393 | |||
384 | destlock = copystore(ui, srcrepo, destpath) |
|
394 | destlock = copystore(ui, srcrepo, destpath) | |
385 | # copy bookmarks over |
|
395 | # copy bookmarks over | |
386 | srcbookmarks = srcrepo.join('bookmarks') |
|
396 | srcbookmarks = srcrepo.join('bookmarks') | |
387 | dstbookmarks = os.path.join(destpath, 'bookmarks') |
|
397 | dstbookmarks = os.path.join(destpath, 'bookmarks') | |
388 | if os.path.exists(srcbookmarks): |
|
398 | if os.path.exists(srcbookmarks): | |
389 | util.copyfile(srcbookmarks, dstbookmarks) |
|
399 | util.copyfile(srcbookmarks, dstbookmarks) | |
390 |
|
400 | |||
391 | # Recomputing branch cache might be slow on big repos, |
|
401 | # Recomputing branch cache might be slow on big repos, | |
392 | # so just copy it |
|
402 | # so just copy it | |
393 | def copybranchcache(fname): |
|
403 | def copybranchcache(fname): | |
394 | srcbranchcache = srcrepo.join('cache/%s' % fname) |
|
404 | srcbranchcache = srcrepo.join('cache/%s' % fname) | |
395 | dstbranchcache = os.path.join(dstcachedir, fname) |
|
405 | dstbranchcache = os.path.join(dstcachedir, fname) | |
396 | if os.path.exists(srcbranchcache): |
|
406 | if os.path.exists(srcbranchcache): | |
397 | if not os.path.exists(dstcachedir): |
|
407 | if not os.path.exists(dstcachedir): | |
398 | os.mkdir(dstcachedir) |
|
408 | os.mkdir(dstcachedir) | |
399 | util.copyfile(srcbranchcache, dstbranchcache) |
|
409 | util.copyfile(srcbranchcache, dstbranchcache) | |
400 |
|
410 | |||
401 | dstcachedir = os.path.join(destpath, 'cache') |
|
411 | dstcachedir = os.path.join(destpath, 'cache') | |
402 | # In local clones we're copying all nodes, not just served |
|
412 | # In local clones we're copying all nodes, not just served | |
403 | # ones. Therefore copy all branch caches over. |
|
413 | # ones. Therefore copy all branch caches over. | |
404 | copybranchcache('branch2') |
|
414 | copybranchcache('branch2') | |
405 | for cachename in repoview.filtertable: |
|
415 | for cachename in repoview.filtertable: | |
406 | copybranchcache('branch2-%s' % cachename) |
|
416 | copybranchcache('branch2-%s' % cachename) | |
407 |
|
417 | |||
408 | # we need to re-init the repo after manually copying the data |
|
418 | # we need to re-init the repo after manually copying the data | |
409 | # into it |
|
419 | # into it | |
410 | destpeer = peer(srcrepo, peeropts, dest) |
|
420 | destpeer = peer(srcrepo, peeropts, dest) | |
411 | srcrepo.hook('outgoing', source='clone', |
|
421 | srcrepo.hook('outgoing', source='clone', | |
412 | node=node.hex(node.nullid)) |
|
422 | node=node.hex(node.nullid)) | |
413 | else: |
|
423 | else: | |
414 | try: |
|
424 | try: | |
415 | destpeer = peer(srcrepo or ui, peeropts, dest, create=True) |
|
425 | destpeer = peer(srcrepo or ui, peeropts, dest, create=True) | |
416 | # only pass ui when no srcrepo |
|
426 | # only pass ui when no srcrepo | |
417 | except OSError, inst: |
|
427 | except OSError, inst: | |
418 | if inst.errno == errno.EEXIST: |
|
428 | if inst.errno == errno.EEXIST: | |
419 | cleandir = None |
|
429 | cleandir = None | |
420 | raise util.Abort(_("destination '%s' already exists") |
|
430 | raise util.Abort(_("destination '%s' already exists") | |
421 | % dest) |
|
431 | % dest) | |
422 | raise |
|
432 | raise | |
423 |
|
433 | |||
424 | revs = None |
|
434 | revs = None | |
425 | if rev: |
|
435 | if rev: | |
426 | if not srcpeer.capable('lookup'): |
|
436 | if not srcpeer.capable('lookup'): | |
427 | raise util.Abort(_("src repository does not support " |
|
437 | raise util.Abort(_("src repository does not support " | |
428 | "revision lookup and so doesn't " |
|
438 | "revision lookup and so doesn't " | |
429 | "support clone by revision")) |
|
439 | "support clone by revision")) | |
430 | revs = [srcpeer.lookup(r) for r in rev] |
|
440 | revs = [srcpeer.lookup(r) for r in rev] | |
431 | checkout = revs[0] |
|
441 | checkout = revs[0] | |
432 | if destpeer.local(): |
|
442 | if destpeer.local(): | |
433 | if not stream: |
|
443 | if not stream: | |
434 | if pull: |
|
444 | if pull: | |
435 | stream = False |
|
445 | stream = False | |
436 | else: |
|
446 | else: | |
437 | stream = None |
|
447 | stream = None | |
438 | destpeer.local().clone(srcpeer, heads=revs, stream=stream) |
|
448 | destpeer.local().clone(srcpeer, heads=revs, stream=stream) | |
439 | elif srcrepo: |
|
449 | elif srcrepo: | |
440 | exchange.push(srcrepo, destpeer, revs=revs, |
|
450 | exchange.push(srcrepo, destpeer, revs=revs, | |
441 | bookmarks=srcrepo._bookmarks.keys()) |
|
451 | bookmarks=srcrepo._bookmarks.keys()) | |
442 | else: |
|
452 | else: | |
443 | raise util.Abort(_("clone from remote to remote not supported")) |
|
453 | raise util.Abort(_("clone from remote to remote not supported")) | |
444 |
|
454 | |||
445 | cleandir = None |
|
455 | cleandir = None | |
446 |
|
456 | |||
447 | destrepo = destpeer.local() |
|
457 | destrepo = destpeer.local() | |
448 | if destrepo: |
|
458 | if destrepo: | |
449 | template = uimod.samplehgrcs['cloned'] |
|
459 | template = uimod.samplehgrcs['cloned'] | |
450 | fp = destrepo.vfs("hgrc", "w", text=True) |
|
460 | fp = destrepo.vfs("hgrc", "w", text=True) | |
451 | u = util.url(abspath) |
|
461 | u = util.url(abspath) | |
452 | u.passwd = None |
|
462 | u.passwd = None | |
453 | defaulturl = str(u) |
|
463 | defaulturl = str(u) | |
454 | fp.write(template % defaulturl) |
|
464 | fp.write(template % defaulturl) | |
455 | fp.close() |
|
465 | fp.close() | |
456 |
|
466 | |||
457 | destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') |
|
467 | destrepo.ui.setconfig('paths', 'default', defaulturl, 'clone') | |
458 |
|
468 | |||
459 | if update: |
|
469 | if update: | |
460 | if update is not True: |
|
470 | if update is not True: | |
461 | checkout = srcpeer.lookup(update) |
|
471 | checkout = srcpeer.lookup(update) | |
462 | uprev = None |
|
472 | uprev = None | |
463 | status = None |
|
473 | status = None | |
464 | if checkout is not None: |
|
474 | if checkout is not None: | |
465 | try: |
|
475 | try: | |
466 | uprev = destrepo.lookup(checkout) |
|
476 | uprev = destrepo.lookup(checkout) | |
467 | except error.RepoLookupError: |
|
477 | except error.RepoLookupError: | |
468 | pass |
|
478 | pass | |
469 | if uprev is None: |
|
479 | if uprev is None: | |
470 | try: |
|
480 | try: | |
471 | uprev = destrepo._bookmarks['@'] |
|
481 | uprev = destrepo._bookmarks['@'] | |
472 | update = '@' |
|
482 | update = '@' | |
473 | bn = destrepo[uprev].branch() |
|
483 | bn = destrepo[uprev].branch() | |
474 | if bn == 'default': |
|
484 | if bn == 'default': | |
475 | status = _("updating to bookmark @\n") |
|
485 | status = _("updating to bookmark @\n") | |
476 | else: |
|
486 | else: | |
477 | status = (_("updating to bookmark @ on branch %s\n") |
|
487 | status = (_("updating to bookmark @ on branch %s\n") | |
478 | % bn) |
|
488 | % bn) | |
479 | except KeyError: |
|
489 | except KeyError: | |
480 | try: |
|
490 | try: | |
481 | uprev = destrepo.branchtip('default') |
|
491 | uprev = destrepo.branchtip('default') | |
482 | except error.RepoLookupError: |
|
492 | except error.RepoLookupError: | |
483 | uprev = destrepo.lookup('tip') |
|
493 | uprev = destrepo.lookup('tip') | |
484 | if not status: |
|
494 | if not status: | |
485 | bn = destrepo[uprev].branch() |
|
495 | bn = destrepo[uprev].branch() | |
486 | status = _("updating to branch %s\n") % bn |
|
496 | status = _("updating to branch %s\n") % bn | |
487 | destrepo.ui.status(status) |
|
497 | destrepo.ui.status(status) | |
488 | _update(destrepo, uprev) |
|
498 | _update(destrepo, uprev) | |
489 | if update in destrepo._bookmarks: |
|
499 | if update in destrepo._bookmarks: | |
490 | bookmarks.setcurrent(destrepo, update) |
|
500 | bookmarks.setcurrent(destrepo, update) | |
491 | finally: |
|
501 | finally: | |
492 | release(srclock, destlock) |
|
502 | release(srclock, destlock) | |
493 | if cleandir is not None: |
|
503 | if cleandir is not None: | |
494 | shutil.rmtree(cleandir, True) |
|
504 | shutil.rmtree(cleandir, True) | |
495 | if srcpeer is not None: |
|
505 | if srcpeer is not None: | |
496 | srcpeer.close() |
|
506 | srcpeer.close() | |
497 | return srcpeer, destpeer |
|
507 | return srcpeer, destpeer | |
498 |
|
508 | |||
499 | def _showstats(repo, stats): |
|
509 | def _showstats(repo, stats): | |
500 | repo.ui.status(_("%d files updated, %d files merged, " |
|
510 | repo.ui.status(_("%d files updated, %d files merged, " | |
501 | "%d files removed, %d files unresolved\n") % stats) |
|
511 | "%d files removed, %d files unresolved\n") % stats) | |
502 |
|
512 | |||
503 | def updaterepo(repo, node, overwrite): |
|
513 | def updaterepo(repo, node, overwrite): | |
504 | """Update the working directory to node. |
|
514 | """Update the working directory to node. | |
505 |
|
515 | |||
506 | When overwrite is set, changes are clobbered, merged else |
|
516 | When overwrite is set, changes are clobbered, merged else | |
507 |
|
517 | |||
508 | returns stats (see pydoc mercurial.merge.applyupdates)""" |
|
518 | returns stats (see pydoc mercurial.merge.applyupdates)""" | |
509 | return mergemod.update(repo, node, False, overwrite, None, |
|
519 | return mergemod.update(repo, node, False, overwrite, None, | |
510 | labels=['working copy', 'destination']) |
|
520 | labels=['working copy', 'destination']) | |
511 |
|
521 | |||
512 | def update(repo, node): |
|
522 | def update(repo, node): | |
513 | """update the working directory to node, merging linear changes""" |
|
523 | """update the working directory to node, merging linear changes""" | |
514 | stats = updaterepo(repo, node, False) |
|
524 | stats = updaterepo(repo, node, False) | |
515 | _showstats(repo, stats) |
|
525 | _showstats(repo, stats) | |
516 | if stats[3]: |
|
526 | if stats[3]: | |
517 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) |
|
527 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) | |
518 | return stats[3] > 0 |
|
528 | return stats[3] > 0 | |
519 |
|
529 | |||
520 | # naming conflict in clone() |
|
530 | # naming conflict in clone() | |
521 | _update = update |
|
531 | _update = update | |
522 |
|
532 | |||
523 | def clean(repo, node, show_stats=True): |
|
533 | def clean(repo, node, show_stats=True): | |
524 | """forcibly switch the working directory to node, clobbering changes""" |
|
534 | """forcibly switch the working directory to node, clobbering changes""" | |
525 | stats = updaterepo(repo, node, True) |
|
535 | stats = updaterepo(repo, node, True) | |
526 | util.unlinkpath(repo.join('graftstate'), ignoremissing=True) |
|
536 | util.unlinkpath(repo.join('graftstate'), ignoremissing=True) | |
527 | if show_stats: |
|
537 | if show_stats: | |
528 | _showstats(repo, stats) |
|
538 | _showstats(repo, stats) | |
529 | return stats[3] > 0 |
|
539 | return stats[3] > 0 | |
530 |
|
540 | |||
531 | def merge(repo, node, force=None, remind=True): |
|
541 | def merge(repo, node, force=None, remind=True): | |
532 | """Branch merge with node, resolving changes. Return true if any |
|
542 | """Branch merge with node, resolving changes. Return true if any | |
533 | unresolved conflicts.""" |
|
543 | unresolved conflicts.""" | |
534 | stats = mergemod.update(repo, node, True, force, False) |
|
544 | stats = mergemod.update(repo, node, True, force, False) | |
535 | _showstats(repo, stats) |
|
545 | _showstats(repo, stats) | |
536 | if stats[3]: |
|
546 | if stats[3]: | |
537 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " |
|
547 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " | |
538 | "or 'hg update -C .' to abandon\n")) |
|
548 | "or 'hg update -C .' to abandon\n")) | |
539 | elif remind: |
|
549 | elif remind: | |
540 | repo.ui.status(_("(branch merge, don't forget to commit)\n")) |
|
550 | repo.ui.status(_("(branch merge, don't forget to commit)\n")) | |
541 | return stats[3] > 0 |
|
551 | return stats[3] > 0 | |
542 |
|
552 | |||
543 | def _incoming(displaychlist, subreporecurse, ui, repo, source, |
|
553 | def _incoming(displaychlist, subreporecurse, ui, repo, source, | |
544 | opts, buffered=False): |
|
554 | opts, buffered=False): | |
545 | """ |
|
555 | """ | |
546 | Helper for incoming / gincoming. |
|
556 | Helper for incoming / gincoming. | |
547 | displaychlist gets called with |
|
557 | displaychlist gets called with | |
548 | (remoterepo, incomingchangesetlist, displayer) parameters, |
|
558 | (remoterepo, incomingchangesetlist, displayer) parameters, | |
549 | and is supposed to contain only code that can't be unified. |
|
559 | and is supposed to contain only code that can't be unified. | |
550 | """ |
|
560 | """ | |
551 | source, branches = parseurl(ui.expandpath(source), opts.get('branch')) |
|
561 | source, branches = parseurl(ui.expandpath(source), opts.get('branch')) | |
552 | other = peer(repo, opts, source) |
|
562 | other = peer(repo, opts, source) | |
553 | ui.status(_('comparing with %s\n') % util.hidepassword(source)) |
|
563 | ui.status(_('comparing with %s\n') % util.hidepassword(source)) | |
554 | revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev')) |
|
564 | revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev')) | |
555 |
|
565 | |||
556 | if revs: |
|
566 | if revs: | |
557 | revs = [other.lookup(rev) for rev in revs] |
|
567 | revs = [other.lookup(rev) for rev in revs] | |
558 | other, chlist, cleanupfn = bundlerepo.getremotechanges(ui, repo, other, |
|
568 | other, chlist, cleanupfn = bundlerepo.getremotechanges(ui, repo, other, | |
559 | revs, opts["bundle"], opts["force"]) |
|
569 | revs, opts["bundle"], opts["force"]) | |
560 | try: |
|
570 | try: | |
561 | if not chlist: |
|
571 | if not chlist: | |
562 | ui.status(_("no changes found\n")) |
|
572 | ui.status(_("no changes found\n")) | |
563 | return subreporecurse() |
|
573 | return subreporecurse() | |
564 |
|
574 | |||
565 | displayer = cmdutil.show_changeset(ui, other, opts, buffered) |
|
575 | displayer = cmdutil.show_changeset(ui, other, opts, buffered) | |
566 | displaychlist(other, chlist, displayer) |
|
576 | displaychlist(other, chlist, displayer) | |
567 | displayer.close() |
|
577 | displayer.close() | |
568 | finally: |
|
578 | finally: | |
569 | cleanupfn() |
|
579 | cleanupfn() | |
570 | subreporecurse() |
|
580 | subreporecurse() | |
571 | return 0 # exit code is zero since we found incoming changes |
|
581 | return 0 # exit code is zero since we found incoming changes | |
572 |
|
582 | |||
573 | def incoming(ui, repo, source, opts): |
|
583 | def incoming(ui, repo, source, opts): | |
574 | def subreporecurse(): |
|
584 | def subreporecurse(): | |
575 | ret = 1 |
|
585 | ret = 1 | |
576 | if opts.get('subrepos'): |
|
586 | if opts.get('subrepos'): | |
577 | ctx = repo[None] |
|
587 | ctx = repo[None] | |
578 | for subpath in sorted(ctx.substate): |
|
588 | for subpath in sorted(ctx.substate): | |
579 | sub = ctx.sub(subpath) |
|
589 | sub = ctx.sub(subpath) | |
580 | ret = min(ret, sub.incoming(ui, source, opts)) |
|
590 | ret = min(ret, sub.incoming(ui, source, opts)) | |
581 | return ret |
|
591 | return ret | |
582 |
|
592 | |||
583 | def display(other, chlist, displayer): |
|
593 | def display(other, chlist, displayer): | |
584 | limit = cmdutil.loglimit(opts) |
|
594 | limit = cmdutil.loglimit(opts) | |
585 | if opts.get('newest_first'): |
|
595 | if opts.get('newest_first'): | |
586 | chlist.reverse() |
|
596 | chlist.reverse() | |
587 | count = 0 |
|
597 | count = 0 | |
588 | for n in chlist: |
|
598 | for n in chlist: | |
589 | if limit is not None and count >= limit: |
|
599 | if limit is not None and count >= limit: | |
590 | break |
|
600 | break | |
591 | parents = [p for p in other.changelog.parents(n) if p != nullid] |
|
601 | parents = [p for p in other.changelog.parents(n) if p != nullid] | |
592 | if opts.get('no_merges') and len(parents) == 2: |
|
602 | if opts.get('no_merges') and len(parents) == 2: | |
593 | continue |
|
603 | continue | |
594 | count += 1 |
|
604 | count += 1 | |
595 | displayer.show(other[n]) |
|
605 | displayer.show(other[n]) | |
596 | return _incoming(display, subreporecurse, ui, repo, source, opts) |
|
606 | return _incoming(display, subreporecurse, ui, repo, source, opts) | |
597 |
|
607 | |||
598 | def _outgoing(ui, repo, dest, opts): |
|
608 | def _outgoing(ui, repo, dest, opts): | |
599 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
609 | dest = ui.expandpath(dest or 'default-push', dest or 'default') | |
600 | dest, branches = parseurl(dest, opts.get('branch')) |
|
610 | dest, branches = parseurl(dest, opts.get('branch')) | |
601 | ui.status(_('comparing with %s\n') % util.hidepassword(dest)) |
|
611 | ui.status(_('comparing with %s\n') % util.hidepassword(dest)) | |
602 | revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev')) |
|
612 | revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev')) | |
603 | if revs: |
|
613 | if revs: | |
604 | revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)] |
|
614 | revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)] | |
605 |
|
615 | |||
606 | other = peer(repo, opts, dest) |
|
616 | other = peer(repo, opts, dest) | |
607 | outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs, |
|
617 | outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs, | |
608 | force=opts.get('force')) |
|
618 | force=opts.get('force')) | |
609 | o = outgoing.missing |
|
619 | o = outgoing.missing | |
610 | if not o: |
|
620 | if not o: | |
611 | scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) |
|
621 | scmutil.nochangesfound(repo.ui, repo, outgoing.excluded) | |
612 | return o, other |
|
622 | return o, other | |
613 |
|
623 | |||
614 | def outgoing(ui, repo, dest, opts): |
|
624 | def outgoing(ui, repo, dest, opts): | |
615 | def recurse(): |
|
625 | def recurse(): | |
616 | ret = 1 |
|
626 | ret = 1 | |
617 | if opts.get('subrepos'): |
|
627 | if opts.get('subrepos'): | |
618 | ctx = repo[None] |
|
628 | ctx = repo[None] | |
619 | for subpath in sorted(ctx.substate): |
|
629 | for subpath in sorted(ctx.substate): | |
620 | sub = ctx.sub(subpath) |
|
630 | sub = ctx.sub(subpath) | |
621 | ret = min(ret, sub.outgoing(ui, dest, opts)) |
|
631 | ret = min(ret, sub.outgoing(ui, dest, opts)) | |
622 | return ret |
|
632 | return ret | |
623 |
|
633 | |||
624 | limit = cmdutil.loglimit(opts) |
|
634 | limit = cmdutil.loglimit(opts) | |
625 | o, other = _outgoing(ui, repo, dest, opts) |
|
635 | o, other = _outgoing(ui, repo, dest, opts) | |
626 | if not o: |
|
636 | if not o: | |
627 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
637 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
628 | return recurse() |
|
638 | return recurse() | |
629 |
|
639 | |||
630 | if opts.get('newest_first'): |
|
640 | if opts.get('newest_first'): | |
631 | o.reverse() |
|
641 | o.reverse() | |
632 | displayer = cmdutil.show_changeset(ui, repo, opts) |
|
642 | displayer = cmdutil.show_changeset(ui, repo, opts) | |
633 | count = 0 |
|
643 | count = 0 | |
634 | for n in o: |
|
644 | for n in o: | |
635 | if limit is not None and count >= limit: |
|
645 | if limit is not None and count >= limit: | |
636 | break |
|
646 | break | |
637 | parents = [p for p in repo.changelog.parents(n) if p != nullid] |
|
647 | parents = [p for p in repo.changelog.parents(n) if p != nullid] | |
638 | if opts.get('no_merges') and len(parents) == 2: |
|
648 | if opts.get('no_merges') and len(parents) == 2: | |
639 | continue |
|
649 | continue | |
640 | count += 1 |
|
650 | count += 1 | |
641 | displayer.show(repo[n]) |
|
651 | displayer.show(repo[n]) | |
642 | displayer.close() |
|
652 | displayer.close() | |
643 | cmdutil.outgoinghooks(ui, repo, other, opts, o) |
|
653 | cmdutil.outgoinghooks(ui, repo, other, opts, o) | |
644 | recurse() |
|
654 | recurse() | |
645 | return 0 # exit code is zero since we found outgoing changes |
|
655 | return 0 # exit code is zero since we found outgoing changes | |
646 |
|
656 | |||
647 | def revert(repo, node, choose): |
|
657 | def revert(repo, node, choose): | |
648 | """revert changes to revision in node without updating dirstate""" |
|
658 | """revert changes to revision in node without updating dirstate""" | |
649 | return mergemod.update(repo, node, False, True, choose)[3] > 0 |
|
659 | return mergemod.update(repo, node, False, True, choose)[3] > 0 | |
650 |
|
660 | |||
651 | def verify(repo): |
|
661 | def verify(repo): | |
652 | """verify the consistency of a repository""" |
|
662 | """verify the consistency of a repository""" | |
653 | return verifymod.verify(repo) |
|
663 | return verifymod.verify(repo) | |
654 |
|
664 | |||
655 | def remoteui(src, opts): |
|
665 | def remoteui(src, opts): | |
656 | 'build a remote ui from ui or repo and opts' |
|
666 | 'build a remote ui from ui or repo and opts' | |
657 | if util.safehasattr(src, 'baseui'): # looks like a repository |
|
667 | if util.safehasattr(src, 'baseui'): # looks like a repository | |
658 | dst = src.baseui.copy() # drop repo-specific config |
|
668 | dst = src.baseui.copy() # drop repo-specific config | |
659 | src = src.ui # copy target options from repo |
|
669 | src = src.ui # copy target options from repo | |
660 | else: # assume it's a global ui object |
|
670 | else: # assume it's a global ui object | |
661 | dst = src.copy() # keep all global options |
|
671 | dst = src.copy() # keep all global options | |
662 |
|
672 | |||
663 | # copy ssh-specific options |
|
673 | # copy ssh-specific options | |
664 | for o in 'ssh', 'remotecmd': |
|
674 | for o in 'ssh', 'remotecmd': | |
665 | v = opts.get(o) or src.config('ui', o) |
|
675 | v = opts.get(o) or src.config('ui', o) | |
666 | if v: |
|
676 | if v: | |
667 | dst.setconfig("ui", o, v, 'copied') |
|
677 | dst.setconfig("ui", o, v, 'copied') | |
668 |
|
678 | |||
669 | # copy bundle-specific options |
|
679 | # copy bundle-specific options | |
670 | r = src.config('bundle', 'mainreporoot') |
|
680 | r = src.config('bundle', 'mainreporoot') | |
671 | if r: |
|
681 | if r: | |
672 | dst.setconfig('bundle', 'mainreporoot', r, 'copied') |
|
682 | dst.setconfig('bundle', 'mainreporoot', r, 'copied') | |
673 |
|
683 | |||
674 | # copy selected local settings to the remote ui |
|
684 | # copy selected local settings to the remote ui | |
675 | for sect in ('auth', 'hostfingerprints', 'http_proxy'): |
|
685 | for sect in ('auth', 'hostfingerprints', 'http_proxy'): | |
676 | for key, val in src.configitems(sect): |
|
686 | for key, val in src.configitems(sect): | |
677 | dst.setconfig(sect, key, val, 'copied') |
|
687 | dst.setconfig(sect, key, val, 'copied') | |
678 | v = src.config('web', 'cacerts') |
|
688 | v = src.config('web', 'cacerts') | |
679 | if v == '!': |
|
689 | if v == '!': | |
680 | dst.setconfig('web', 'cacerts', v, 'copied') |
|
690 | dst.setconfig('web', 'cacerts', v, 'copied') | |
681 | elif v: |
|
691 | elif v: | |
682 | dst.setconfig('web', 'cacerts', util.expandpath(v), 'copied') |
|
692 | dst.setconfig('web', 'cacerts', util.expandpath(v), 'copied') | |
683 |
|
693 | |||
684 | return dst |
|
694 | return dst |
@@ -1,662 +1,670 b'' | |||||
1 | Prepare repo a: |
|
1 | Prepare repo a: | |
2 |
|
2 | |||
3 | $ hg init a |
|
3 | $ hg init a | |
4 | $ cd a |
|
4 | $ cd a | |
5 | $ echo a > a |
|
5 | $ echo a > a | |
6 | $ hg add a |
|
6 | $ hg add a | |
7 | $ hg commit -m test |
|
7 | $ hg commit -m test | |
8 | $ echo first line > b |
|
8 | $ echo first line > b | |
9 | $ hg add b |
|
9 | $ hg add b | |
10 |
|
10 | |||
11 | Create a non-inlined filelog: |
|
11 | Create a non-inlined filelog: | |
12 |
|
12 | |||
13 | $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))' |
|
13 | $ $PYTHON -c 'file("data1", "wb").write("".join("%s\n" % x for x in range(10000)))' | |
14 | $ for j in 0 1 2 3 4 5 6 7 8 9; do |
|
14 | $ for j in 0 1 2 3 4 5 6 7 8 9; do | |
15 | > cat data1 >> b |
|
15 | > cat data1 >> b | |
16 | > hg commit -m test |
|
16 | > hg commit -m test | |
17 | > done |
|
17 | > done | |
18 |
|
18 | |||
19 | List files in store/data (should show a 'b.d'): |
|
19 | List files in store/data (should show a 'b.d'): | |
20 |
|
20 | |||
21 | $ for i in .hg/store/data/*; do |
|
21 | $ for i in .hg/store/data/*; do | |
22 | > echo $i |
|
22 | > echo $i | |
23 | > done |
|
23 | > done | |
24 | .hg/store/data/a.i |
|
24 | .hg/store/data/a.i | |
25 | .hg/store/data/b.d |
|
25 | .hg/store/data/b.d | |
26 | .hg/store/data/b.i |
|
26 | .hg/store/data/b.i | |
27 |
|
27 | |||
28 | Trigger branchcache creation: |
|
28 | Trigger branchcache creation: | |
29 |
|
29 | |||
30 | $ hg branches |
|
30 | $ hg branches | |
31 | default 10:a7949464abda |
|
31 | default 10:a7949464abda | |
32 | $ ls .hg/cache |
|
32 | $ ls .hg/cache | |
33 | branch2-served |
|
33 | branch2-served | |
34 | rbc-names-v1 |
|
34 | rbc-names-v1 | |
35 | rbc-revs-v1 |
|
35 | rbc-revs-v1 | |
36 |
|
36 | |||
37 | Default operation: |
|
37 | Default operation: | |
38 |
|
38 | |||
39 | $ hg clone . ../b |
|
39 | $ hg clone . ../b | |
40 | updating to branch default |
|
40 | updating to branch default | |
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
41 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
42 | $ cd ../b |
|
42 | $ cd ../b | |
43 |
|
43 | |||
44 | Ensure branchcache got copied over: |
|
44 | Ensure branchcache got copied over: | |
45 |
|
45 | |||
46 | $ ls .hg/cache |
|
46 | $ ls .hg/cache | |
47 | branch2-served |
|
47 | branch2-served | |
48 |
|
48 | |||
49 | $ cat a |
|
49 | $ cat a | |
50 | a |
|
50 | a | |
51 | $ hg verify |
|
51 | $ hg verify | |
52 | checking changesets |
|
52 | checking changesets | |
53 | checking manifests |
|
53 | checking manifests | |
54 | crosschecking files in changesets and manifests |
|
54 | crosschecking files in changesets and manifests | |
55 | checking files |
|
55 | checking files | |
56 | 2 files, 11 changesets, 11 total revisions |
|
56 | 2 files, 11 changesets, 11 total revisions | |
57 |
|
57 | |||
58 | Invalid dest '' must abort: |
|
58 | Invalid dest '' must abort: | |
59 |
|
59 | |||
60 | $ hg clone . '' |
|
60 | $ hg clone . '' | |
61 | abort: empty destination path is not valid |
|
61 | abort: empty destination path is not valid | |
62 | [255] |
|
62 | [255] | |
63 |
|
63 | |||
64 | No update, with debug option: |
|
64 | No update, with debug option: | |
65 |
|
65 | |||
66 | #if hardlink |
|
66 | #if hardlink | |
67 | $ hg --debug clone -U . ../c |
|
67 | $ hg --debug clone -U . ../c | |
|
68 | linking: 1 | |||
|
69 | linking: 2 | |||
|
70 | linking: 3 | |||
|
71 | linking: 4 | |||
|
72 | linking: 5 | |||
|
73 | linking: 6 | |||
|
74 | linking: 7 | |||
|
75 | linking: 8 | |||
68 | linked 8 files |
|
76 | linked 8 files | |
69 | #else |
|
77 | #else | |
70 | $ hg --debug clone -U . ../c |
|
78 | $ hg --debug clone -U . ../c | |
71 | copied 8 files |
|
79 | copied 8 files | |
72 | #endif |
|
80 | #endif | |
73 | $ cd ../c |
|
81 | $ cd ../c | |
74 |
|
82 | |||
75 | Ensure branchcache got copied over: |
|
83 | Ensure branchcache got copied over: | |
76 |
|
84 | |||
77 | $ ls .hg/cache |
|
85 | $ ls .hg/cache | |
78 | branch2-served |
|
86 | branch2-served | |
79 |
|
87 | |||
80 | $ cat a 2>/dev/null || echo "a not present" |
|
88 | $ cat a 2>/dev/null || echo "a not present" | |
81 | a not present |
|
89 | a not present | |
82 | $ hg verify |
|
90 | $ hg verify | |
83 | checking changesets |
|
91 | checking changesets | |
84 | checking manifests |
|
92 | checking manifests | |
85 | crosschecking files in changesets and manifests |
|
93 | crosschecking files in changesets and manifests | |
86 | checking files |
|
94 | checking files | |
87 | 2 files, 11 changesets, 11 total revisions |
|
95 | 2 files, 11 changesets, 11 total revisions | |
88 |
|
96 | |||
89 | Default destination: |
|
97 | Default destination: | |
90 |
|
98 | |||
91 | $ mkdir ../d |
|
99 | $ mkdir ../d | |
92 | $ cd ../d |
|
100 | $ cd ../d | |
93 | $ hg clone ../a |
|
101 | $ hg clone ../a | |
94 | destination directory: a |
|
102 | destination directory: a | |
95 | updating to branch default |
|
103 | updating to branch default | |
96 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
104 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
97 | $ cd a |
|
105 | $ cd a | |
98 | $ hg cat a |
|
106 | $ hg cat a | |
99 | a |
|
107 | a | |
100 | $ cd ../.. |
|
108 | $ cd ../.. | |
101 |
|
109 | |||
102 | Check that we drop the 'file:' from the path before writing the .hgrc: |
|
110 | Check that we drop the 'file:' from the path before writing the .hgrc: | |
103 |
|
111 | |||
104 | $ hg clone file:a e |
|
112 | $ hg clone file:a e | |
105 | updating to branch default |
|
113 | updating to branch default | |
106 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
114 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 | $ grep 'file:' e/.hg/hgrc |
|
115 | $ grep 'file:' e/.hg/hgrc | |
108 | [1] |
|
116 | [1] | |
109 |
|
117 | |||
110 | Check that path aliases are expanded: |
|
118 | Check that path aliases are expanded: | |
111 |
|
119 | |||
112 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f |
|
120 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f | |
113 | $ hg -R f showconfig paths.default |
|
121 | $ hg -R f showconfig paths.default | |
114 | $TESTTMP/a#0 (glob) |
|
122 | $TESTTMP/a#0 (glob) | |
115 |
|
123 | |||
116 | Use --pull: |
|
124 | Use --pull: | |
117 |
|
125 | |||
118 | $ hg clone --pull a g |
|
126 | $ hg clone --pull a g | |
119 | requesting all changes |
|
127 | requesting all changes | |
120 | adding changesets |
|
128 | adding changesets | |
121 | adding manifests |
|
129 | adding manifests | |
122 | adding file changes |
|
130 | adding file changes | |
123 | added 11 changesets with 11 changes to 2 files |
|
131 | added 11 changesets with 11 changes to 2 files | |
124 | updating to branch default |
|
132 | updating to branch default | |
125 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
133 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
126 | $ hg -R g verify |
|
134 | $ hg -R g verify | |
127 | checking changesets |
|
135 | checking changesets | |
128 | checking manifests |
|
136 | checking manifests | |
129 | crosschecking files in changesets and manifests |
|
137 | crosschecking files in changesets and manifests | |
130 | checking files |
|
138 | checking files | |
131 | 2 files, 11 changesets, 11 total revisions |
|
139 | 2 files, 11 changesets, 11 total revisions | |
132 |
|
140 | |||
133 | Invalid dest '' with --pull must abort (issue2528): |
|
141 | Invalid dest '' with --pull must abort (issue2528): | |
134 |
|
142 | |||
135 | $ hg clone --pull a '' |
|
143 | $ hg clone --pull a '' | |
136 | abort: empty destination path is not valid |
|
144 | abort: empty destination path is not valid | |
137 | [255] |
|
145 | [255] | |
138 |
|
146 | |||
139 | Clone to '.': |
|
147 | Clone to '.': | |
140 |
|
148 | |||
141 | $ mkdir h |
|
149 | $ mkdir h | |
142 | $ cd h |
|
150 | $ cd h | |
143 | $ hg clone ../a . |
|
151 | $ hg clone ../a . | |
144 | updating to branch default |
|
152 | updating to branch default | |
145 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
153 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
146 | $ cd .. |
|
154 | $ cd .. | |
147 |
|
155 | |||
148 |
|
156 | |||
149 | *** Tests for option -u *** |
|
157 | *** Tests for option -u *** | |
150 |
|
158 | |||
151 | Adding some more history to repo a: |
|
159 | Adding some more history to repo a: | |
152 |
|
160 | |||
153 | $ cd a |
|
161 | $ cd a | |
154 | $ hg tag ref1 |
|
162 | $ hg tag ref1 | |
155 | $ echo the quick brown fox >a |
|
163 | $ echo the quick brown fox >a | |
156 | $ hg ci -m "hacked default" |
|
164 | $ hg ci -m "hacked default" | |
157 | $ hg up ref1 |
|
165 | $ hg up ref1 | |
158 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
166 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
159 | $ hg branch stable |
|
167 | $ hg branch stable | |
160 | marked working directory as branch stable |
|
168 | marked working directory as branch stable | |
161 | (branches are permanent and global, did you want a bookmark?) |
|
169 | (branches are permanent and global, did you want a bookmark?) | |
162 | $ echo some text >a |
|
170 | $ echo some text >a | |
163 | $ hg ci -m "starting branch stable" |
|
171 | $ hg ci -m "starting branch stable" | |
164 | $ hg tag ref2 |
|
172 | $ hg tag ref2 | |
165 | $ echo some more text >a |
|
173 | $ echo some more text >a | |
166 | $ hg ci -m "another change for branch stable" |
|
174 | $ hg ci -m "another change for branch stable" | |
167 | $ hg up ref2 |
|
175 | $ hg up ref2 | |
168 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
176 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
169 | $ hg parents |
|
177 | $ hg parents | |
170 | changeset: 13:e8ece76546a6 |
|
178 | changeset: 13:e8ece76546a6 | |
171 | branch: stable |
|
179 | branch: stable | |
172 | tag: ref2 |
|
180 | tag: ref2 | |
173 | parent: 10:a7949464abda |
|
181 | parent: 10:a7949464abda | |
174 | user: test |
|
182 | user: test | |
175 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
183 | date: Thu Jan 01 00:00:00 1970 +0000 | |
176 | summary: starting branch stable |
|
184 | summary: starting branch stable | |
177 |
|
185 | |||
178 |
|
186 | |||
179 | Repo a has two heads: |
|
187 | Repo a has two heads: | |
180 |
|
188 | |||
181 | $ hg heads |
|
189 | $ hg heads | |
182 | changeset: 15:0aae7cf88f0d |
|
190 | changeset: 15:0aae7cf88f0d | |
183 | branch: stable |
|
191 | branch: stable | |
184 | tag: tip |
|
192 | tag: tip | |
185 | user: test |
|
193 | user: test | |
186 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
194 | date: Thu Jan 01 00:00:00 1970 +0000 | |
187 | summary: another change for branch stable |
|
195 | summary: another change for branch stable | |
188 |
|
196 | |||
189 | changeset: 12:f21241060d6a |
|
197 | changeset: 12:f21241060d6a | |
190 | user: test |
|
198 | user: test | |
191 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
199 | date: Thu Jan 01 00:00:00 1970 +0000 | |
192 | summary: hacked default |
|
200 | summary: hacked default | |
193 |
|
201 | |||
194 |
|
202 | |||
195 | $ cd .. |
|
203 | $ cd .. | |
196 |
|
204 | |||
197 |
|
205 | |||
198 | Testing --noupdate with --updaterev (must abort): |
|
206 | Testing --noupdate with --updaterev (must abort): | |
199 |
|
207 | |||
200 | $ hg clone --noupdate --updaterev 1 a ua |
|
208 | $ hg clone --noupdate --updaterev 1 a ua | |
201 | abort: cannot specify both --noupdate and --updaterev |
|
209 | abort: cannot specify both --noupdate and --updaterev | |
202 | [255] |
|
210 | [255] | |
203 |
|
211 | |||
204 |
|
212 | |||
205 | Testing clone -u: |
|
213 | Testing clone -u: | |
206 |
|
214 | |||
207 | $ hg clone -u . a ua |
|
215 | $ hg clone -u . a ua | |
208 | updating to branch stable |
|
216 | updating to branch stable | |
209 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
217 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
210 |
|
218 | |||
211 | Repo ua has both heads: |
|
219 | Repo ua has both heads: | |
212 |
|
220 | |||
213 | $ hg -R ua heads |
|
221 | $ hg -R ua heads | |
214 | changeset: 15:0aae7cf88f0d |
|
222 | changeset: 15:0aae7cf88f0d | |
215 | branch: stable |
|
223 | branch: stable | |
216 | tag: tip |
|
224 | tag: tip | |
217 | user: test |
|
225 | user: test | |
218 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
226 | date: Thu Jan 01 00:00:00 1970 +0000 | |
219 | summary: another change for branch stable |
|
227 | summary: another change for branch stable | |
220 |
|
228 | |||
221 | changeset: 12:f21241060d6a |
|
229 | changeset: 12:f21241060d6a | |
222 | user: test |
|
230 | user: test | |
223 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
231 | date: Thu Jan 01 00:00:00 1970 +0000 | |
224 | summary: hacked default |
|
232 | summary: hacked default | |
225 |
|
233 | |||
226 |
|
234 | |||
227 | Same revision checked out in repo a and ua: |
|
235 | Same revision checked out in repo a and ua: | |
228 |
|
236 | |||
229 | $ hg -R a parents --template "{node|short}\n" |
|
237 | $ hg -R a parents --template "{node|short}\n" | |
230 | e8ece76546a6 |
|
238 | e8ece76546a6 | |
231 | $ hg -R ua parents --template "{node|short}\n" |
|
239 | $ hg -R ua parents --template "{node|short}\n" | |
232 | e8ece76546a6 |
|
240 | e8ece76546a6 | |
233 |
|
241 | |||
234 | $ rm -r ua |
|
242 | $ rm -r ua | |
235 |
|
243 | |||
236 |
|
244 | |||
237 | Testing clone --pull -u: |
|
245 | Testing clone --pull -u: | |
238 |
|
246 | |||
239 | $ hg clone --pull -u . a ua |
|
247 | $ hg clone --pull -u . a ua | |
240 | requesting all changes |
|
248 | requesting all changes | |
241 | adding changesets |
|
249 | adding changesets | |
242 | adding manifests |
|
250 | adding manifests | |
243 | adding file changes |
|
251 | adding file changes | |
244 | added 16 changesets with 16 changes to 3 files (+1 heads) |
|
252 | added 16 changesets with 16 changes to 3 files (+1 heads) | |
245 | updating to branch stable |
|
253 | updating to branch stable | |
246 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
254 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
247 |
|
255 | |||
248 | Repo ua has both heads: |
|
256 | Repo ua has both heads: | |
249 |
|
257 | |||
250 | $ hg -R ua heads |
|
258 | $ hg -R ua heads | |
251 | changeset: 15:0aae7cf88f0d |
|
259 | changeset: 15:0aae7cf88f0d | |
252 | branch: stable |
|
260 | branch: stable | |
253 | tag: tip |
|
261 | tag: tip | |
254 | user: test |
|
262 | user: test | |
255 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
263 | date: Thu Jan 01 00:00:00 1970 +0000 | |
256 | summary: another change for branch stable |
|
264 | summary: another change for branch stable | |
257 |
|
265 | |||
258 | changeset: 12:f21241060d6a |
|
266 | changeset: 12:f21241060d6a | |
259 | user: test |
|
267 | user: test | |
260 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
268 | date: Thu Jan 01 00:00:00 1970 +0000 | |
261 | summary: hacked default |
|
269 | summary: hacked default | |
262 |
|
270 | |||
263 |
|
271 | |||
264 | Same revision checked out in repo a and ua: |
|
272 | Same revision checked out in repo a and ua: | |
265 |
|
273 | |||
266 | $ hg -R a parents --template "{node|short}\n" |
|
274 | $ hg -R a parents --template "{node|short}\n" | |
267 | e8ece76546a6 |
|
275 | e8ece76546a6 | |
268 | $ hg -R ua parents --template "{node|short}\n" |
|
276 | $ hg -R ua parents --template "{node|short}\n" | |
269 | e8ece76546a6 |
|
277 | e8ece76546a6 | |
270 |
|
278 | |||
271 | $ rm -r ua |
|
279 | $ rm -r ua | |
272 |
|
280 | |||
273 |
|
281 | |||
274 | Testing clone -u <branch>: |
|
282 | Testing clone -u <branch>: | |
275 |
|
283 | |||
276 | $ hg clone -u stable a ua |
|
284 | $ hg clone -u stable a ua | |
277 | updating to branch stable |
|
285 | updating to branch stable | |
278 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
286 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
279 |
|
287 | |||
280 | Repo ua has both heads: |
|
288 | Repo ua has both heads: | |
281 |
|
289 | |||
282 | $ hg -R ua heads |
|
290 | $ hg -R ua heads | |
283 | changeset: 15:0aae7cf88f0d |
|
291 | changeset: 15:0aae7cf88f0d | |
284 | branch: stable |
|
292 | branch: stable | |
285 | tag: tip |
|
293 | tag: tip | |
286 | user: test |
|
294 | user: test | |
287 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
295 | date: Thu Jan 01 00:00:00 1970 +0000 | |
288 | summary: another change for branch stable |
|
296 | summary: another change for branch stable | |
289 |
|
297 | |||
290 | changeset: 12:f21241060d6a |
|
298 | changeset: 12:f21241060d6a | |
291 | user: test |
|
299 | user: test | |
292 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
300 | date: Thu Jan 01 00:00:00 1970 +0000 | |
293 | summary: hacked default |
|
301 | summary: hacked default | |
294 |
|
302 | |||
295 |
|
303 | |||
296 | Branch 'stable' is checked out: |
|
304 | Branch 'stable' is checked out: | |
297 |
|
305 | |||
298 | $ hg -R ua parents |
|
306 | $ hg -R ua parents | |
299 | changeset: 15:0aae7cf88f0d |
|
307 | changeset: 15:0aae7cf88f0d | |
300 | branch: stable |
|
308 | branch: stable | |
301 | tag: tip |
|
309 | tag: tip | |
302 | user: test |
|
310 | user: test | |
303 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
311 | date: Thu Jan 01 00:00:00 1970 +0000 | |
304 | summary: another change for branch stable |
|
312 | summary: another change for branch stable | |
305 |
|
313 | |||
306 |
|
314 | |||
307 | $ rm -r ua |
|
315 | $ rm -r ua | |
308 |
|
316 | |||
309 |
|
317 | |||
310 | Testing default checkout: |
|
318 | Testing default checkout: | |
311 |
|
319 | |||
312 | $ hg clone a ua |
|
320 | $ hg clone a ua | |
313 | updating to branch default |
|
321 | updating to branch default | |
314 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
322 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
315 |
|
323 | |||
316 | Repo ua has both heads: |
|
324 | Repo ua has both heads: | |
317 |
|
325 | |||
318 | $ hg -R ua heads |
|
326 | $ hg -R ua heads | |
319 | changeset: 15:0aae7cf88f0d |
|
327 | changeset: 15:0aae7cf88f0d | |
320 | branch: stable |
|
328 | branch: stable | |
321 | tag: tip |
|
329 | tag: tip | |
322 | user: test |
|
330 | user: test | |
323 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
331 | date: Thu Jan 01 00:00:00 1970 +0000 | |
324 | summary: another change for branch stable |
|
332 | summary: another change for branch stable | |
325 |
|
333 | |||
326 | changeset: 12:f21241060d6a |
|
334 | changeset: 12:f21241060d6a | |
327 | user: test |
|
335 | user: test | |
328 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
336 | date: Thu Jan 01 00:00:00 1970 +0000 | |
329 | summary: hacked default |
|
337 | summary: hacked default | |
330 |
|
338 | |||
331 |
|
339 | |||
332 | Branch 'default' is checked out: |
|
340 | Branch 'default' is checked out: | |
333 |
|
341 | |||
334 | $ hg -R ua parents |
|
342 | $ hg -R ua parents | |
335 | changeset: 12:f21241060d6a |
|
343 | changeset: 12:f21241060d6a | |
336 | user: test |
|
344 | user: test | |
337 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
345 | date: Thu Jan 01 00:00:00 1970 +0000 | |
338 | summary: hacked default |
|
346 | summary: hacked default | |
339 |
|
347 | |||
340 | Test clone with a branch named "@" (issue3677) |
|
348 | Test clone with a branch named "@" (issue3677) | |
341 |
|
349 | |||
342 | $ hg -R ua branch @ |
|
350 | $ hg -R ua branch @ | |
343 | marked working directory as branch @ |
|
351 | marked working directory as branch @ | |
344 | (branches are permanent and global, did you want a bookmark?) |
|
352 | (branches are permanent and global, did you want a bookmark?) | |
345 | $ hg -R ua commit -m 'created branch @' |
|
353 | $ hg -R ua commit -m 'created branch @' | |
346 | $ hg clone ua atbranch |
|
354 | $ hg clone ua atbranch | |
347 | updating to branch default |
|
355 | updating to branch default | |
348 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
356 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
349 | $ hg -R atbranch heads |
|
357 | $ hg -R atbranch heads | |
350 | changeset: 16:798b6d97153e |
|
358 | changeset: 16:798b6d97153e | |
351 | branch: @ |
|
359 | branch: @ | |
352 | tag: tip |
|
360 | tag: tip | |
353 | parent: 12:f21241060d6a |
|
361 | parent: 12:f21241060d6a | |
354 | user: test |
|
362 | user: test | |
355 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
363 | date: Thu Jan 01 00:00:00 1970 +0000 | |
356 | summary: created branch @ |
|
364 | summary: created branch @ | |
357 |
|
365 | |||
358 | changeset: 15:0aae7cf88f0d |
|
366 | changeset: 15:0aae7cf88f0d | |
359 | branch: stable |
|
367 | branch: stable | |
360 | user: test |
|
368 | user: test | |
361 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
369 | date: Thu Jan 01 00:00:00 1970 +0000 | |
362 | summary: another change for branch stable |
|
370 | summary: another change for branch stable | |
363 |
|
371 | |||
364 | changeset: 12:f21241060d6a |
|
372 | changeset: 12:f21241060d6a | |
365 | user: test |
|
373 | user: test | |
366 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
374 | date: Thu Jan 01 00:00:00 1970 +0000 | |
367 | summary: hacked default |
|
375 | summary: hacked default | |
368 |
|
376 | |||
369 | $ hg -R atbranch parents |
|
377 | $ hg -R atbranch parents | |
370 | changeset: 12:f21241060d6a |
|
378 | changeset: 12:f21241060d6a | |
371 | user: test |
|
379 | user: test | |
372 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
380 | date: Thu Jan 01 00:00:00 1970 +0000 | |
373 | summary: hacked default |
|
381 | summary: hacked default | |
374 |
|
382 | |||
375 |
|
383 | |||
376 | $ rm -r ua atbranch |
|
384 | $ rm -r ua atbranch | |
377 |
|
385 | |||
378 |
|
386 | |||
379 | Testing #<branch>: |
|
387 | Testing #<branch>: | |
380 |
|
388 | |||
381 | $ hg clone -u . a#stable ua |
|
389 | $ hg clone -u . a#stable ua | |
382 | adding changesets |
|
390 | adding changesets | |
383 | adding manifests |
|
391 | adding manifests | |
384 | adding file changes |
|
392 | adding file changes | |
385 | added 14 changesets with 14 changes to 3 files |
|
393 | added 14 changesets with 14 changes to 3 files | |
386 | updating to branch stable |
|
394 | updating to branch stable | |
387 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
395 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
388 |
|
396 | |||
389 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
397 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
390 |
|
398 | |||
391 | $ hg -R ua heads |
|
399 | $ hg -R ua heads | |
392 | changeset: 13:0aae7cf88f0d |
|
400 | changeset: 13:0aae7cf88f0d | |
393 | branch: stable |
|
401 | branch: stable | |
394 | tag: tip |
|
402 | tag: tip | |
395 | user: test |
|
403 | user: test | |
396 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
404 | date: Thu Jan 01 00:00:00 1970 +0000 | |
397 | summary: another change for branch stable |
|
405 | summary: another change for branch stable | |
398 |
|
406 | |||
399 | changeset: 10:a7949464abda |
|
407 | changeset: 10:a7949464abda | |
400 | user: test |
|
408 | user: test | |
401 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 | date: Thu Jan 01 00:00:00 1970 +0000 | |
402 | summary: test |
|
410 | summary: test | |
403 |
|
411 | |||
404 |
|
412 | |||
405 | Same revision checked out in repo a and ua: |
|
413 | Same revision checked out in repo a and ua: | |
406 |
|
414 | |||
407 | $ hg -R a parents --template "{node|short}\n" |
|
415 | $ hg -R a parents --template "{node|short}\n" | |
408 | e8ece76546a6 |
|
416 | e8ece76546a6 | |
409 | $ hg -R ua parents --template "{node|short}\n" |
|
417 | $ hg -R ua parents --template "{node|short}\n" | |
410 | e8ece76546a6 |
|
418 | e8ece76546a6 | |
411 |
|
419 | |||
412 | $ rm -r ua |
|
420 | $ rm -r ua | |
413 |
|
421 | |||
414 |
|
422 | |||
415 | Testing -u -r <branch>: |
|
423 | Testing -u -r <branch>: | |
416 |
|
424 | |||
417 | $ hg clone -u . -r stable a ua |
|
425 | $ hg clone -u . -r stable a ua | |
418 | adding changesets |
|
426 | adding changesets | |
419 | adding manifests |
|
427 | adding manifests | |
420 | adding file changes |
|
428 | adding file changes | |
421 | added 14 changesets with 14 changes to 3 files |
|
429 | added 14 changesets with 14 changes to 3 files | |
422 | updating to branch stable |
|
430 | updating to branch stable | |
423 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
431 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
424 |
|
432 | |||
425 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
433 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
426 |
|
434 | |||
427 | $ hg -R ua heads |
|
435 | $ hg -R ua heads | |
428 | changeset: 13:0aae7cf88f0d |
|
436 | changeset: 13:0aae7cf88f0d | |
429 | branch: stable |
|
437 | branch: stable | |
430 | tag: tip |
|
438 | tag: tip | |
431 | user: test |
|
439 | user: test | |
432 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
440 | date: Thu Jan 01 00:00:00 1970 +0000 | |
433 | summary: another change for branch stable |
|
441 | summary: another change for branch stable | |
434 |
|
442 | |||
435 | changeset: 10:a7949464abda |
|
443 | changeset: 10:a7949464abda | |
436 | user: test |
|
444 | user: test | |
437 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
445 | date: Thu Jan 01 00:00:00 1970 +0000 | |
438 | summary: test |
|
446 | summary: test | |
439 |
|
447 | |||
440 |
|
448 | |||
441 | Same revision checked out in repo a and ua: |
|
449 | Same revision checked out in repo a and ua: | |
442 |
|
450 | |||
443 | $ hg -R a parents --template "{node|short}\n" |
|
451 | $ hg -R a parents --template "{node|short}\n" | |
444 | e8ece76546a6 |
|
452 | e8ece76546a6 | |
445 | $ hg -R ua parents --template "{node|short}\n" |
|
453 | $ hg -R ua parents --template "{node|short}\n" | |
446 | e8ece76546a6 |
|
454 | e8ece76546a6 | |
447 |
|
455 | |||
448 | $ rm -r ua |
|
456 | $ rm -r ua | |
449 |
|
457 | |||
450 |
|
458 | |||
451 | Testing -r <branch>: |
|
459 | Testing -r <branch>: | |
452 |
|
460 | |||
453 | $ hg clone -r stable a ua |
|
461 | $ hg clone -r stable a ua | |
454 | adding changesets |
|
462 | adding changesets | |
455 | adding manifests |
|
463 | adding manifests | |
456 | adding file changes |
|
464 | adding file changes | |
457 | added 14 changesets with 14 changes to 3 files |
|
465 | added 14 changesets with 14 changes to 3 files | |
458 | updating to branch stable |
|
466 | updating to branch stable | |
459 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
467 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
460 |
|
468 | |||
461 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
469 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
462 |
|
470 | |||
463 | $ hg -R ua heads |
|
471 | $ hg -R ua heads | |
464 | changeset: 13:0aae7cf88f0d |
|
472 | changeset: 13:0aae7cf88f0d | |
465 | branch: stable |
|
473 | branch: stable | |
466 | tag: tip |
|
474 | tag: tip | |
467 | user: test |
|
475 | user: test | |
468 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
476 | date: Thu Jan 01 00:00:00 1970 +0000 | |
469 | summary: another change for branch stable |
|
477 | summary: another change for branch stable | |
470 |
|
478 | |||
471 | changeset: 10:a7949464abda |
|
479 | changeset: 10:a7949464abda | |
472 | user: test |
|
480 | user: test | |
473 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
481 | date: Thu Jan 01 00:00:00 1970 +0000 | |
474 | summary: test |
|
482 | summary: test | |
475 |
|
483 | |||
476 |
|
484 | |||
477 | Branch 'stable' is checked out: |
|
485 | Branch 'stable' is checked out: | |
478 |
|
486 | |||
479 | $ hg -R ua parents |
|
487 | $ hg -R ua parents | |
480 | changeset: 13:0aae7cf88f0d |
|
488 | changeset: 13:0aae7cf88f0d | |
481 | branch: stable |
|
489 | branch: stable | |
482 | tag: tip |
|
490 | tag: tip | |
483 | user: test |
|
491 | user: test | |
484 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
492 | date: Thu Jan 01 00:00:00 1970 +0000 | |
485 | summary: another change for branch stable |
|
493 | summary: another change for branch stable | |
486 |
|
494 | |||
487 |
|
495 | |||
488 | $ rm -r ua |
|
496 | $ rm -r ua | |
489 |
|
497 | |||
490 |
|
498 | |||
491 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not |
|
499 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not | |
492 | iterable in addbranchrevs() |
|
500 | iterable in addbranchrevs() | |
493 |
|
501 | |||
494 | $ cat <<EOF > simpleclone.py |
|
502 | $ cat <<EOF > simpleclone.py | |
495 | > from mercurial import ui, hg |
|
503 | > from mercurial import ui, hg | |
496 | > myui = ui.ui() |
|
504 | > myui = ui.ui() | |
497 | > repo = hg.repository(myui, 'a') |
|
505 | > repo = hg.repository(myui, 'a') | |
498 | > hg.clone(myui, {}, repo, dest="ua") |
|
506 | > hg.clone(myui, {}, repo, dest="ua") | |
499 | > EOF |
|
507 | > EOF | |
500 |
|
508 | |||
501 | $ python simpleclone.py |
|
509 | $ python simpleclone.py | |
502 | updating to branch default |
|
510 | updating to branch default | |
503 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
511 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
504 |
|
512 | |||
505 | $ rm -r ua |
|
513 | $ rm -r ua | |
506 |
|
514 | |||
507 | $ cat <<EOF > branchclone.py |
|
515 | $ cat <<EOF > branchclone.py | |
508 | > from mercurial import ui, hg, extensions |
|
516 | > from mercurial import ui, hg, extensions | |
509 | > myui = ui.ui() |
|
517 | > myui = ui.ui() | |
510 | > extensions.loadall(myui) |
|
518 | > extensions.loadall(myui) | |
511 | > repo = hg.repository(myui, 'a') |
|
519 | > repo = hg.repository(myui, 'a') | |
512 | > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) |
|
520 | > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) | |
513 | > EOF |
|
521 | > EOF | |
514 |
|
522 | |||
515 | $ python branchclone.py |
|
523 | $ python branchclone.py | |
516 | adding changesets |
|
524 | adding changesets | |
517 | adding manifests |
|
525 | adding manifests | |
518 | adding file changes |
|
526 | adding file changes | |
519 | added 14 changesets with 14 changes to 3 files |
|
527 | added 14 changesets with 14 changes to 3 files | |
520 | updating to branch stable |
|
528 | updating to branch stable | |
521 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
529 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
522 | $ rm -r ua |
|
530 | $ rm -r ua | |
523 |
|
531 | |||
524 |
|
532 | |||
525 | Test clone with special '@' bookmark: |
|
533 | Test clone with special '@' bookmark: | |
526 | $ cd a |
|
534 | $ cd a | |
527 | $ hg bookmark -r a7949464abda @ # branch point of stable from default |
|
535 | $ hg bookmark -r a7949464abda @ # branch point of stable from default | |
528 | $ hg clone . ../i |
|
536 | $ hg clone . ../i | |
529 | updating to bookmark @ |
|
537 | updating to bookmark @ | |
530 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
538 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
531 | $ hg id -i ../i |
|
539 | $ hg id -i ../i | |
532 | a7949464abda |
|
540 | a7949464abda | |
533 | $ rm -r ../i |
|
541 | $ rm -r ../i | |
534 |
|
542 | |||
535 | $ hg bookmark -f -r stable @ |
|
543 | $ hg bookmark -f -r stable @ | |
536 | $ hg bookmarks |
|
544 | $ hg bookmarks | |
537 | @ 15:0aae7cf88f0d |
|
545 | @ 15:0aae7cf88f0d | |
538 | $ hg clone . ../i |
|
546 | $ hg clone . ../i | |
539 | updating to bookmark @ on branch stable |
|
547 | updating to bookmark @ on branch stable | |
540 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
548 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
541 | $ hg id -i ../i |
|
549 | $ hg id -i ../i | |
542 | 0aae7cf88f0d |
|
550 | 0aae7cf88f0d | |
543 | $ cd "$TESTTMP" |
|
551 | $ cd "$TESTTMP" | |
544 |
|
552 | |||
545 |
|
553 | |||
546 | Testing failures: |
|
554 | Testing failures: | |
547 |
|
555 | |||
548 | $ mkdir fail |
|
556 | $ mkdir fail | |
549 | $ cd fail |
|
557 | $ cd fail | |
550 |
|
558 | |||
551 | No local source |
|
559 | No local source | |
552 |
|
560 | |||
553 | $ hg clone a b |
|
561 | $ hg clone a b | |
554 | abort: repository a not found! |
|
562 | abort: repository a not found! | |
555 | [255] |
|
563 | [255] | |
556 |
|
564 | |||
557 | No remote source |
|
565 | No remote source | |
558 |
|
566 | |||
559 | #if windows |
|
567 | #if windows | |
560 | $ hg clone http://127.0.0.1:3121/a b |
|
568 | $ hg clone http://127.0.0.1:3121/a b | |
561 | abort: error: * (glob) |
|
569 | abort: error: * (glob) | |
562 | [255] |
|
570 | [255] | |
563 | #else |
|
571 | #else | |
564 | $ hg clone http://127.0.0.1:3121/a b |
|
572 | $ hg clone http://127.0.0.1:3121/a b | |
565 | abort: error: *refused* (glob) |
|
573 | abort: error: *refused* (glob) | |
566 | [255] |
|
574 | [255] | |
567 | #endif |
|
575 | #endif | |
568 | $ rm -rf b # work around bug with http clone |
|
576 | $ rm -rf b # work around bug with http clone | |
569 |
|
577 | |||
570 |
|
578 | |||
571 | #if unix-permissions no-root |
|
579 | #if unix-permissions no-root | |
572 |
|
580 | |||
573 | Inaccessible source |
|
581 | Inaccessible source | |
574 |
|
582 | |||
575 | $ mkdir a |
|
583 | $ mkdir a | |
576 | $ chmod 000 a |
|
584 | $ chmod 000 a | |
577 | $ hg clone a b |
|
585 | $ hg clone a b | |
578 | abort: repository a not found! |
|
586 | abort: repository a not found! | |
579 | [255] |
|
587 | [255] | |
580 |
|
588 | |||
581 | Inaccessible destination |
|
589 | Inaccessible destination | |
582 |
|
590 | |||
583 | $ hg init b |
|
591 | $ hg init b | |
584 | $ cd b |
|
592 | $ cd b | |
585 | $ hg clone . ../a |
|
593 | $ hg clone . ../a | |
586 | abort: Permission denied: '../a' |
|
594 | abort: Permission denied: '../a' | |
587 | [255] |
|
595 | [255] | |
588 | $ cd .. |
|
596 | $ cd .. | |
589 | $ chmod 700 a |
|
597 | $ chmod 700 a | |
590 | $ rm -r a b |
|
598 | $ rm -r a b | |
591 |
|
599 | |||
592 | #endif |
|
600 | #endif | |
593 |
|
601 | |||
594 |
|
602 | |||
595 | #if fifo |
|
603 | #if fifo | |
596 |
|
604 | |||
597 | Source of wrong type |
|
605 | Source of wrong type | |
598 |
|
606 | |||
599 | $ mkfifo a |
|
607 | $ mkfifo a | |
600 | $ hg clone a b |
|
608 | $ hg clone a b | |
601 | abort: repository a not found! |
|
609 | abort: repository a not found! | |
602 | [255] |
|
610 | [255] | |
603 | $ rm a |
|
611 | $ rm a | |
604 |
|
612 | |||
605 | #endif |
|
613 | #endif | |
606 |
|
614 | |||
607 | Default destination, same directory |
|
615 | Default destination, same directory | |
608 |
|
616 | |||
609 | $ hg init q |
|
617 | $ hg init q | |
610 | $ hg clone q |
|
618 | $ hg clone q | |
611 | destination directory: q |
|
619 | destination directory: q | |
612 | abort: destination 'q' is not empty |
|
620 | abort: destination 'q' is not empty | |
613 | [255] |
|
621 | [255] | |
614 |
|
622 | |||
615 | destination directory not empty |
|
623 | destination directory not empty | |
616 |
|
624 | |||
617 | $ mkdir a |
|
625 | $ mkdir a | |
618 | $ echo stuff > a/a |
|
626 | $ echo stuff > a/a | |
619 | $ hg clone q a |
|
627 | $ hg clone q a | |
620 | abort: destination 'a' is not empty |
|
628 | abort: destination 'a' is not empty | |
621 | [255] |
|
629 | [255] | |
622 |
|
630 | |||
623 |
|
631 | |||
624 | #if unix-permissions no-root |
|
632 | #if unix-permissions no-root | |
625 |
|
633 | |||
626 | leave existing directory in place after clone failure |
|
634 | leave existing directory in place after clone failure | |
627 |
|
635 | |||
628 | $ hg init c |
|
636 | $ hg init c | |
629 | $ cd c |
|
637 | $ cd c | |
630 | $ echo c > c |
|
638 | $ echo c > c | |
631 | $ hg commit -A -m test |
|
639 | $ hg commit -A -m test | |
632 | adding c |
|
640 | adding c | |
633 | $ chmod -rx .hg/store/data |
|
641 | $ chmod -rx .hg/store/data | |
634 | $ cd .. |
|
642 | $ cd .. | |
635 | $ mkdir d |
|
643 | $ mkdir d | |
636 | $ hg clone c d 2> err |
|
644 | $ hg clone c d 2> err | |
637 | [255] |
|
645 | [255] | |
638 | $ test -d d |
|
646 | $ test -d d | |
639 | $ test -d d/.hg |
|
647 | $ test -d d/.hg | |
640 | [1] |
|
648 | [1] | |
641 |
|
649 | |||
642 | re-enable perm to allow deletion |
|
650 | re-enable perm to allow deletion | |
643 |
|
651 | |||
644 | $ chmod +rx c/.hg/store/data |
|
652 | $ chmod +rx c/.hg/store/data | |
645 |
|
653 | |||
646 | #endif |
|
654 | #endif | |
647 |
|
655 | |||
648 | $ cd .. |
|
656 | $ cd .. | |
649 |
|
657 | |||
650 | Test clone from the repository in (emulated) revlog format 0 (issue4203): |
|
658 | Test clone from the repository in (emulated) revlog format 0 (issue4203): | |
651 |
|
659 | |||
652 | $ mkdir issue4203 |
|
660 | $ mkdir issue4203 | |
653 | $ mkdir -p src/.hg |
|
661 | $ mkdir -p src/.hg | |
654 | $ echo foo > src/foo |
|
662 | $ echo foo > src/foo | |
655 | $ hg -R src add src/foo |
|
663 | $ hg -R src add src/foo | |
656 | $ hg -R src commit -m '#0' |
|
664 | $ hg -R src commit -m '#0' | |
657 | $ hg -R src log -q |
|
665 | $ hg -R src log -q | |
658 | 0:e1bab28bca43 |
|
666 | 0:e1bab28bca43 | |
659 | $ hg clone -U -q src dst |
|
667 | $ hg clone -U -q src dst | |
660 | $ hg -R dst log -q |
|
668 | $ hg -R dst log -q | |
661 | 0:e1bab28bca43 |
|
669 | 0:e1bab28bca43 | |
662 | $ cd .. |
|
670 | $ cd .. |
@@ -1,367 +1,374 b'' | |||||
1 | #require hardlink |
|
1 | #require hardlink | |
2 |
|
2 | |||
3 | $ cat > nlinks.py <<EOF |
|
3 | $ cat > nlinks.py <<EOF | |
4 | > import sys |
|
4 | > import sys | |
5 | > from mercurial import util |
|
5 | > from mercurial import util | |
6 | > for f in sorted(sys.stdin.readlines()): |
|
6 | > for f in sorted(sys.stdin.readlines()): | |
7 | > f = f[:-1] |
|
7 | > f = f[:-1] | |
8 | > print util.nlinks(f), f |
|
8 | > print util.nlinks(f), f | |
9 | > EOF |
|
9 | > EOF | |
10 |
|
10 | |||
11 | $ nlinksdir() |
|
11 | $ nlinksdir() | |
12 | > { |
|
12 | > { | |
13 | > find $1 -type f | python $TESTTMP/nlinks.py |
|
13 | > find $1 -type f | python $TESTTMP/nlinks.py | |
14 | > } |
|
14 | > } | |
15 |
|
15 | |||
16 | Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): |
|
16 | Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): | |
17 |
|
17 | |||
18 | $ cat > linkcp.py <<EOF |
|
18 | $ cat > linkcp.py <<EOF | |
19 | > from mercurial import util |
|
19 | > from mercurial import util | |
20 | > import sys |
|
20 | > import sys | |
21 | > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) |
|
21 | > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) | |
22 | > EOF |
|
22 | > EOF | |
23 |
|
23 | |||
24 | $ linkcp() |
|
24 | $ linkcp() | |
25 | > { |
|
25 | > { | |
26 | > python $TESTTMP/linkcp.py $1 $2 |
|
26 | > python $TESTTMP/linkcp.py $1 $2 | |
27 | > } |
|
27 | > } | |
28 |
|
28 | |||
29 | Prepare repo r1: |
|
29 | Prepare repo r1: | |
30 |
|
30 | |||
31 | $ hg init r1 |
|
31 | $ hg init r1 | |
32 | $ cd r1 |
|
32 | $ cd r1 | |
33 |
|
33 | |||
34 | $ echo c1 > f1 |
|
34 | $ echo c1 > f1 | |
35 | $ hg add f1 |
|
35 | $ hg add f1 | |
36 | $ hg ci -m0 |
|
36 | $ hg ci -m0 | |
37 |
|
37 | |||
38 | $ mkdir d1 |
|
38 | $ mkdir d1 | |
39 | $ cd d1 |
|
39 | $ cd d1 | |
40 | $ echo c2 > f2 |
|
40 | $ echo c2 > f2 | |
41 | $ hg add f2 |
|
41 | $ hg add f2 | |
42 | $ hg ci -m1 |
|
42 | $ hg ci -m1 | |
43 | $ cd ../.. |
|
43 | $ cd ../.. | |
44 |
|
44 | |||
45 | $ nlinksdir r1/.hg/store |
|
45 | $ nlinksdir r1/.hg/store | |
46 | 1 r1/.hg/store/00changelog.i |
|
46 | 1 r1/.hg/store/00changelog.i | |
47 | 1 r1/.hg/store/00manifest.i |
|
47 | 1 r1/.hg/store/00manifest.i | |
48 | 1 r1/.hg/store/data/d1/f2.i |
|
48 | 1 r1/.hg/store/data/d1/f2.i | |
49 | 1 r1/.hg/store/data/f1.i |
|
49 | 1 r1/.hg/store/data/f1.i | |
50 | 1 r1/.hg/store/fncache |
|
50 | 1 r1/.hg/store/fncache | |
51 | 1 r1/.hg/store/phaseroots |
|
51 | 1 r1/.hg/store/phaseroots | |
52 | 1 r1/.hg/store/undo |
|
52 | 1 r1/.hg/store/undo | |
53 | 1 r1/.hg/store/undo.backup.fncache |
|
53 | 1 r1/.hg/store/undo.backup.fncache | |
54 | 1 r1/.hg/store/undo.backupfiles |
|
54 | 1 r1/.hg/store/undo.backupfiles | |
55 | 1 r1/.hg/store/undo.phaseroots |
|
55 | 1 r1/.hg/store/undo.phaseroots | |
56 |
|
56 | |||
57 |
|
57 | |||
58 | Create hardlinked clone r2: |
|
58 | Create hardlinked clone r2: | |
59 |
|
59 | |||
60 | $ hg clone -U --debug r1 r2 |
|
60 | $ hg clone -U --debug r1 r2 | |
|
61 | linking: 1 | |||
|
62 | linking: 2 | |||
|
63 | linking: 3 | |||
|
64 | linking: 4 | |||
|
65 | linking: 5 | |||
|
66 | linking: 6 | |||
|
67 | linking: 7 | |||
61 | linked 7 files |
|
68 | linked 7 files | |
62 |
|
69 | |||
63 | Create non-hardlinked clone r3: |
|
70 | Create non-hardlinked clone r3: | |
64 |
|
71 | |||
65 | $ hg clone --pull r1 r3 |
|
72 | $ hg clone --pull r1 r3 | |
66 | requesting all changes |
|
73 | requesting all changes | |
67 | adding changesets |
|
74 | adding changesets | |
68 | adding manifests |
|
75 | adding manifests | |
69 | adding file changes |
|
76 | adding file changes | |
70 | added 2 changesets with 2 changes to 2 files |
|
77 | added 2 changesets with 2 changes to 2 files | |
71 | updating to branch default |
|
78 | updating to branch default | |
72 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
79 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
73 |
|
80 | |||
74 |
|
81 | |||
75 | Repos r1 and r2 should now contain hardlinked files: |
|
82 | Repos r1 and r2 should now contain hardlinked files: | |
76 |
|
83 | |||
77 | $ nlinksdir r1/.hg/store |
|
84 | $ nlinksdir r1/.hg/store | |
78 | 2 r1/.hg/store/00changelog.i |
|
85 | 2 r1/.hg/store/00changelog.i | |
79 | 2 r1/.hg/store/00manifest.i |
|
86 | 2 r1/.hg/store/00manifest.i | |
80 | 2 r1/.hg/store/data/d1/f2.i |
|
87 | 2 r1/.hg/store/data/d1/f2.i | |
81 | 2 r1/.hg/store/data/f1.i |
|
88 | 2 r1/.hg/store/data/f1.i | |
82 | 2 r1/.hg/store/fncache |
|
89 | 2 r1/.hg/store/fncache | |
83 | 1 r1/.hg/store/phaseroots |
|
90 | 1 r1/.hg/store/phaseroots | |
84 | 1 r1/.hg/store/undo |
|
91 | 1 r1/.hg/store/undo | |
85 | 1 r1/.hg/store/undo.backup.fncache |
|
92 | 1 r1/.hg/store/undo.backup.fncache | |
86 | 1 r1/.hg/store/undo.backupfiles |
|
93 | 1 r1/.hg/store/undo.backupfiles | |
87 | 1 r1/.hg/store/undo.phaseroots |
|
94 | 1 r1/.hg/store/undo.phaseroots | |
88 |
|
95 | |||
89 | $ nlinksdir r2/.hg/store |
|
96 | $ nlinksdir r2/.hg/store | |
90 | 2 r2/.hg/store/00changelog.i |
|
97 | 2 r2/.hg/store/00changelog.i | |
91 | 2 r2/.hg/store/00manifest.i |
|
98 | 2 r2/.hg/store/00manifest.i | |
92 | 2 r2/.hg/store/data/d1/f2.i |
|
99 | 2 r2/.hg/store/data/d1/f2.i | |
93 | 2 r2/.hg/store/data/f1.i |
|
100 | 2 r2/.hg/store/data/f1.i | |
94 | 2 r2/.hg/store/fncache |
|
101 | 2 r2/.hg/store/fncache | |
95 |
|
102 | |||
96 | Repo r3 should not be hardlinked: |
|
103 | Repo r3 should not be hardlinked: | |
97 |
|
104 | |||
98 | $ nlinksdir r3/.hg/store |
|
105 | $ nlinksdir r3/.hg/store | |
99 | 1 r3/.hg/store/00changelog.i |
|
106 | 1 r3/.hg/store/00changelog.i | |
100 | 1 r3/.hg/store/00manifest.i |
|
107 | 1 r3/.hg/store/00manifest.i | |
101 | 1 r3/.hg/store/data/d1/f2.i |
|
108 | 1 r3/.hg/store/data/d1/f2.i | |
102 | 1 r3/.hg/store/data/f1.i |
|
109 | 1 r3/.hg/store/data/f1.i | |
103 | 1 r3/.hg/store/fncache |
|
110 | 1 r3/.hg/store/fncache | |
104 | 1 r3/.hg/store/phaseroots |
|
111 | 1 r3/.hg/store/phaseroots | |
105 | 1 r3/.hg/store/undo |
|
112 | 1 r3/.hg/store/undo | |
106 | 1 r3/.hg/store/undo.backupfiles |
|
113 | 1 r3/.hg/store/undo.backupfiles | |
107 | 1 r3/.hg/store/undo.phaseroots |
|
114 | 1 r3/.hg/store/undo.phaseroots | |
108 |
|
115 | |||
109 |
|
116 | |||
110 | Create a non-inlined filelog in r3: |
|
117 | Create a non-inlined filelog in r3: | |
111 |
|
118 | |||
112 | $ cd r3/d1 |
|
119 | $ cd r3/d1 | |
113 | >>> f = open('data1', 'wb') |
|
120 | >>> f = open('data1', 'wb') | |
114 | >>> for x in range(10000): |
|
121 | >>> for x in range(10000): | |
115 | ... f.write("%s\n" % str(x)) |
|
122 | ... f.write("%s\n" % str(x)) | |
116 | >>> f.close() |
|
123 | >>> f.close() | |
117 | $ for j in 0 1 2 3 4 5 6 7 8 9; do |
|
124 | $ for j in 0 1 2 3 4 5 6 7 8 9; do | |
118 | > cat data1 >> f2 |
|
125 | > cat data1 >> f2 | |
119 | > hg commit -m$j |
|
126 | > hg commit -m$j | |
120 | > done |
|
127 | > done | |
121 | $ cd ../.. |
|
128 | $ cd ../.. | |
122 |
|
129 | |||
123 | $ nlinksdir r3/.hg/store |
|
130 | $ nlinksdir r3/.hg/store | |
124 | 1 r3/.hg/store/00changelog.i |
|
131 | 1 r3/.hg/store/00changelog.i | |
125 | 1 r3/.hg/store/00manifest.i |
|
132 | 1 r3/.hg/store/00manifest.i | |
126 | 1 r3/.hg/store/data/d1/f2.d |
|
133 | 1 r3/.hg/store/data/d1/f2.d | |
127 | 1 r3/.hg/store/data/d1/f2.i |
|
134 | 1 r3/.hg/store/data/d1/f2.i | |
128 | 1 r3/.hg/store/data/f1.i |
|
135 | 1 r3/.hg/store/data/f1.i | |
129 | 1 r3/.hg/store/fncache |
|
136 | 1 r3/.hg/store/fncache | |
130 | 1 r3/.hg/store/phaseroots |
|
137 | 1 r3/.hg/store/phaseroots | |
131 | 1 r3/.hg/store/undo |
|
138 | 1 r3/.hg/store/undo | |
132 | 1 r3/.hg/store/undo.backup.fncache |
|
139 | 1 r3/.hg/store/undo.backup.fncache | |
133 | 1 r3/.hg/store/undo.backup.phaseroots |
|
140 | 1 r3/.hg/store/undo.backup.phaseroots | |
134 | 1 r3/.hg/store/undo.backupfiles |
|
141 | 1 r3/.hg/store/undo.backupfiles | |
135 | 1 r3/.hg/store/undo.phaseroots |
|
142 | 1 r3/.hg/store/undo.phaseroots | |
136 |
|
143 | |||
137 | Push to repo r1 should break up most hardlinks in r2: |
|
144 | Push to repo r1 should break up most hardlinks in r2: | |
138 |
|
145 | |||
139 | $ hg -R r2 verify |
|
146 | $ hg -R r2 verify | |
140 | checking changesets |
|
147 | checking changesets | |
141 | checking manifests |
|
148 | checking manifests | |
142 | crosschecking files in changesets and manifests |
|
149 | crosschecking files in changesets and manifests | |
143 | checking files |
|
150 | checking files | |
144 | 2 files, 2 changesets, 2 total revisions |
|
151 | 2 files, 2 changesets, 2 total revisions | |
145 |
|
152 | |||
146 | $ cd r3 |
|
153 | $ cd r3 | |
147 | $ hg push |
|
154 | $ hg push | |
148 | pushing to $TESTTMP/r1 (glob) |
|
155 | pushing to $TESTTMP/r1 (glob) | |
149 | searching for changes |
|
156 | searching for changes | |
150 | adding changesets |
|
157 | adding changesets | |
151 | adding manifests |
|
158 | adding manifests | |
152 | adding file changes |
|
159 | adding file changes | |
153 | added 10 changesets with 10 changes to 1 files |
|
160 | added 10 changesets with 10 changes to 1 files | |
154 |
|
161 | |||
155 | $ cd .. |
|
162 | $ cd .. | |
156 |
|
163 | |||
157 | $ nlinksdir r2/.hg/store |
|
164 | $ nlinksdir r2/.hg/store | |
158 | 1 r2/.hg/store/00changelog.i |
|
165 | 1 r2/.hg/store/00changelog.i | |
159 | 1 r2/.hg/store/00manifest.i |
|
166 | 1 r2/.hg/store/00manifest.i | |
160 | 1 r2/.hg/store/data/d1/f2.i |
|
167 | 1 r2/.hg/store/data/d1/f2.i | |
161 | 2 r2/.hg/store/data/f1.i |
|
168 | 2 r2/.hg/store/data/f1.i | |
162 | 1 r2/.hg/store/fncache |
|
169 | 1 r2/.hg/store/fncache | |
163 |
|
170 | |||
164 | $ hg -R r2 verify |
|
171 | $ hg -R r2 verify | |
165 | checking changesets |
|
172 | checking changesets | |
166 | checking manifests |
|
173 | checking manifests | |
167 | crosschecking files in changesets and manifests |
|
174 | crosschecking files in changesets and manifests | |
168 | checking files |
|
175 | checking files | |
169 | 2 files, 2 changesets, 2 total revisions |
|
176 | 2 files, 2 changesets, 2 total revisions | |
170 |
|
177 | |||
171 |
|
178 | |||
172 | $ cd r1 |
|
179 | $ cd r1 | |
173 | $ hg up |
|
180 | $ hg up | |
174 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
181 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
175 |
|
182 | |||
176 | Committing a change to f1 in r1 must break up hardlink f1.i in r2: |
|
183 | Committing a change to f1 in r1 must break up hardlink f1.i in r2: | |
177 |
|
184 | |||
178 | $ echo c1c1 >> f1 |
|
185 | $ echo c1c1 >> f1 | |
179 | $ hg ci -m00 |
|
186 | $ hg ci -m00 | |
180 | $ cd .. |
|
187 | $ cd .. | |
181 |
|
188 | |||
182 | $ nlinksdir r2/.hg/store |
|
189 | $ nlinksdir r2/.hg/store | |
183 | 1 r2/.hg/store/00changelog.i |
|
190 | 1 r2/.hg/store/00changelog.i | |
184 | 1 r2/.hg/store/00manifest.i |
|
191 | 1 r2/.hg/store/00manifest.i | |
185 | 1 r2/.hg/store/data/d1/f2.i |
|
192 | 1 r2/.hg/store/data/d1/f2.i | |
186 | 1 r2/.hg/store/data/f1.i |
|
193 | 1 r2/.hg/store/data/f1.i | |
187 | 1 r2/.hg/store/fncache |
|
194 | 1 r2/.hg/store/fncache | |
188 |
|
195 | |||
189 |
|
196 | |||
190 | $ cd r3 |
|
197 | $ cd r3 | |
191 | $ hg tip --template '{rev}:{node|short}\n' |
|
198 | $ hg tip --template '{rev}:{node|short}\n' | |
192 | 11:a6451b6bc41f |
|
199 | 11:a6451b6bc41f | |
193 | $ echo bla > f1 |
|
200 | $ echo bla > f1 | |
194 | $ hg ci -m1 |
|
201 | $ hg ci -m1 | |
195 | $ cd .. |
|
202 | $ cd .. | |
196 |
|
203 | |||
197 | Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'): |
|
204 | Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'): | |
198 |
|
205 | |||
199 | $ linkcp r3 r4 |
|
206 | $ linkcp r3 r4 | |
200 |
|
207 | |||
201 | r4 has hardlinks in the working dir (not just inside .hg): |
|
208 | r4 has hardlinks in the working dir (not just inside .hg): | |
202 |
|
209 | |||
203 | $ nlinksdir r4 |
|
210 | $ nlinksdir r4 | |
204 | 2 r4/.hg/00changelog.i |
|
211 | 2 r4/.hg/00changelog.i | |
205 | 2 r4/.hg/branch |
|
212 | 2 r4/.hg/branch | |
206 | 2 r4/.hg/cache/branch2-served |
|
213 | 2 r4/.hg/cache/branch2-served | |
207 | 2 r4/.hg/cache/rbc-names-v1 |
|
214 | 2 r4/.hg/cache/rbc-names-v1 | |
208 | 2 r4/.hg/cache/rbc-revs-v1 |
|
215 | 2 r4/.hg/cache/rbc-revs-v1 | |
209 | 2 r4/.hg/dirstate |
|
216 | 2 r4/.hg/dirstate | |
210 | 2 r4/.hg/hgrc |
|
217 | 2 r4/.hg/hgrc | |
211 | 2 r4/.hg/last-message.txt |
|
218 | 2 r4/.hg/last-message.txt | |
212 | 2 r4/.hg/requires |
|
219 | 2 r4/.hg/requires | |
213 | 2 r4/.hg/store/00changelog.i |
|
220 | 2 r4/.hg/store/00changelog.i | |
214 | 2 r4/.hg/store/00manifest.i |
|
221 | 2 r4/.hg/store/00manifest.i | |
215 | 2 r4/.hg/store/data/d1/f2.d |
|
222 | 2 r4/.hg/store/data/d1/f2.d | |
216 | 2 r4/.hg/store/data/d1/f2.i |
|
223 | 2 r4/.hg/store/data/d1/f2.i | |
217 | 2 r4/.hg/store/data/f1.i |
|
224 | 2 r4/.hg/store/data/f1.i | |
218 | 2 r4/.hg/store/fncache |
|
225 | 2 r4/.hg/store/fncache | |
219 | 2 r4/.hg/store/phaseroots |
|
226 | 2 r4/.hg/store/phaseroots | |
220 | 2 r4/.hg/store/undo |
|
227 | 2 r4/.hg/store/undo | |
221 | 2 r4/.hg/store/undo.backup.fncache |
|
228 | 2 r4/.hg/store/undo.backup.fncache | |
222 | 2 r4/.hg/store/undo.backup.phaseroots |
|
229 | 2 r4/.hg/store/undo.backup.phaseroots | |
223 | 2 r4/.hg/store/undo.backupfiles |
|
230 | 2 r4/.hg/store/undo.backupfiles | |
224 | 2 r4/.hg/store/undo.phaseroots |
|
231 | 2 r4/.hg/store/undo.phaseroots | |
225 | 2 r4/.hg/undo.bookmarks |
|
232 | 2 r4/.hg/undo.bookmarks | |
226 | 2 r4/.hg/undo.branch |
|
233 | 2 r4/.hg/undo.branch | |
227 | 2 r4/.hg/undo.desc |
|
234 | 2 r4/.hg/undo.desc | |
228 | 2 r4/.hg/undo.dirstate |
|
235 | 2 r4/.hg/undo.dirstate | |
229 | 2 r4/d1/data1 |
|
236 | 2 r4/d1/data1 | |
230 | 2 r4/d1/f2 |
|
237 | 2 r4/d1/f2 | |
231 | 2 r4/f1 |
|
238 | 2 r4/f1 | |
232 |
|
239 | |||
233 | Update back to revision 11 in r4 should break hardlink of file f1: |
|
240 | Update back to revision 11 in r4 should break hardlink of file f1: | |
234 |
|
241 | |||
235 | $ hg -R r4 up 11 |
|
242 | $ hg -R r4 up 11 | |
236 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
243 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
237 |
|
244 | |||
238 | $ nlinksdir r4 |
|
245 | $ nlinksdir r4 | |
239 | 2 r4/.hg/00changelog.i |
|
246 | 2 r4/.hg/00changelog.i | |
240 | 1 r4/.hg/branch |
|
247 | 1 r4/.hg/branch | |
241 | 2 r4/.hg/cache/branch2-served |
|
248 | 2 r4/.hg/cache/branch2-served | |
242 | 2 r4/.hg/cache/rbc-names-v1 |
|
249 | 2 r4/.hg/cache/rbc-names-v1 | |
243 | 2 r4/.hg/cache/rbc-revs-v1 |
|
250 | 2 r4/.hg/cache/rbc-revs-v1 | |
244 | 1 r4/.hg/dirstate |
|
251 | 1 r4/.hg/dirstate | |
245 | 2 r4/.hg/hgrc |
|
252 | 2 r4/.hg/hgrc | |
246 | 2 r4/.hg/last-message.txt |
|
253 | 2 r4/.hg/last-message.txt | |
247 | 2 r4/.hg/requires |
|
254 | 2 r4/.hg/requires | |
248 | 2 r4/.hg/store/00changelog.i |
|
255 | 2 r4/.hg/store/00changelog.i | |
249 | 2 r4/.hg/store/00manifest.i |
|
256 | 2 r4/.hg/store/00manifest.i | |
250 | 2 r4/.hg/store/data/d1/f2.d |
|
257 | 2 r4/.hg/store/data/d1/f2.d | |
251 | 2 r4/.hg/store/data/d1/f2.i |
|
258 | 2 r4/.hg/store/data/d1/f2.i | |
252 | 2 r4/.hg/store/data/f1.i |
|
259 | 2 r4/.hg/store/data/f1.i | |
253 | 2 r4/.hg/store/fncache |
|
260 | 2 r4/.hg/store/fncache | |
254 | 2 r4/.hg/store/phaseroots |
|
261 | 2 r4/.hg/store/phaseroots | |
255 | 2 r4/.hg/store/undo |
|
262 | 2 r4/.hg/store/undo | |
256 | 2 r4/.hg/store/undo.backup.fncache |
|
263 | 2 r4/.hg/store/undo.backup.fncache | |
257 | 2 r4/.hg/store/undo.backup.phaseroots |
|
264 | 2 r4/.hg/store/undo.backup.phaseroots | |
258 | 2 r4/.hg/store/undo.backupfiles |
|
265 | 2 r4/.hg/store/undo.backupfiles | |
259 | 2 r4/.hg/store/undo.phaseroots |
|
266 | 2 r4/.hg/store/undo.phaseroots | |
260 | 2 r4/.hg/undo.bookmarks |
|
267 | 2 r4/.hg/undo.bookmarks | |
261 | 2 r4/.hg/undo.branch |
|
268 | 2 r4/.hg/undo.branch | |
262 | 2 r4/.hg/undo.desc |
|
269 | 2 r4/.hg/undo.desc | |
263 | 2 r4/.hg/undo.dirstate |
|
270 | 2 r4/.hg/undo.dirstate | |
264 | 2 r4/d1/data1 |
|
271 | 2 r4/d1/data1 | |
265 | 2 r4/d1/f2 |
|
272 | 2 r4/d1/f2 | |
266 | 1 r4/f1 |
|
273 | 1 r4/f1 | |
267 |
|
274 | |||
268 |
|
275 | |||
269 | Test hardlinking outside hg: |
|
276 | Test hardlinking outside hg: | |
270 |
|
277 | |||
271 | $ mkdir x |
|
278 | $ mkdir x | |
272 | $ echo foo > x/a |
|
279 | $ echo foo > x/a | |
273 |
|
280 | |||
274 | $ linkcp x y |
|
281 | $ linkcp x y | |
275 | $ echo bar >> y/a |
|
282 | $ echo bar >> y/a | |
276 |
|
283 | |||
277 | No diff if hardlink: |
|
284 | No diff if hardlink: | |
278 |
|
285 | |||
279 | $ diff x/a y/a |
|
286 | $ diff x/a y/a | |
280 |
|
287 | |||
281 | Test mq hardlinking: |
|
288 | Test mq hardlinking: | |
282 |
|
289 | |||
283 | $ echo "[extensions]" >> $HGRCPATH |
|
290 | $ echo "[extensions]" >> $HGRCPATH | |
284 | $ echo "mq=" >> $HGRCPATH |
|
291 | $ echo "mq=" >> $HGRCPATH | |
285 |
|
292 | |||
286 | $ hg init a |
|
293 | $ hg init a | |
287 | $ cd a |
|
294 | $ cd a | |
288 |
|
295 | |||
289 | $ hg qimport -n foo - << EOF |
|
296 | $ hg qimport -n foo - << EOF | |
290 | > # HG changeset patch |
|
297 | > # HG changeset patch | |
291 | > # Date 1 0 |
|
298 | > # Date 1 0 | |
292 | > diff -r 2588a8b53d66 a |
|
299 | > diff -r 2588a8b53d66 a | |
293 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
300 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
294 | > +++ b/a Wed Jul 23 15:54:29 2008 +0200 |
|
301 | > +++ b/a Wed Jul 23 15:54:29 2008 +0200 | |
295 | > @@ -0,0 +1,1 @@ |
|
302 | > @@ -0,0 +1,1 @@ | |
296 | > +a |
|
303 | > +a | |
297 | > EOF |
|
304 | > EOF | |
298 | adding foo to series file |
|
305 | adding foo to series file | |
299 |
|
306 | |||
300 | $ hg qpush |
|
307 | $ hg qpush | |
301 | applying foo |
|
308 | applying foo | |
302 | now at: foo |
|
309 | now at: foo | |
303 |
|
310 | |||
304 | $ cd .. |
|
311 | $ cd .. | |
305 | $ linkcp a b |
|
312 | $ linkcp a b | |
306 | $ cd b |
|
313 | $ cd b | |
307 |
|
314 | |||
308 | $ hg qimport -n bar - << EOF |
|
315 | $ hg qimport -n bar - << EOF | |
309 | > # HG changeset patch |
|
316 | > # HG changeset patch | |
310 | > # Date 2 0 |
|
317 | > # Date 2 0 | |
311 | > diff -r 2588a8b53d66 a |
|
318 | > diff -r 2588a8b53d66 a | |
312 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
319 | > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
313 | > +++ b/b Wed Jul 23 15:54:29 2008 +0200 |
|
320 | > +++ b/b Wed Jul 23 15:54:29 2008 +0200 | |
314 | > @@ -0,0 +1,1 @@ |
|
321 | > @@ -0,0 +1,1 @@ | |
315 | > +b |
|
322 | > +b | |
316 | > EOF |
|
323 | > EOF | |
317 | adding bar to series file |
|
324 | adding bar to series file | |
318 |
|
325 | |||
319 | $ hg qpush |
|
326 | $ hg qpush | |
320 | applying bar |
|
327 | applying bar | |
321 | now at: bar |
|
328 | now at: bar | |
322 |
|
329 | |||
323 | $ cat .hg/patches/status |
|
330 | $ cat .hg/patches/status | |
324 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo |
|
331 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo | |
325 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar |
|
332 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar | |
326 |
|
333 | |||
327 | $ cat .hg/patches/series |
|
334 | $ cat .hg/patches/series | |
328 | foo |
|
335 | foo | |
329 | bar |
|
336 | bar | |
330 |
|
337 | |||
331 | $ cat ../a/.hg/patches/status |
|
338 | $ cat ../a/.hg/patches/status | |
332 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo |
|
339 | 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo | |
333 |
|
340 | |||
334 | $ cat ../a/.hg/patches/series |
|
341 | $ cat ../a/.hg/patches/series | |
335 | foo |
|
342 | foo | |
336 |
|
343 | |||
337 | Test tags hardlinking: |
|
344 | Test tags hardlinking: | |
338 |
|
345 | |||
339 | $ hg qdel -r qbase:qtip |
|
346 | $ hg qdel -r qbase:qtip | |
340 | patch foo finalized without changeset message |
|
347 | patch foo finalized without changeset message | |
341 | patch bar finalized without changeset message |
|
348 | patch bar finalized without changeset message | |
342 |
|
349 | |||
343 | $ hg tag -l lfoo |
|
350 | $ hg tag -l lfoo | |
344 | $ hg tag foo |
|
351 | $ hg tag foo | |
345 |
|
352 | |||
346 | $ cd .. |
|
353 | $ cd .. | |
347 | $ linkcp b c |
|
354 | $ linkcp b c | |
348 | $ cd c |
|
355 | $ cd c | |
349 |
|
356 | |||
350 | $ hg tag -l -r 0 lbar |
|
357 | $ hg tag -l -r 0 lbar | |
351 | $ hg tag -r 0 bar |
|
358 | $ hg tag -r 0 bar | |
352 |
|
359 | |||
353 | $ cat .hgtags |
|
360 | $ cat .hgtags | |
354 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo |
|
361 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo | |
355 | 430ed4828a74fa4047bc816a25500f7472ab4bfe bar |
|
362 | 430ed4828a74fa4047bc816a25500f7472ab4bfe bar | |
356 |
|
363 | |||
357 | $ cat .hg/localtags |
|
364 | $ cat .hg/localtags | |
358 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
|
365 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo | |
359 | 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar |
|
366 | 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar | |
360 |
|
367 | |||
361 | $ cat ../b/.hgtags |
|
368 | $ cat ../b/.hgtags | |
362 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo |
|
369 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo | |
363 |
|
370 | |||
364 | $ cat ../b/.hg/localtags |
|
371 | $ cat ../b/.hg/localtags | |
365 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo |
|
372 | 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo | |
366 |
|
373 | |||
367 | $ cd .. |
|
374 | $ cd .. |
@@ -1,508 +1,536 b'' | |||||
1 | Create test repository: |
|
1 | Create test repository: | |
2 |
|
2 | |||
3 | $ hg init repo |
|
3 | $ hg init repo | |
4 | $ cd repo |
|
4 | $ cd repo | |
5 | $ echo x1 > x.txt |
|
5 | $ echo x1 > x.txt | |
6 |
|
6 | |||
7 | $ hg init foo |
|
7 | $ hg init foo | |
8 | $ cd foo |
|
8 | $ cd foo | |
9 | $ echo y1 > y.txt |
|
9 | $ echo y1 > y.txt | |
10 |
|
10 | |||
11 | $ hg init bar |
|
11 | $ hg init bar | |
12 | $ cd bar |
|
12 | $ cd bar | |
13 | $ echo z1 > z.txt |
|
13 | $ echo z1 > z.txt | |
14 |
|
14 | |||
15 | $ cd .. |
|
15 | $ cd .. | |
16 | $ echo 'bar = bar' > .hgsub |
|
16 | $ echo 'bar = bar' > .hgsub | |
17 |
|
17 | |||
18 | $ cd .. |
|
18 | $ cd .. | |
19 | $ echo 'foo = foo' > .hgsub |
|
19 | $ echo 'foo = foo' > .hgsub | |
20 |
|
20 | |||
21 | Add files --- .hgsub files must go first to trigger subrepos: |
|
21 | Add files --- .hgsub files must go first to trigger subrepos: | |
22 |
|
22 | |||
23 | $ hg add -S .hgsub |
|
23 | $ hg add -S .hgsub | |
24 | $ hg add -S foo/.hgsub |
|
24 | $ hg add -S foo/.hgsub | |
25 | $ hg add -S foo/bar |
|
25 | $ hg add -S foo/bar | |
26 | adding foo/bar/z.txt (glob) |
|
26 | adding foo/bar/z.txt (glob) | |
27 | $ hg add -S |
|
27 | $ hg add -S | |
28 | adding x.txt |
|
28 | adding x.txt | |
29 | adding foo/y.txt (glob) |
|
29 | adding foo/y.txt (glob) | |
30 |
|
30 | |||
31 | Test recursive status without committing anything: |
|
31 | Test recursive status without committing anything: | |
32 |
|
32 | |||
33 | $ hg status -S |
|
33 | $ hg status -S | |
34 | A .hgsub |
|
34 | A .hgsub | |
35 | A foo/.hgsub |
|
35 | A foo/.hgsub | |
36 | A foo/bar/z.txt |
|
36 | A foo/bar/z.txt | |
37 | A foo/y.txt |
|
37 | A foo/y.txt | |
38 | A x.txt |
|
38 | A x.txt | |
39 |
|
39 | |||
40 | Test recursive diff without committing anything: |
|
40 | Test recursive diff without committing anything: | |
41 |
|
41 | |||
42 | $ hg diff --nodates -S foo |
|
42 | $ hg diff --nodates -S foo | |
43 | diff -r 000000000000 foo/.hgsub |
|
43 | diff -r 000000000000 foo/.hgsub | |
44 | --- /dev/null |
|
44 | --- /dev/null | |
45 | +++ b/foo/.hgsub |
|
45 | +++ b/foo/.hgsub | |
46 | @@ -0,0 +1,1 @@ |
|
46 | @@ -0,0 +1,1 @@ | |
47 | +bar = bar |
|
47 | +bar = bar | |
48 | diff -r 000000000000 foo/y.txt |
|
48 | diff -r 000000000000 foo/y.txt | |
49 | --- /dev/null |
|
49 | --- /dev/null | |
50 | +++ b/foo/y.txt |
|
50 | +++ b/foo/y.txt | |
51 | @@ -0,0 +1,1 @@ |
|
51 | @@ -0,0 +1,1 @@ | |
52 | +y1 |
|
52 | +y1 | |
53 | diff -r 000000000000 foo/bar/z.txt |
|
53 | diff -r 000000000000 foo/bar/z.txt | |
54 | --- /dev/null |
|
54 | --- /dev/null | |
55 | +++ b/foo/bar/z.txt |
|
55 | +++ b/foo/bar/z.txt | |
56 | @@ -0,0 +1,1 @@ |
|
56 | @@ -0,0 +1,1 @@ | |
57 | +z1 |
|
57 | +z1 | |
58 |
|
58 | |||
59 | Commits: |
|
59 | Commits: | |
60 |
|
60 | |||
61 | $ hg commit -m fails |
|
61 | $ hg commit -m fails | |
62 | abort: uncommitted changes in subrepo foo |
|
62 | abort: uncommitted changes in subrepo foo | |
63 | (use --subrepos for recursive commit) |
|
63 | (use --subrepos for recursive commit) | |
64 | [255] |
|
64 | [255] | |
65 |
|
65 | |||
66 | The --subrepos flag overwrite the config setting: |
|
66 | The --subrepos flag overwrite the config setting: | |
67 |
|
67 | |||
68 | $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos |
|
68 | $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos | |
69 | committing subrepository foo |
|
69 | committing subrepository foo | |
70 | committing subrepository foo/bar (glob) |
|
70 | committing subrepository foo/bar (glob) | |
71 |
|
71 | |||
72 | $ cd foo |
|
72 | $ cd foo | |
73 | $ echo y2 >> y.txt |
|
73 | $ echo y2 >> y.txt | |
74 | $ hg commit -m 0-1-0 |
|
74 | $ hg commit -m 0-1-0 | |
75 |
|
75 | |||
76 | $ cd bar |
|
76 | $ cd bar | |
77 | $ echo z2 >> z.txt |
|
77 | $ echo z2 >> z.txt | |
78 | $ hg commit -m 0-1-1 |
|
78 | $ hg commit -m 0-1-1 | |
79 |
|
79 | |||
80 | $ cd .. |
|
80 | $ cd .. | |
81 | $ hg commit -m 0-2-1 |
|
81 | $ hg commit -m 0-2-1 | |
82 |
|
82 | |||
83 | $ cd .. |
|
83 | $ cd .. | |
84 | $ hg commit -m 1-2-1 |
|
84 | $ hg commit -m 1-2-1 | |
85 |
|
85 | |||
86 | Change working directory: |
|
86 | Change working directory: | |
87 |
|
87 | |||
88 | $ echo y3 >> foo/y.txt |
|
88 | $ echo y3 >> foo/y.txt | |
89 | $ echo z3 >> foo/bar/z.txt |
|
89 | $ echo z3 >> foo/bar/z.txt | |
90 | $ hg status -S |
|
90 | $ hg status -S | |
91 | M foo/bar/z.txt |
|
91 | M foo/bar/z.txt | |
92 | M foo/y.txt |
|
92 | M foo/y.txt | |
93 | $ hg diff --nodates -S |
|
93 | $ hg diff --nodates -S | |
94 | diff -r d254738c5f5e foo/y.txt |
|
94 | diff -r d254738c5f5e foo/y.txt | |
95 | --- a/foo/y.txt |
|
95 | --- a/foo/y.txt | |
96 | +++ b/foo/y.txt |
|
96 | +++ b/foo/y.txt | |
97 | @@ -1,2 +1,3 @@ |
|
97 | @@ -1,2 +1,3 @@ | |
98 | y1 |
|
98 | y1 | |
99 | y2 |
|
99 | y2 | |
100 | +y3 |
|
100 | +y3 | |
101 | diff -r 9647f22de499 foo/bar/z.txt |
|
101 | diff -r 9647f22de499 foo/bar/z.txt | |
102 | --- a/foo/bar/z.txt |
|
102 | --- a/foo/bar/z.txt | |
103 | +++ b/foo/bar/z.txt |
|
103 | +++ b/foo/bar/z.txt | |
104 | @@ -1,2 +1,3 @@ |
|
104 | @@ -1,2 +1,3 @@ | |
105 | z1 |
|
105 | z1 | |
106 | z2 |
|
106 | z2 | |
107 | +z3 |
|
107 | +z3 | |
108 |
|
108 | |||
109 | Status call crossing repository boundaries: |
|
109 | Status call crossing repository boundaries: | |
110 |
|
110 | |||
111 | $ hg status -S foo/bar/z.txt |
|
111 | $ hg status -S foo/bar/z.txt | |
112 | M foo/bar/z.txt |
|
112 | M foo/bar/z.txt | |
113 | $ hg status -S -I 'foo/?.txt' |
|
113 | $ hg status -S -I 'foo/?.txt' | |
114 | M foo/y.txt |
|
114 | M foo/y.txt | |
115 | $ hg status -S -I '**/?.txt' |
|
115 | $ hg status -S -I '**/?.txt' | |
116 | M foo/bar/z.txt |
|
116 | M foo/bar/z.txt | |
117 | M foo/y.txt |
|
117 | M foo/y.txt | |
118 | $ hg diff --nodates -S -I '**/?.txt' |
|
118 | $ hg diff --nodates -S -I '**/?.txt' | |
119 | diff -r d254738c5f5e foo/y.txt |
|
119 | diff -r d254738c5f5e foo/y.txt | |
120 | --- a/foo/y.txt |
|
120 | --- a/foo/y.txt | |
121 | +++ b/foo/y.txt |
|
121 | +++ b/foo/y.txt | |
122 | @@ -1,2 +1,3 @@ |
|
122 | @@ -1,2 +1,3 @@ | |
123 | y1 |
|
123 | y1 | |
124 | y2 |
|
124 | y2 | |
125 | +y3 |
|
125 | +y3 | |
126 | diff -r 9647f22de499 foo/bar/z.txt |
|
126 | diff -r 9647f22de499 foo/bar/z.txt | |
127 | --- a/foo/bar/z.txt |
|
127 | --- a/foo/bar/z.txt | |
128 | +++ b/foo/bar/z.txt |
|
128 | +++ b/foo/bar/z.txt | |
129 | @@ -1,2 +1,3 @@ |
|
129 | @@ -1,2 +1,3 @@ | |
130 | z1 |
|
130 | z1 | |
131 | z2 |
|
131 | z2 | |
132 | +z3 |
|
132 | +z3 | |
133 |
|
133 | |||
134 | Status from within a subdirectory: |
|
134 | Status from within a subdirectory: | |
135 |
|
135 | |||
136 | $ mkdir dir |
|
136 | $ mkdir dir | |
137 | $ cd dir |
|
137 | $ cd dir | |
138 | $ echo a1 > a.txt |
|
138 | $ echo a1 > a.txt | |
139 | $ hg status -S |
|
139 | $ hg status -S | |
140 | M foo/bar/z.txt |
|
140 | M foo/bar/z.txt | |
141 | M foo/y.txt |
|
141 | M foo/y.txt | |
142 | ? dir/a.txt |
|
142 | ? dir/a.txt | |
143 | $ hg diff --nodates -S |
|
143 | $ hg diff --nodates -S | |
144 | diff -r d254738c5f5e foo/y.txt |
|
144 | diff -r d254738c5f5e foo/y.txt | |
145 | --- a/foo/y.txt |
|
145 | --- a/foo/y.txt | |
146 | +++ b/foo/y.txt |
|
146 | +++ b/foo/y.txt | |
147 | @@ -1,2 +1,3 @@ |
|
147 | @@ -1,2 +1,3 @@ | |
148 | y1 |
|
148 | y1 | |
149 | y2 |
|
149 | y2 | |
150 | +y3 |
|
150 | +y3 | |
151 | diff -r 9647f22de499 foo/bar/z.txt |
|
151 | diff -r 9647f22de499 foo/bar/z.txt | |
152 | --- a/foo/bar/z.txt |
|
152 | --- a/foo/bar/z.txt | |
153 | +++ b/foo/bar/z.txt |
|
153 | +++ b/foo/bar/z.txt | |
154 | @@ -1,2 +1,3 @@ |
|
154 | @@ -1,2 +1,3 @@ | |
155 | z1 |
|
155 | z1 | |
156 | z2 |
|
156 | z2 | |
157 | +z3 |
|
157 | +z3 | |
158 |
|
158 | |||
159 | Status with relative path: |
|
159 | Status with relative path: | |
160 |
|
160 | |||
161 | $ hg status -S .. |
|
161 | $ hg status -S .. | |
162 | M ../foo/bar/z.txt |
|
162 | M ../foo/bar/z.txt | |
163 | M ../foo/y.txt |
|
163 | M ../foo/y.txt | |
164 | ? a.txt |
|
164 | ? a.txt | |
165 |
|
165 | |||
166 | XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as |
|
166 | XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as | |
167 | added instead of modified. |
|
167 | added instead of modified. | |
168 | $ hg status -S .. --config extensions.largefiles= |
|
168 | $ hg status -S .. --config extensions.largefiles= | |
169 | M ../foo/bar/z.txt |
|
169 | M ../foo/bar/z.txt | |
170 | M ../foo/y.txt |
|
170 | M ../foo/y.txt | |
171 | ? a.txt |
|
171 | ? a.txt | |
172 |
|
172 | |||
173 | $ hg diff --nodates -S .. |
|
173 | $ hg diff --nodates -S .. | |
174 | diff -r d254738c5f5e foo/y.txt |
|
174 | diff -r d254738c5f5e foo/y.txt | |
175 | --- a/foo/y.txt |
|
175 | --- a/foo/y.txt | |
176 | +++ b/foo/y.txt |
|
176 | +++ b/foo/y.txt | |
177 | @@ -1,2 +1,3 @@ |
|
177 | @@ -1,2 +1,3 @@ | |
178 | y1 |
|
178 | y1 | |
179 | y2 |
|
179 | y2 | |
180 | +y3 |
|
180 | +y3 | |
181 | diff -r 9647f22de499 foo/bar/z.txt |
|
181 | diff -r 9647f22de499 foo/bar/z.txt | |
182 | --- a/foo/bar/z.txt |
|
182 | --- a/foo/bar/z.txt | |
183 | +++ b/foo/bar/z.txt |
|
183 | +++ b/foo/bar/z.txt | |
184 | @@ -1,2 +1,3 @@ |
|
184 | @@ -1,2 +1,3 @@ | |
185 | z1 |
|
185 | z1 | |
186 | z2 |
|
186 | z2 | |
187 | +z3 |
|
187 | +z3 | |
188 | $ cd .. |
|
188 | $ cd .. | |
189 |
|
189 | |||
190 | Cleanup and final commit: |
|
190 | Cleanup and final commit: | |
191 |
|
191 | |||
192 | $ rm -r dir |
|
192 | $ rm -r dir | |
193 | $ hg commit --subrepos -m 2-3-2 |
|
193 | $ hg commit --subrepos -m 2-3-2 | |
194 | committing subrepository foo |
|
194 | committing subrepository foo | |
195 | committing subrepository foo/bar (glob) |
|
195 | committing subrepository foo/bar (glob) | |
196 |
|
196 | |||
197 | Test explicit path commands within subrepos: add/forget |
|
197 | Test explicit path commands within subrepos: add/forget | |
198 | $ echo z1 > foo/bar/z2.txt |
|
198 | $ echo z1 > foo/bar/z2.txt | |
199 | $ hg status -S |
|
199 | $ hg status -S | |
200 | ? foo/bar/z2.txt |
|
200 | ? foo/bar/z2.txt | |
201 | $ hg add foo/bar/z2.txt |
|
201 | $ hg add foo/bar/z2.txt | |
202 | $ hg status -S |
|
202 | $ hg status -S | |
203 | A foo/bar/z2.txt |
|
203 | A foo/bar/z2.txt | |
204 | $ hg forget foo/bar/z2.txt |
|
204 | $ hg forget foo/bar/z2.txt | |
205 | $ hg status -S |
|
205 | $ hg status -S | |
206 | ? foo/bar/z2.txt |
|
206 | ? foo/bar/z2.txt | |
207 | $ hg forget foo/bar/z2.txt |
|
207 | $ hg forget foo/bar/z2.txt | |
208 | not removing foo/bar/z2.txt: file is already untracked (glob) |
|
208 | not removing foo/bar/z2.txt: file is already untracked (glob) | |
209 | [1] |
|
209 | [1] | |
210 | $ hg status -S |
|
210 | $ hg status -S | |
211 | ? foo/bar/z2.txt |
|
211 | ? foo/bar/z2.txt | |
212 | $ rm foo/bar/z2.txt |
|
212 | $ rm foo/bar/z2.txt | |
213 |
|
213 | |||
214 | Log with the relationships between repo and its subrepo: |
|
214 | Log with the relationships between repo and its subrepo: | |
215 |
|
215 | |||
216 | $ hg log --template '{rev}:{node|short} {desc}\n' |
|
216 | $ hg log --template '{rev}:{node|short} {desc}\n' | |
217 | 2:1326fa26d0c0 2-3-2 |
|
217 | 2:1326fa26d0c0 2-3-2 | |
218 | 1:4b3c9ff4f66b 1-2-1 |
|
218 | 1:4b3c9ff4f66b 1-2-1 | |
219 | 0:23376cbba0d8 0-0-0 |
|
219 | 0:23376cbba0d8 0-0-0 | |
220 |
|
220 | |||
221 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' |
|
221 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' | |
222 | 3:65903cebad86 2-3-2 |
|
222 | 3:65903cebad86 2-3-2 | |
223 | 2:d254738c5f5e 0-2-1 |
|
223 | 2:d254738c5f5e 0-2-1 | |
224 | 1:8629ce7dcc39 0-1-0 |
|
224 | 1:8629ce7dcc39 0-1-0 | |
225 | 0:af048e97ade2 0-0-0 |
|
225 | 0:af048e97ade2 0-0-0 | |
226 |
|
226 | |||
227 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' |
|
227 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' | |
228 | 2:31ecbdafd357 2-3-2 |
|
228 | 2:31ecbdafd357 2-3-2 | |
229 | 1:9647f22de499 0-1-1 |
|
229 | 1:9647f22de499 0-1-1 | |
230 | 0:4904098473f9 0-0-0 |
|
230 | 0:4904098473f9 0-0-0 | |
231 |
|
231 | |||
232 | Status between revisions: |
|
232 | Status between revisions: | |
233 |
|
233 | |||
234 | $ hg status -S |
|
234 | $ hg status -S | |
235 | $ hg status -S --rev 0:1 |
|
235 | $ hg status -S --rev 0:1 | |
236 | M .hgsubstate |
|
236 | M .hgsubstate | |
237 | M foo/.hgsubstate |
|
237 | M foo/.hgsubstate | |
238 | M foo/bar/z.txt |
|
238 | M foo/bar/z.txt | |
239 | M foo/y.txt |
|
239 | M foo/y.txt | |
240 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 |
|
240 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 | |
241 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt |
|
241 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt | |
242 | --- a/foo/y.txt |
|
242 | --- a/foo/y.txt | |
243 | +++ b/foo/y.txt |
|
243 | +++ b/foo/y.txt | |
244 | @@ -1,1 +1,2 @@ |
|
244 | @@ -1,1 +1,2 @@ | |
245 | y1 |
|
245 | y1 | |
246 | +y2 |
|
246 | +y2 | |
247 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt |
|
247 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt | |
248 | --- a/foo/bar/z.txt |
|
248 | --- a/foo/bar/z.txt | |
249 | +++ b/foo/bar/z.txt |
|
249 | +++ b/foo/bar/z.txt | |
250 | @@ -1,1 +1,2 @@ |
|
250 | @@ -1,1 +1,2 @@ | |
251 | z1 |
|
251 | z1 | |
252 | +z2 |
|
252 | +z2 | |
253 |
|
253 | |||
254 | Enable progress extension for archive tests: |
|
254 | Enable progress extension for archive tests: | |
255 |
|
255 | |||
256 | $ cp $HGRCPATH $HGRCPATH.no-progress |
|
256 | $ cp $HGRCPATH $HGRCPATH.no-progress | |
257 | $ cat >> $HGRCPATH <<EOF |
|
257 | $ cat >> $HGRCPATH <<EOF | |
258 | > [extensions] |
|
258 | > [extensions] | |
259 | > progress = |
|
259 | > progress = | |
260 | > [progress] |
|
260 | > [progress] | |
261 | > assume-tty = 1 |
|
261 | > assume-tty = 1 | |
262 | > delay = 0 |
|
262 | > delay = 0 | |
263 | > format = topic bar number |
|
263 | > format = topic bar number | |
264 | > refresh = 0 |
|
264 | > refresh = 0 | |
265 | > width = 60 |
|
265 | > width = 60 | |
266 | > EOF |
|
266 | > EOF | |
267 |
|
267 | |||
268 | Test archiving to a directory tree (the doubled lines in the output |
|
268 | Test archiving to a directory tree (the doubled lines in the output | |
269 | only show up in the test output, not in real usage): |
|
269 | only show up in the test output, not in real usage): | |
270 |
|
270 | |||
271 | $ hg archive --subrepos ../archive |
|
271 | $ hg archive --subrepos ../archive | |
272 | \r (no-eol) (esc) |
|
272 | \r (no-eol) (esc) | |
273 | archiving [ ] 0/3\r (no-eol) (esc) |
|
273 | archiving [ ] 0/3\r (no-eol) (esc) | |
274 | archiving [ ] 0/3\r (no-eol) (esc) |
|
274 | archiving [ ] 0/3\r (no-eol) (esc) | |
275 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
275 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
276 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
276 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
277 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
277 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
278 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
278 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
279 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
279 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
280 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
280 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
281 | \r (no-eol) (esc) |
|
281 | \r (no-eol) (esc) | |
282 | \r (no-eol) (esc) |
|
282 | \r (no-eol) (esc) | |
283 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
283 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
284 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
284 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
285 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
285 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
286 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
286 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
287 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
287 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
288 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
288 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
289 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
289 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
290 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
290 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
291 | \r (no-eol) (esc) |
|
291 | \r (no-eol) (esc) | |
292 | \r (no-eol) (esc) |
|
292 | \r (no-eol) (esc) | |
293 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) |
|
293 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) | |
294 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) |
|
294 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) | |
295 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) |
|
295 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) | |
296 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) |
|
296 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) | |
297 | \r (no-eol) (esc) |
|
297 | \r (no-eol) (esc) | |
298 | $ find ../archive | sort |
|
298 | $ find ../archive | sort | |
299 | ../archive |
|
299 | ../archive | |
300 | ../archive/.hg_archival.txt |
|
300 | ../archive/.hg_archival.txt | |
301 | ../archive/.hgsub |
|
301 | ../archive/.hgsub | |
302 | ../archive/.hgsubstate |
|
302 | ../archive/.hgsubstate | |
303 | ../archive/foo |
|
303 | ../archive/foo | |
304 | ../archive/foo/.hgsub |
|
304 | ../archive/foo/.hgsub | |
305 | ../archive/foo/.hgsubstate |
|
305 | ../archive/foo/.hgsubstate | |
306 | ../archive/foo/bar |
|
306 | ../archive/foo/bar | |
307 | ../archive/foo/bar/z.txt |
|
307 | ../archive/foo/bar/z.txt | |
308 | ../archive/foo/y.txt |
|
308 | ../archive/foo/y.txt | |
309 | ../archive/x.txt |
|
309 | ../archive/x.txt | |
310 |
|
310 | |||
311 | Test archiving to zip file (unzip output is unstable): |
|
311 | Test archiving to zip file (unzip output is unstable): | |
312 |
|
312 | |||
313 | $ hg archive --subrepos ../archive.zip |
|
313 | $ hg archive --subrepos ../archive.zip | |
314 | \r (no-eol) (esc) |
|
314 | \r (no-eol) (esc) | |
315 | archiving [ ] 0/3\r (no-eol) (esc) |
|
315 | archiving [ ] 0/3\r (no-eol) (esc) | |
316 | archiving [ ] 0/3\r (no-eol) (esc) |
|
316 | archiving [ ] 0/3\r (no-eol) (esc) | |
317 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
317 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
318 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
318 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
319 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
319 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
320 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
320 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
321 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
321 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
322 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
322 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
323 | \r (no-eol) (esc) |
|
323 | \r (no-eol) (esc) | |
324 | \r (no-eol) (esc) |
|
324 | \r (no-eol) (esc) | |
325 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
325 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
326 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
326 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
327 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
327 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
328 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
328 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
329 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
329 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
330 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
330 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
331 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
331 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
332 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
332 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
333 | \r (no-eol) (esc) |
|
333 | \r (no-eol) (esc) | |
334 | \r (no-eol) (esc) |
|
334 | \r (no-eol) (esc) | |
335 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) |
|
335 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) | |
336 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) |
|
336 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) | |
337 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) |
|
337 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) | |
338 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) |
|
338 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) | |
339 | \r (no-eol) (esc) |
|
339 | \r (no-eol) (esc) | |
340 |
|
340 | |||
341 | Test archiving a revision that references a subrepo that is not yet |
|
341 | Test archiving a revision that references a subrepo that is not yet | |
342 | cloned: |
|
342 | cloned: | |
343 |
|
343 | |||
344 | $ hg clone -U . ../empty |
|
344 | $ hg clone -U . ../empty | |
|
345 | \r (no-eol) (esc) | |||
|
346 | linking [ <=> ] 1\r (no-eol) (esc) | |||
|
347 | linking [ <=> ] 2\r (no-eol) (esc) | |||
|
348 | linking [ <=> ] 3\r (no-eol) (esc) | |||
|
349 | linking [ <=> ] 4\r (no-eol) (esc) | |||
|
350 | linking [ <=> ] 5\r (no-eol) (esc) | |||
|
351 | linking [ <=> ] 6\r (no-eol) (esc) | |||
|
352 | linking [ <=> ] 7\r (no-eol) (esc) | |||
|
353 | linking [ <=> ] 8\r (no-eol) (esc) | |||
|
354 | \r (no-eol) (esc) | |||
345 | $ cd ../empty |
|
355 | $ cd ../empty | |
346 | $ hg archive --subrepos -r tip ../archive.tar.gz |
|
356 | $ hg archive --subrepos -r tip ../archive.tar.gz | |
347 | \r (no-eol) (esc) |
|
357 | \r (no-eol) (esc) | |
348 | archiving [ ] 0/3\r (no-eol) (esc) |
|
358 | archiving [ ] 0/3\r (no-eol) (esc) | |
349 | archiving [ ] 0/3\r (no-eol) (esc) |
|
359 | archiving [ ] 0/3\r (no-eol) (esc) | |
350 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
360 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
351 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
361 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
352 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
362 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
353 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
363 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
354 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
364 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
355 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
365 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
356 | \r (no-eol) (esc) |
|
366 | \r (no-eol) (esc) | |
357 | \r (no-eol) (esc) |
|
367 | \r (no-eol) (esc) | |
|
368 | linking [ <=> ] 1\r (no-eol) (esc) | |||
|
369 | linking [ <=> ] 2\r (no-eol) (esc) | |||
|
370 | linking [ <=> ] 3\r (no-eol) (esc) | |||
|
371 | linking [ <=> ] 4\r (no-eol) (esc) | |||
|
372 | linking [ <=> ] 5\r (no-eol) (esc) | |||
|
373 | linking [ <=> ] 6\r (no-eol) (esc) | |||
|
374 | linking [ <=> ] 7\r (no-eol) (esc) | |||
|
375 | linking [ <=> ] 8\r (no-eol) (esc) | |||
|
376 | \r (no-eol) (esc) | |||
|
377 | \r (no-eol) (esc) | |||
358 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
378 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
359 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
379 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
360 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
380 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
361 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
381 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
362 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
382 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
363 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
383 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
364 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
384 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
365 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
385 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
366 | \r (no-eol) (esc) |
|
386 | \r (no-eol) (esc) | |
367 | \r (no-eol) (esc) |
|
387 | \r (no-eol) (esc) | |
|
388 | linking [ <=> ] 1\r (no-eol) (esc) | |||
|
389 | linking [ <=> ] 2\r (no-eol) (esc) | |||
|
390 | linking [ <=> ] 3\r (no-eol) (esc) | |||
|
391 | linking [ <=> ] 4\r (no-eol) (esc) | |||
|
392 | linking [ <=> ] 5\r (no-eol) (esc) | |||
|
393 | linking [ <=> ] 6\r (no-eol) (esc) | |||
|
394 | \r (no-eol) (esc) | |||
|
395 | \r (no-eol) (esc) | |||
368 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) |
|
396 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) | |
369 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) |
|
397 | archiving (foo/bar) [ ] 0/1\r (no-eol) (glob) (esc) | |
370 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) |
|
398 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) | |
371 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) |
|
399 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (glob) (esc) | |
372 | \r (no-eol) (esc) |
|
400 | \r (no-eol) (esc) | |
373 | cloning subrepo foo from $TESTTMP/repo/foo |
|
401 | cloning subrepo foo from $TESTTMP/repo/foo | |
374 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob) |
|
402 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob) | |
375 |
|
403 | |||
376 | The newly cloned subrepos contain no working copy: |
|
404 | The newly cloned subrepos contain no working copy: | |
377 |
|
405 | |||
378 | $ hg -R foo summary |
|
406 | $ hg -R foo summary | |
379 | parent: -1:000000000000 (no revision checked out) |
|
407 | parent: -1:000000000000 (no revision checked out) | |
380 | branch: default |
|
408 | branch: default | |
381 | commit: (clean) |
|
409 | commit: (clean) | |
382 | update: 4 new changesets (update) |
|
410 | update: 4 new changesets (update) | |
383 |
|
411 | |||
384 | Disable progress extension and cleanup: |
|
412 | Disable progress extension and cleanup: | |
385 |
|
413 | |||
386 | $ mv $HGRCPATH.no-progress $HGRCPATH |
|
414 | $ mv $HGRCPATH.no-progress $HGRCPATH | |
387 |
|
415 | |||
388 | Test archiving when there is a directory in the way for a subrepo |
|
416 | Test archiving when there is a directory in the way for a subrepo | |
389 | created by archive: |
|
417 | created by archive: | |
390 |
|
418 | |||
391 | $ hg clone -U . ../almost-empty |
|
419 | $ hg clone -U . ../almost-empty | |
392 | $ cd ../almost-empty |
|
420 | $ cd ../almost-empty | |
393 | $ mkdir foo |
|
421 | $ mkdir foo | |
394 | $ echo f > foo/f |
|
422 | $ echo f > foo/f | |
395 | $ hg archive --subrepos -r tip archive |
|
423 | $ hg archive --subrepos -r tip archive | |
396 | cloning subrepo foo from $TESTTMP/empty/foo |
|
424 | cloning subrepo foo from $TESTTMP/empty/foo | |
397 | abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepo foo) (glob) |
|
425 | abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepo foo) (glob) | |
398 | [255] |
|
426 | [255] | |
399 |
|
427 | |||
400 | Clone and test outgoing: |
|
428 | Clone and test outgoing: | |
401 |
|
429 | |||
402 | $ cd .. |
|
430 | $ cd .. | |
403 | $ hg clone repo repo2 |
|
431 | $ hg clone repo repo2 | |
404 | updating to branch default |
|
432 | updating to branch default | |
405 | cloning subrepo foo from $TESTTMP/repo/foo |
|
433 | cloning subrepo foo from $TESTTMP/repo/foo | |
406 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob) |
|
434 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar (glob) | |
407 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
435 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
408 | $ cd repo2 |
|
436 | $ cd repo2 | |
409 | $ hg outgoing -S |
|
437 | $ hg outgoing -S | |
410 | comparing with $TESTTMP/repo (glob) |
|
438 | comparing with $TESTTMP/repo (glob) | |
411 | searching for changes |
|
439 | searching for changes | |
412 | no changes found |
|
440 | no changes found | |
413 | comparing with $TESTTMP/repo/foo |
|
441 | comparing with $TESTTMP/repo/foo | |
414 | searching for changes |
|
442 | searching for changes | |
415 | no changes found |
|
443 | no changes found | |
416 | comparing with $TESTTMP/repo/foo/bar |
|
444 | comparing with $TESTTMP/repo/foo/bar | |
417 | searching for changes |
|
445 | searching for changes | |
418 | no changes found |
|
446 | no changes found | |
419 | [1] |
|
447 | [1] | |
420 |
|
448 | |||
421 | Make nested change: |
|
449 | Make nested change: | |
422 |
|
450 | |||
423 | $ echo y4 >> foo/y.txt |
|
451 | $ echo y4 >> foo/y.txt | |
424 | $ hg diff --nodates -S |
|
452 | $ hg diff --nodates -S | |
425 | diff -r 65903cebad86 foo/y.txt |
|
453 | diff -r 65903cebad86 foo/y.txt | |
426 | --- a/foo/y.txt |
|
454 | --- a/foo/y.txt | |
427 | +++ b/foo/y.txt |
|
455 | +++ b/foo/y.txt | |
428 | @@ -1,3 +1,4 @@ |
|
456 | @@ -1,3 +1,4 @@ | |
429 | y1 |
|
457 | y1 | |
430 | y2 |
|
458 | y2 | |
431 | y3 |
|
459 | y3 | |
432 | +y4 |
|
460 | +y4 | |
433 | $ hg commit --subrepos -m 3-4-2 |
|
461 | $ hg commit --subrepos -m 3-4-2 | |
434 | committing subrepository foo |
|
462 | committing subrepository foo | |
435 | $ hg outgoing -S |
|
463 | $ hg outgoing -S | |
436 | comparing with $TESTTMP/repo (glob) |
|
464 | comparing with $TESTTMP/repo (glob) | |
437 | searching for changes |
|
465 | searching for changes | |
438 | changeset: 3:2655b8ecc4ee |
|
466 | changeset: 3:2655b8ecc4ee | |
439 | tag: tip |
|
467 | tag: tip | |
440 | user: test |
|
468 | user: test | |
441 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
469 | date: Thu Jan 01 00:00:00 1970 +0000 | |
442 | summary: 3-4-2 |
|
470 | summary: 3-4-2 | |
443 |
|
471 | |||
444 | comparing with $TESTTMP/repo/foo |
|
472 | comparing with $TESTTMP/repo/foo | |
445 | searching for changes |
|
473 | searching for changes | |
446 | changeset: 4:e96193d6cb36 |
|
474 | changeset: 4:e96193d6cb36 | |
447 | tag: tip |
|
475 | tag: tip | |
448 | user: test |
|
476 | user: test | |
449 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
477 | date: Thu Jan 01 00:00:00 1970 +0000 | |
450 | summary: 3-4-2 |
|
478 | summary: 3-4-2 | |
451 |
|
479 | |||
452 | comparing with $TESTTMP/repo/foo/bar |
|
480 | comparing with $TESTTMP/repo/foo/bar | |
453 | searching for changes |
|
481 | searching for changes | |
454 | no changes found |
|
482 | no changes found | |
455 |
|
483 | |||
456 |
|
484 | |||
457 | Switch to original repo and setup default path: |
|
485 | Switch to original repo and setup default path: | |
458 |
|
486 | |||
459 | $ cd ../repo |
|
487 | $ cd ../repo | |
460 | $ echo '[paths]' >> .hg/hgrc |
|
488 | $ echo '[paths]' >> .hg/hgrc | |
461 | $ echo 'default = ../repo2' >> .hg/hgrc |
|
489 | $ echo 'default = ../repo2' >> .hg/hgrc | |
462 |
|
490 | |||
463 | Test incoming: |
|
491 | Test incoming: | |
464 |
|
492 | |||
465 | $ hg incoming -S |
|
493 | $ hg incoming -S | |
466 | comparing with $TESTTMP/repo2 (glob) |
|
494 | comparing with $TESTTMP/repo2 (glob) | |
467 | searching for changes |
|
495 | searching for changes | |
468 | changeset: 3:2655b8ecc4ee |
|
496 | changeset: 3:2655b8ecc4ee | |
469 | tag: tip |
|
497 | tag: tip | |
470 | user: test |
|
498 | user: test | |
471 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
499 | date: Thu Jan 01 00:00:00 1970 +0000 | |
472 | summary: 3-4-2 |
|
500 | summary: 3-4-2 | |
473 |
|
501 | |||
474 | comparing with $TESTTMP/repo2/foo |
|
502 | comparing with $TESTTMP/repo2/foo | |
475 | searching for changes |
|
503 | searching for changes | |
476 | changeset: 4:e96193d6cb36 |
|
504 | changeset: 4:e96193d6cb36 | |
477 | tag: tip |
|
505 | tag: tip | |
478 | user: test |
|
506 | user: test | |
479 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
507 | date: Thu Jan 01 00:00:00 1970 +0000 | |
480 | summary: 3-4-2 |
|
508 | summary: 3-4-2 | |
481 |
|
509 | |||
482 | comparing with $TESTTMP/repo2/foo/bar |
|
510 | comparing with $TESTTMP/repo2/foo/bar | |
483 | searching for changes |
|
511 | searching for changes | |
484 | no changes found |
|
512 | no changes found | |
485 |
|
513 | |||
486 | $ hg incoming -S --bundle incoming.hg |
|
514 | $ hg incoming -S --bundle incoming.hg | |
487 | abort: cannot combine --bundle and --subrepos |
|
515 | abort: cannot combine --bundle and --subrepos | |
488 | [255] |
|
516 | [255] | |
489 |
|
517 | |||
490 | Test missing subrepo: |
|
518 | Test missing subrepo: | |
491 |
|
519 | |||
492 | $ rm -r foo |
|
520 | $ rm -r foo | |
493 | $ hg status -S |
|
521 | $ hg status -S | |
494 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" |
|
522 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" | |
495 |
|
523 | |||
496 | Issue2619: IndexError: list index out of range on hg add with subrepos |
|
524 | Issue2619: IndexError: list index out of range on hg add with subrepos | |
497 | The subrepo must sorts after the explicit filename. |
|
525 | The subrepo must sorts after the explicit filename. | |
498 |
|
526 | |||
499 | $ cd .. |
|
527 | $ cd .. | |
500 | $ hg init test |
|
528 | $ hg init test | |
501 | $ cd test |
|
529 | $ cd test | |
502 | $ hg init x |
|
530 | $ hg init x | |
503 | $ echo "x = x" >> .hgsub |
|
531 | $ echo "x = x" >> .hgsub | |
504 | $ hg add .hgsub |
|
532 | $ hg add .hgsub | |
505 | $ touch a x/a |
|
533 | $ touch a x/a | |
506 | $ hg add a x/a |
|
534 | $ hg add a x/a | |
507 |
|
535 | |||
508 | $ cd .. |
|
536 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now