##// END OF EJS Templates
merge: suggest 'hg up -C .' for discarding changes, not 'hg up -C'...
Brodie Rao -
r12314:f2daa6ab default
parent child Browse files
Show More
@@ -1,534 +1,534 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 hex, nullid, nullrev, short
11 from node import hex, nullid, nullrev, short
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
13 import lock, util, extensions, error, encoding, node
13 import lock, util, extensions, error, encoding, node
14 import cmdutil, discovery, url, changegroup
14 import cmdutil, discovery, url, changegroup
15 import merge as mergemod
15 import merge as mergemod
16 import verify as verifymod
16 import verify as verifymod
17 import errno, os, shutil
17 import errno, os, shutil
18
18
19 def _local(path):
19 def _local(path):
20 path = util.expandpath(util.drop_scheme('file', path))
20 path = util.expandpath(util.drop_scheme('file', path))
21 return (os.path.isfile(path) and bundlerepo or localrepo)
21 return (os.path.isfile(path) and bundlerepo or localrepo)
22
22
23 def addbranchrevs(lrepo, repo, branches, revs):
23 def addbranchrevs(lrepo, repo, branches, revs):
24 hashbranch, branches = branches
24 hashbranch, branches = branches
25 if not hashbranch and not branches:
25 if not hashbranch and not branches:
26 return revs or None, revs and revs[0] or None
26 return revs or None, revs and revs[0] or None
27 revs = revs and list(revs) or []
27 revs = revs and list(revs) or []
28 if not repo.capable('branchmap'):
28 if not repo.capable('branchmap'):
29 if branches:
29 if branches:
30 raise util.Abort(_("remote branch lookup not supported"))
30 raise util.Abort(_("remote branch lookup not supported"))
31 revs.append(hashbranch)
31 revs.append(hashbranch)
32 return revs, revs[0]
32 return revs, revs[0]
33 branchmap = repo.branchmap()
33 branchmap = repo.branchmap()
34
34
35 def primary(butf8):
35 def primary(butf8):
36 if butf8 == '.':
36 if butf8 == '.':
37 if not lrepo or not lrepo.local():
37 if not lrepo or not lrepo.local():
38 raise util.Abort(_("dirstate branch not accessible"))
38 raise util.Abort(_("dirstate branch not accessible"))
39 butf8 = lrepo.dirstate.branch()
39 butf8 = lrepo.dirstate.branch()
40 if butf8 in branchmap:
40 if butf8 in branchmap:
41 revs.extend(node.hex(r) for r in reversed(branchmap[butf8]))
41 revs.extend(node.hex(r) for r in reversed(branchmap[butf8]))
42 return True
42 return True
43 else:
43 else:
44 return False
44 return False
45
45
46 for branch in branches:
46 for branch in branches:
47 butf8 = encoding.fromlocal(branch)
47 butf8 = encoding.fromlocal(branch)
48 if not primary(butf8):
48 if not primary(butf8):
49 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
49 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
50 if hashbranch:
50 if hashbranch:
51 butf8 = encoding.fromlocal(hashbranch)
51 butf8 = encoding.fromlocal(hashbranch)
52 if not primary(butf8):
52 if not primary(butf8):
53 revs.append(hashbranch)
53 revs.append(hashbranch)
54 return revs, revs[0]
54 return revs, revs[0]
55
55
56 def parseurl(url, branches=None):
56 def parseurl(url, branches=None):
57 '''parse url#branch, returning (url, (branch, branches))'''
57 '''parse url#branch, returning (url, (branch, branches))'''
58
58
59 if '#' not in url:
59 if '#' not in url:
60 return url, (None, branches or [])
60 return url, (None, branches or [])
61 url, branch = url.split('#', 1)
61 url, branch = url.split('#', 1)
62 return url, (branch, branches or [])
62 return url, (branch, branches or [])
63
63
64 schemes = {
64 schemes = {
65 'bundle': bundlerepo,
65 'bundle': bundlerepo,
66 'file': _local,
66 'file': _local,
67 'http': httprepo,
67 'http': httprepo,
68 'https': httprepo,
68 'https': httprepo,
69 'ssh': sshrepo,
69 'ssh': sshrepo,
70 'static-http': statichttprepo,
70 'static-http': statichttprepo,
71 }
71 }
72
72
73 def _lookup(path):
73 def _lookup(path):
74 scheme = 'file'
74 scheme = 'file'
75 if path:
75 if path:
76 c = path.find(':')
76 c = path.find(':')
77 if c > 0:
77 if c > 0:
78 scheme = path[:c]
78 scheme = path[:c]
79 thing = schemes.get(scheme) or schemes['file']
79 thing = schemes.get(scheme) or schemes['file']
80 try:
80 try:
81 return thing(path)
81 return thing(path)
82 except TypeError:
82 except TypeError:
83 return thing
83 return thing
84
84
85 def islocal(repo):
85 def islocal(repo):
86 '''return true if repo or path is local'''
86 '''return true if repo or path is local'''
87 if isinstance(repo, str):
87 if isinstance(repo, str):
88 try:
88 try:
89 return _lookup(repo).islocal(repo)
89 return _lookup(repo).islocal(repo)
90 except AttributeError:
90 except AttributeError:
91 return False
91 return False
92 return repo.local()
92 return repo.local()
93
93
94 def repository(ui, path='', create=False):
94 def repository(ui, path='', create=False):
95 """return a repository object for the specified path"""
95 """return a repository object for the specified path"""
96 repo = _lookup(path).instance(ui, path, create)
96 repo = _lookup(path).instance(ui, path, create)
97 ui = getattr(repo, "ui", ui)
97 ui = getattr(repo, "ui", ui)
98 for name, module in extensions.extensions():
98 for name, module in extensions.extensions():
99 hook = getattr(module, 'reposetup', None)
99 hook = getattr(module, 'reposetup', None)
100 if hook:
100 if hook:
101 hook(ui, repo)
101 hook(ui, repo)
102 return repo
102 return repo
103
103
104 def defaultdest(source):
104 def defaultdest(source):
105 '''return default destination of clone if none is given'''
105 '''return default destination of clone if none is given'''
106 return os.path.basename(os.path.normpath(source))
106 return os.path.basename(os.path.normpath(source))
107
107
108 def localpath(path):
108 def localpath(path):
109 if path.startswith('file://localhost/'):
109 if path.startswith('file://localhost/'):
110 return path[16:]
110 return path[16:]
111 if path.startswith('file://'):
111 if path.startswith('file://'):
112 return path[7:]
112 return path[7:]
113 if path.startswith('file:'):
113 if path.startswith('file:'):
114 return path[5:]
114 return path[5:]
115 return path
115 return path
116
116
117 def share(ui, source, dest=None, update=True):
117 def share(ui, source, dest=None, update=True):
118 '''create a shared repository'''
118 '''create a shared repository'''
119
119
120 if not islocal(source):
120 if not islocal(source):
121 raise util.Abort(_('can only share local repositories'))
121 raise util.Abort(_('can only share local repositories'))
122
122
123 if not dest:
123 if not dest:
124 dest = defaultdest(source)
124 dest = defaultdest(source)
125 else:
125 else:
126 dest = ui.expandpath(dest)
126 dest = ui.expandpath(dest)
127
127
128 if isinstance(source, str):
128 if isinstance(source, str):
129 origsource = ui.expandpath(source)
129 origsource = ui.expandpath(source)
130 source, branches = parseurl(origsource)
130 source, branches = parseurl(origsource)
131 srcrepo = repository(ui, source)
131 srcrepo = repository(ui, source)
132 rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
132 rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
133 else:
133 else:
134 srcrepo = source
134 srcrepo = source
135 origsource = source = srcrepo.url()
135 origsource = source = srcrepo.url()
136 checkout = None
136 checkout = None
137
137
138 sharedpath = srcrepo.sharedpath # if our source is already sharing
138 sharedpath = srcrepo.sharedpath # if our source is already sharing
139
139
140 root = os.path.realpath(dest)
140 root = os.path.realpath(dest)
141 roothg = os.path.join(root, '.hg')
141 roothg = os.path.join(root, '.hg')
142
142
143 if os.path.exists(roothg):
143 if os.path.exists(roothg):
144 raise util.Abort(_('destination already exists'))
144 raise util.Abort(_('destination already exists'))
145
145
146 if not os.path.isdir(root):
146 if not os.path.isdir(root):
147 os.mkdir(root)
147 os.mkdir(root)
148 os.mkdir(roothg)
148 os.mkdir(roothg)
149
149
150 requirements = ''
150 requirements = ''
151 try:
151 try:
152 requirements = srcrepo.opener('requires').read()
152 requirements = srcrepo.opener('requires').read()
153 except IOError, inst:
153 except IOError, inst:
154 if inst.errno != errno.ENOENT:
154 if inst.errno != errno.ENOENT:
155 raise
155 raise
156
156
157 requirements += 'shared\n'
157 requirements += 'shared\n'
158 file(os.path.join(roothg, 'requires'), 'w').write(requirements)
158 file(os.path.join(roothg, 'requires'), 'w').write(requirements)
159 file(os.path.join(roothg, 'sharedpath'), 'w').write(sharedpath)
159 file(os.path.join(roothg, 'sharedpath'), 'w').write(sharedpath)
160
160
161 default = srcrepo.ui.config('paths', 'default')
161 default = srcrepo.ui.config('paths', 'default')
162 if default:
162 if default:
163 f = file(os.path.join(roothg, 'hgrc'), 'w')
163 f = file(os.path.join(roothg, 'hgrc'), 'w')
164 f.write('[paths]\ndefault = %s\n' % default)
164 f.write('[paths]\ndefault = %s\n' % default)
165 f.close()
165 f.close()
166
166
167 r = repository(ui, root)
167 r = repository(ui, root)
168
168
169 if update:
169 if update:
170 r.ui.status(_("updating working directory\n"))
170 r.ui.status(_("updating working directory\n"))
171 if update is not True:
171 if update is not True:
172 checkout = update
172 checkout = update
173 for test in (checkout, 'default', 'tip'):
173 for test in (checkout, 'default', 'tip'):
174 if test is None:
174 if test is None:
175 continue
175 continue
176 try:
176 try:
177 uprev = r.lookup(test)
177 uprev = r.lookup(test)
178 break
178 break
179 except error.RepoLookupError:
179 except error.RepoLookupError:
180 continue
180 continue
181 _update(r, uprev)
181 _update(r, uprev)
182
182
183 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
183 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
184 stream=False, branch=None):
184 stream=False, branch=None):
185 """Make a copy of an existing repository.
185 """Make a copy of an existing repository.
186
186
187 Create a copy of an existing repository in a new directory. The
187 Create a copy of an existing repository in a new directory. The
188 source and destination are URLs, as passed to the repository
188 source and destination are URLs, as passed to the repository
189 function. Returns a pair of repository objects, the source and
189 function. Returns a pair of repository objects, the source and
190 newly created destination.
190 newly created destination.
191
191
192 The location of the source is added to the new repository's
192 The location of the source is added to the new repository's
193 .hg/hgrc file, as the default to be used for future pulls and
193 .hg/hgrc file, as the default to be used for future pulls and
194 pushes.
194 pushes.
195
195
196 If an exception is raised, the partly cloned/updated destination
196 If an exception is raised, the partly cloned/updated destination
197 repository will be deleted.
197 repository will be deleted.
198
198
199 Arguments:
199 Arguments:
200
200
201 source: repository object or URL
201 source: repository object or URL
202
202
203 dest: URL of destination repository to create (defaults to base
203 dest: URL of destination repository to create (defaults to base
204 name of source repository)
204 name of source repository)
205
205
206 pull: always pull from source repository, even in local case
206 pull: always pull from source repository, even in local case
207
207
208 stream: stream raw data uncompressed from repository (fast over
208 stream: stream raw data uncompressed from repository (fast over
209 LAN, slow over WAN)
209 LAN, slow over WAN)
210
210
211 rev: revision to clone up to (implies pull=True)
211 rev: revision to clone up to (implies pull=True)
212
212
213 update: update working directory after clone completes, if
213 update: update working directory after clone completes, if
214 destination is local repository (True means update to default rev,
214 destination is local repository (True means update to default rev,
215 anything else is treated as a revision)
215 anything else is treated as a revision)
216
216
217 branch: branches to clone
217 branch: branches to clone
218 """
218 """
219
219
220 if isinstance(source, str):
220 if isinstance(source, str):
221 origsource = ui.expandpath(source)
221 origsource = ui.expandpath(source)
222 source, branch = parseurl(origsource, branch)
222 source, branch = parseurl(origsource, branch)
223 src_repo = repository(ui, source)
223 src_repo = repository(ui, source)
224 else:
224 else:
225 src_repo = source
225 src_repo = source
226 branch = (None, branch or [])
226 branch = (None, branch or [])
227 origsource = source = src_repo.url()
227 origsource = source = src_repo.url()
228 rev, checkout = addbranchrevs(src_repo, src_repo, branch, rev)
228 rev, checkout = addbranchrevs(src_repo, src_repo, branch, rev)
229
229
230 if dest is None:
230 if dest is None:
231 dest = defaultdest(source)
231 dest = defaultdest(source)
232 ui.status(_("destination directory: %s\n") % dest)
232 ui.status(_("destination directory: %s\n") % dest)
233 else:
233 else:
234 dest = ui.expandpath(dest)
234 dest = ui.expandpath(dest)
235
235
236 dest = localpath(dest)
236 dest = localpath(dest)
237 source = localpath(source)
237 source = localpath(source)
238
238
239 if os.path.exists(dest):
239 if os.path.exists(dest):
240 if not os.path.isdir(dest):
240 if not os.path.isdir(dest):
241 raise util.Abort(_("destination '%s' already exists") % dest)
241 raise util.Abort(_("destination '%s' already exists") % dest)
242 elif os.listdir(dest):
242 elif os.listdir(dest):
243 raise util.Abort(_("destination '%s' is not empty") % dest)
243 raise util.Abort(_("destination '%s' is not empty") % dest)
244
244
245 class DirCleanup(object):
245 class DirCleanup(object):
246 def __init__(self, dir_):
246 def __init__(self, dir_):
247 self.rmtree = shutil.rmtree
247 self.rmtree = shutil.rmtree
248 self.dir_ = dir_
248 self.dir_ = dir_
249 def close(self):
249 def close(self):
250 self.dir_ = None
250 self.dir_ = None
251 def cleanup(self):
251 def cleanup(self):
252 if self.dir_:
252 if self.dir_:
253 self.rmtree(self.dir_, True)
253 self.rmtree(self.dir_, True)
254
254
255 src_lock = dest_lock = dir_cleanup = None
255 src_lock = dest_lock = dir_cleanup = None
256 try:
256 try:
257 if islocal(dest):
257 if islocal(dest):
258 dir_cleanup = DirCleanup(dest)
258 dir_cleanup = DirCleanup(dest)
259
259
260 abspath = origsource
260 abspath = origsource
261 copy = False
261 copy = False
262 if src_repo.cancopy() and islocal(dest):
262 if src_repo.cancopy() and islocal(dest):
263 abspath = os.path.abspath(util.drop_scheme('file', origsource))
263 abspath = os.path.abspath(util.drop_scheme('file', origsource))
264 copy = not pull and not rev
264 copy = not pull and not rev
265
265
266 if copy:
266 if copy:
267 try:
267 try:
268 # we use a lock here because if we race with commit, we
268 # we use a lock here because if we race with commit, we
269 # can end up with extra data in the cloned revlogs that's
269 # can end up with extra data in the cloned revlogs that's
270 # not pointed to by changesets, thus causing verify to
270 # not pointed to by changesets, thus causing verify to
271 # fail
271 # fail
272 src_lock = src_repo.lock(wait=False)
272 src_lock = src_repo.lock(wait=False)
273 except error.LockError:
273 except error.LockError:
274 copy = False
274 copy = False
275
275
276 if copy:
276 if copy:
277 src_repo.hook('preoutgoing', throw=True, source='clone')
277 src_repo.hook('preoutgoing', throw=True, source='clone')
278 hgdir = os.path.realpath(os.path.join(dest, ".hg"))
278 hgdir = os.path.realpath(os.path.join(dest, ".hg"))
279 if not os.path.exists(dest):
279 if not os.path.exists(dest):
280 os.mkdir(dest)
280 os.mkdir(dest)
281 else:
281 else:
282 # only clean up directories we create ourselves
282 # only clean up directories we create ourselves
283 dir_cleanup.dir_ = hgdir
283 dir_cleanup.dir_ = hgdir
284 try:
284 try:
285 dest_path = hgdir
285 dest_path = hgdir
286 os.mkdir(dest_path)
286 os.mkdir(dest_path)
287 except OSError, inst:
287 except OSError, inst:
288 if inst.errno == errno.EEXIST:
288 if inst.errno == errno.EEXIST:
289 dir_cleanup.close()
289 dir_cleanup.close()
290 raise util.Abort(_("destination '%s' already exists")
290 raise util.Abort(_("destination '%s' already exists")
291 % dest)
291 % dest)
292 raise
292 raise
293
293
294 hardlink = None
294 hardlink = None
295 num = 0
295 num = 0
296 for f in src_repo.store.copylist():
296 for f in src_repo.store.copylist():
297 src = os.path.join(src_repo.sharedpath, f)
297 src = os.path.join(src_repo.sharedpath, f)
298 dst = os.path.join(dest_path, f)
298 dst = os.path.join(dest_path, f)
299 dstbase = os.path.dirname(dst)
299 dstbase = os.path.dirname(dst)
300 if dstbase and not os.path.exists(dstbase):
300 if dstbase and not os.path.exists(dstbase):
301 os.mkdir(dstbase)
301 os.mkdir(dstbase)
302 if os.path.exists(src):
302 if os.path.exists(src):
303 if dst.endswith('data'):
303 if dst.endswith('data'):
304 # lock to avoid premature writing to the target
304 # lock to avoid premature writing to the target
305 dest_lock = lock.lock(os.path.join(dstbase, "lock"))
305 dest_lock = lock.lock(os.path.join(dstbase, "lock"))
306 hardlink, n = util.copyfiles(src, dst, hardlink)
306 hardlink, n = util.copyfiles(src, dst, hardlink)
307 num += n
307 num += n
308 if hardlink:
308 if hardlink:
309 ui.debug("linked %d files\n" % num)
309 ui.debug("linked %d files\n" % num)
310 else:
310 else:
311 ui.debug("copied %d files\n" % num)
311 ui.debug("copied %d files\n" % num)
312
312
313 # we need to re-init the repo after manually copying the data
313 # we need to re-init the repo after manually copying the data
314 # into it
314 # into it
315 dest_repo = repository(ui, dest)
315 dest_repo = repository(ui, dest)
316 src_repo.hook('outgoing', source='clone',
316 src_repo.hook('outgoing', source='clone',
317 node=node.hex(node.nullid))
317 node=node.hex(node.nullid))
318 else:
318 else:
319 try:
319 try:
320 dest_repo = repository(ui, dest, create=True)
320 dest_repo = repository(ui, dest, create=True)
321 except OSError, inst:
321 except OSError, inst:
322 if inst.errno == errno.EEXIST:
322 if inst.errno == errno.EEXIST:
323 dir_cleanup.close()
323 dir_cleanup.close()
324 raise util.Abort(_("destination '%s' already exists")
324 raise util.Abort(_("destination '%s' already exists")
325 % dest)
325 % dest)
326 raise
326 raise
327
327
328 revs = None
328 revs = None
329 if rev:
329 if rev:
330 if 'lookup' not in src_repo.capabilities:
330 if 'lookup' not in src_repo.capabilities:
331 raise util.Abort(_("src repository does not support "
331 raise util.Abort(_("src repository does not support "
332 "revision lookup and so doesn't "
332 "revision lookup and so doesn't "
333 "support clone by revision"))
333 "support clone by revision"))
334 revs = [src_repo.lookup(r) for r in rev]
334 revs = [src_repo.lookup(r) for r in rev]
335 checkout = revs[0]
335 checkout = revs[0]
336 if dest_repo.local():
336 if dest_repo.local():
337 dest_repo.clone(src_repo, heads=revs, stream=stream)
337 dest_repo.clone(src_repo, heads=revs, stream=stream)
338 elif src_repo.local():
338 elif src_repo.local():
339 src_repo.push(dest_repo, revs=revs)
339 src_repo.push(dest_repo, revs=revs)
340 else:
340 else:
341 raise util.Abort(_("clone from remote to remote not supported"))
341 raise util.Abort(_("clone from remote to remote not supported"))
342
342
343 if dir_cleanup:
343 if dir_cleanup:
344 dir_cleanup.close()
344 dir_cleanup.close()
345
345
346 if dest_repo.local():
346 if dest_repo.local():
347 fp = dest_repo.opener("hgrc", "w", text=True)
347 fp = dest_repo.opener("hgrc", "w", text=True)
348 fp.write("[paths]\n")
348 fp.write("[paths]\n")
349 fp.write("default = %s\n" % abspath)
349 fp.write("default = %s\n" % abspath)
350 fp.close()
350 fp.close()
351
351
352 dest_repo.ui.setconfig('paths', 'default', abspath)
352 dest_repo.ui.setconfig('paths', 'default', abspath)
353
353
354 if update:
354 if update:
355 if update is not True:
355 if update is not True:
356 checkout = update
356 checkout = update
357 if src_repo.local():
357 if src_repo.local():
358 checkout = src_repo.lookup(update)
358 checkout = src_repo.lookup(update)
359 for test in (checkout, 'default', 'tip'):
359 for test in (checkout, 'default', 'tip'):
360 if test is None:
360 if test is None:
361 continue
361 continue
362 try:
362 try:
363 uprev = dest_repo.lookup(test)
363 uprev = dest_repo.lookup(test)
364 break
364 break
365 except error.RepoLookupError:
365 except error.RepoLookupError:
366 continue
366 continue
367 bn = dest_repo[uprev].branch()
367 bn = dest_repo[uprev].branch()
368 dest_repo.ui.status(_("updating to branch %s\n")
368 dest_repo.ui.status(_("updating to branch %s\n")
369 % encoding.tolocal(bn))
369 % encoding.tolocal(bn))
370 _update(dest_repo, uprev)
370 _update(dest_repo, uprev)
371
371
372 return src_repo, dest_repo
372 return src_repo, dest_repo
373 finally:
373 finally:
374 release(src_lock, dest_lock)
374 release(src_lock, dest_lock)
375 if dir_cleanup is not None:
375 if dir_cleanup is not None:
376 dir_cleanup.cleanup()
376 dir_cleanup.cleanup()
377
377
378 def _showstats(repo, stats):
378 def _showstats(repo, stats):
379 repo.ui.status(_("%d files updated, %d files merged, "
379 repo.ui.status(_("%d files updated, %d files merged, "
380 "%d files removed, %d files unresolved\n") % stats)
380 "%d files removed, %d files unresolved\n") % stats)
381
381
382 def update(repo, node):
382 def update(repo, node):
383 """update the working directory to node, merging linear changes"""
383 """update the working directory to node, merging linear changes"""
384 stats = mergemod.update(repo, node, False, False, None)
384 stats = mergemod.update(repo, node, False, False, None)
385 _showstats(repo, stats)
385 _showstats(repo, stats)
386 if stats[3]:
386 if stats[3]:
387 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
387 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
388 return stats[3] > 0
388 return stats[3] > 0
389
389
390 # naming conflict in clone()
390 # naming conflict in clone()
391 _update = update
391 _update = update
392
392
393 def clean(repo, node, show_stats=True):
393 def clean(repo, node, show_stats=True):
394 """forcibly switch the working directory to node, clobbering changes"""
394 """forcibly switch the working directory to node, clobbering changes"""
395 stats = mergemod.update(repo, node, False, True, None)
395 stats = mergemod.update(repo, node, False, True, None)
396 if show_stats:
396 if show_stats:
397 _showstats(repo, stats)
397 _showstats(repo, stats)
398 return stats[3] > 0
398 return stats[3] > 0
399
399
400 def merge(repo, node, force=None, remind=True):
400 def merge(repo, node, force=None, remind=True):
401 """branch merge with node, resolving changes"""
401 """branch merge with node, resolving changes"""
402 stats = mergemod.update(repo, node, True, force, False)
402 stats = mergemod.update(repo, node, True, force, False)
403 _showstats(repo, stats)
403 _showstats(repo, stats)
404 if stats[3]:
404 if stats[3]:
405 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
405 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
406 "or 'hg update -C' to abandon\n"))
406 "or 'hg update -C .' to abandon\n"))
407 elif remind:
407 elif remind:
408 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
408 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
409 return stats[3] > 0
409 return stats[3] > 0
410
410
411 def incoming(ui, repo, source, opts):
411 def incoming(ui, repo, source, opts):
412 limit = cmdutil.loglimit(opts)
412 limit = cmdutil.loglimit(opts)
413 source, branches = parseurl(ui.expandpath(source), opts.get('branch'))
413 source, branches = parseurl(ui.expandpath(source), opts.get('branch'))
414 other = repository(remoteui(repo, opts), source)
414 other = repository(remoteui(repo, opts), source)
415 ui.status(_('comparing with %s\n') % url.hidepassword(source))
415 ui.status(_('comparing with %s\n') % url.hidepassword(source))
416 revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev'))
416 revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev'))
417 if revs:
417 if revs:
418 revs = [other.lookup(rev) for rev in revs]
418 revs = [other.lookup(rev) for rev in revs]
419
419
420 tmp = discovery.findcommonincoming(repo, other, heads=revs,
420 tmp = discovery.findcommonincoming(repo, other, heads=revs,
421 force=opts.get('force'))
421 force=opts.get('force'))
422 common, incoming, rheads = tmp
422 common, incoming, rheads = tmp
423 if not incoming:
423 if not incoming:
424 try:
424 try:
425 os.unlink(opts["bundle"])
425 os.unlink(opts["bundle"])
426 except:
426 except:
427 pass
427 pass
428 ui.status(_("no changes found\n"))
428 ui.status(_("no changes found\n"))
429 return 1
429 return 1
430
430
431 cleanup = None
431 cleanup = None
432 try:
432 try:
433 fname = opts["bundle"]
433 fname = opts["bundle"]
434 if fname or not other.local():
434 if fname or not other.local():
435 # create a bundle (uncompressed if other repo is not local)
435 # create a bundle (uncompressed if other repo is not local)
436
436
437 if revs is None and other.capable('changegroupsubset'):
437 if revs is None and other.capable('changegroupsubset'):
438 revs = rheads
438 revs = rheads
439
439
440 if revs is None:
440 if revs is None:
441 cg = other.changegroup(incoming, "incoming")
441 cg = other.changegroup(incoming, "incoming")
442 else:
442 else:
443 cg = other.changegroupsubset(incoming, revs, 'incoming')
443 cg = other.changegroupsubset(incoming, revs, 'incoming')
444 bundletype = other.local() and "HG10BZ" or "HG10UN"
444 bundletype = other.local() and "HG10BZ" or "HG10UN"
445 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
445 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
446 # keep written bundle?
446 # keep written bundle?
447 if opts["bundle"]:
447 if opts["bundle"]:
448 cleanup = None
448 cleanup = None
449 if not other.local():
449 if not other.local():
450 # use the created uncompressed bundlerepo
450 # use the created uncompressed bundlerepo
451 other = bundlerepo.bundlerepository(ui, repo.root, fname)
451 other = bundlerepo.bundlerepository(ui, repo.root, fname)
452
452
453 o = other.changelog.nodesbetween(incoming, revs)[0]
453 o = other.changelog.nodesbetween(incoming, revs)[0]
454 if opts.get('newest_first'):
454 if opts.get('newest_first'):
455 o.reverse()
455 o.reverse()
456 displayer = cmdutil.show_changeset(ui, other, opts)
456 displayer = cmdutil.show_changeset(ui, other, opts)
457 count = 0
457 count = 0
458 for n in o:
458 for n in o:
459 if limit is not None and count >= limit:
459 if limit is not None and count >= limit:
460 break
460 break
461 parents = [p for p in other.changelog.parents(n) if p != nullid]
461 parents = [p for p in other.changelog.parents(n) if p != nullid]
462 if opts.get('no_merges') and len(parents) == 2:
462 if opts.get('no_merges') and len(parents) == 2:
463 continue
463 continue
464 count += 1
464 count += 1
465 displayer.show(other[n])
465 displayer.show(other[n])
466 displayer.close()
466 displayer.close()
467 finally:
467 finally:
468 if hasattr(other, 'close'):
468 if hasattr(other, 'close'):
469 other.close()
469 other.close()
470 if cleanup:
470 if cleanup:
471 os.unlink(cleanup)
471 os.unlink(cleanup)
472
472
473 def outgoing(ui, repo, dest, opts):
473 def outgoing(ui, repo, dest, opts):
474 limit = cmdutil.loglimit(opts)
474 limit = cmdutil.loglimit(opts)
475 dest = ui.expandpath(dest or 'default-push', dest or 'default')
475 dest = ui.expandpath(dest or 'default-push', dest or 'default')
476 dest, branches = parseurl(dest, opts.get('branch'))
476 dest, branches = parseurl(dest, opts.get('branch'))
477 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
477 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
478 if revs:
478 if revs:
479 revs = [repo.lookup(rev) for rev in revs]
479 revs = [repo.lookup(rev) for rev in revs]
480
480
481 other = repository(remoteui(repo, opts), dest)
481 other = repository(remoteui(repo, opts), dest)
482 ui.status(_('comparing with %s\n') % url.hidepassword(dest))
482 ui.status(_('comparing with %s\n') % url.hidepassword(dest))
483 o = discovery.findoutgoing(repo, other, force=opts.get('force'))
483 o = discovery.findoutgoing(repo, other, force=opts.get('force'))
484 if not o:
484 if not o:
485 ui.status(_("no changes found\n"))
485 ui.status(_("no changes found\n"))
486 return 1
486 return 1
487 o = repo.changelog.nodesbetween(o, revs)[0]
487 o = repo.changelog.nodesbetween(o, revs)[0]
488 if opts.get('newest_first'):
488 if opts.get('newest_first'):
489 o.reverse()
489 o.reverse()
490 displayer = cmdutil.show_changeset(ui, repo, opts)
490 displayer = cmdutil.show_changeset(ui, repo, opts)
491 count = 0
491 count = 0
492 for n in o:
492 for n in o:
493 if limit is not None and count >= limit:
493 if limit is not None and count >= limit:
494 break
494 break
495 parents = [p for p in repo.changelog.parents(n) if p != nullid]
495 parents = [p for p in repo.changelog.parents(n) if p != nullid]
496 if opts.get('no_merges') and len(parents) == 2:
496 if opts.get('no_merges') and len(parents) == 2:
497 continue
497 continue
498 count += 1
498 count += 1
499 displayer.show(repo[n])
499 displayer.show(repo[n])
500 displayer.close()
500 displayer.close()
501
501
502 def revert(repo, node, choose):
502 def revert(repo, node, choose):
503 """revert changes to revision in node without updating dirstate"""
503 """revert changes to revision in node without updating dirstate"""
504 return mergemod.update(repo, node, False, True, choose)[3] > 0
504 return mergemod.update(repo, node, False, True, choose)[3] > 0
505
505
506 def verify(repo):
506 def verify(repo):
507 """verify the consistency of a repository"""
507 """verify the consistency of a repository"""
508 return verifymod.verify(repo)
508 return verifymod.verify(repo)
509
509
510 def remoteui(src, opts):
510 def remoteui(src, opts):
511 'build a remote ui from ui or repo and opts'
511 'build a remote ui from ui or repo and opts'
512 if hasattr(src, 'baseui'): # looks like a repository
512 if hasattr(src, 'baseui'): # looks like a repository
513 dst = src.baseui.copy() # drop repo-specific config
513 dst = src.baseui.copy() # drop repo-specific config
514 src = src.ui # copy target options from repo
514 src = src.ui # copy target options from repo
515 else: # assume it's a global ui object
515 else: # assume it's a global ui object
516 dst = src.copy() # keep all global options
516 dst = src.copy() # keep all global options
517
517
518 # copy ssh-specific options
518 # copy ssh-specific options
519 for o in 'ssh', 'remotecmd':
519 for o in 'ssh', 'remotecmd':
520 v = opts.get(o) or src.config('ui', o)
520 v = opts.get(o) or src.config('ui', o)
521 if v:
521 if v:
522 dst.setconfig("ui", o, v)
522 dst.setconfig("ui", o, v)
523
523
524 # copy bundle-specific options
524 # copy bundle-specific options
525 r = src.config('bundle', 'mainreporoot')
525 r = src.config('bundle', 'mainreporoot')
526 if r:
526 if r:
527 dst.setconfig('bundle', 'mainreporoot', r)
527 dst.setconfig('bundle', 'mainreporoot', r)
528
528
529 # copy auth and http_proxy section settings
529 # copy auth and http_proxy section settings
530 for sect in ('auth', 'http_proxy'):
530 for sect in ('auth', 'http_proxy'):
531 for key, val in src.configitems(sect):
531 for key, val in src.configitems(sect):
532 dst.setconfig(sect, key, val)
532 dst.setconfig(sect, key, val)
533
533
534 return dst
534 return dst
@@ -1,96 +1,96 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ echo a > a
3 $ echo a > a
4 $ hg add -n
4 $ hg add -n
5 adding a
5 adding a
6 $ hg st
6 $ hg st
7 ? a
7 ? a
8 $ hg add
8 $ hg add
9 adding a
9 adding a
10 $ hg st
10 $ hg st
11 A a
11 A a
12 $ hg forget a
12 $ hg forget a
13 $ hg add
13 $ hg add
14 adding a
14 adding a
15 $ hg st
15 $ hg st
16 A a
16 A a
17
17
18 $ echo b > b
18 $ echo b > b
19 $ hg add -n b
19 $ hg add -n b
20 $ hg st
20 $ hg st
21 A a
21 A a
22 ? b
22 ? b
23 $ hg add b || echo "failed to add b"
23 $ hg add b || echo "failed to add b"
24 $ hg st
24 $ hg st
25 A a
25 A a
26 A b
26 A b
27
27
28 should fail
28 should fail
29
29
30 $ hg add b
30 $ hg add b
31 b already tracked!
31 b already tracked!
32 $ hg st
32 $ hg st
33 A a
33 A a
34 A b
34 A b
35
35
36 $ hg ci -m 0 --traceback
36 $ hg ci -m 0 --traceback
37
37
38 should fail
38 should fail
39
39
40 $ hg add a
40 $ hg add a
41 a already tracked!
41 a already tracked!
42
42
43 $ echo aa > a
43 $ echo aa > a
44 $ hg ci -m 1
44 $ hg ci -m 1
45 $ hg up 0
45 $ hg up 0
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 $ echo aaa > a
47 $ echo aaa > a
48 $ hg ci -m 2
48 $ hg ci -m 2
49 created new head
49 created new head
50
50
51 $ hg merge
51 $ hg merge
52 merging a
52 merging a
53 warning: conflicts during merge.
53 warning: conflicts during merge.
54 merging a failed!
54 merging a failed!
55 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
55 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
56 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
56 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
57 $ hg st
57 $ hg st
58 M a
58 M a
59 ? a.orig
59 ? a.orig
60
60
61 should fail
61 should fail
62
62
63 $ hg add a
63 $ hg add a
64 a already tracked!
64 a already tracked!
65 $ hg st
65 $ hg st
66 M a
66 M a
67 ? a.orig
67 ? a.orig
68 $ hg resolve -m a
68 $ hg resolve -m a
69 $ hg ci -m merge
69 $ hg ci -m merge
70
70
71 issue683
71 issue683
72
72
73 $ hg forget a
73 $ hg forget a
74 $ hg add a
74 $ hg add a
75 $ hg st
75 $ hg st
76 ? a.orig
76 ? a.orig
77 $ hg rm a
77 $ hg rm a
78 $ hg st
78 $ hg st
79 R a
79 R a
80 ? a.orig
80 ? a.orig
81 $ echo a > a
81 $ echo a > a
82 $ hg add a
82 $ hg add a
83 $ hg st
83 $ hg st
84 M a
84 M a
85 ? a.orig
85 ? a.orig
86
86
87 $ hg add c && echo "unexpected addition of missing file"
87 $ hg add c && echo "unexpected addition of missing file"
88 c: No such file or directory
88 c: No such file or directory
89 $ echo c > c
89 $ echo c > c
90 $ hg add d c && echo "unexpected addition of missing file"
90 $ hg add d c && echo "unexpected addition of missing file"
91 d: No such file or directory
91 d: No such file or directory
92 $ hg st
92 $ hg st
93 M a
93 M a
94 A c
94 A c
95 ? a.orig
95 ? a.orig
96
96
@@ -1,47 +1,47 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "graphlog=" >> $HGRCPATH
2 $ echo "graphlog=" >> $HGRCPATH
3
3
4 $ addcommit () {
4 $ addcommit () {
5 > echo $1 > $1
5 > echo $1 > $1
6 > hg add $1
6 > hg add $1
7 > hg commit -d "${2} 0" -m $1
7 > hg commit -d "${2} 0" -m $1
8 > }
8 > }
9
9
10 $ commit () {
10 $ commit () {
11 > hg commit -d "${2} 0" -m $1
11 > hg commit -d "${2} 0" -m $1
12 > }
12 > }
13
13
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16 $ addcommit "A" 0
16 $ addcommit "A" 0
17 $ addcommit "B" 1
17 $ addcommit "B" 1
18 $ echo "C" >> A
18 $ echo "C" >> A
19 $ commit "C" 2
19 $ commit "C" 2
20
20
21 $ hg update -C 0
21 $ hg update -C 0
22 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
22 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
23 $ echo "D" >> A
23 $ echo "D" >> A
24 $ commit "D" 3
24 $ commit "D" 3
25 created new head
25 created new head
26
26
27 Merging a conflict araises
27 Merging a conflict araises
28
28
29 $ hg merge
29 $ hg merge
30 merging A
30 merging A
31 warning: conflicts during merge.
31 warning: conflicts during merge.
32 merging A failed!
32 merging A failed!
33 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
33 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
34 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
34 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
35
35
36 Correct the conflict without marking the file as resolved
36 Correct the conflict without marking the file as resolved
37
37
38 $ echo "ABCD" > A
38 $ echo "ABCD" > A
39 $ hg commit -m "Merged"
39 $ hg commit -m "Merged"
40 abort: unresolved merge conflicts (see hg resolve)
40 abort: unresolved merge conflicts (see hg resolve)
41
41
42 Mark the conflict as resolved and commit
42 Mark the conflict as resolved and commit
43
43
44 $ hg resolve -m A
44 $ hg resolve -m A
45 $ hg commit -m "Merged"
45 $ hg commit -m "Merged"
46
46
47 $ exit 0
47 $ exit 0
@@ -1,32 +1,32 b''
1 $ hg init
1 $ hg init
2 $ echo "nothing" > a
2 $ echo "nothing" > a
3 $ hg add a
3 $ hg add a
4 $ hg commit -m ancestor
4 $ hg commit -m ancestor
5 $ echo "something" > a
5 $ echo "something" > a
6 $ hg commit -m branch1
6 $ hg commit -m branch1
7 $ hg co 0
7 $ hg co 0
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 $ echo "something else" > a
9 $ echo "something else" > a
10 $ hg commit -m branch2
10 $ hg commit -m branch2
11 created new head
11 created new head
12
12
13 $ hg merge 1
13 $ hg merge 1
14 merging a
14 merging a
15 warning: conflicts during merge.
15 warning: conflicts during merge.
16 merging a failed!
16 merging a failed!
17 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
17 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
18 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
18 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
19
19
20 $ hg id
20 $ hg id
21 32e80765d7fe+75234512624c+ tip
21 32e80765d7fe+75234512624c+ tip
22
22
23 $ cat a
23 $ cat a
24 <<<<<<< local
24 <<<<<<< local
25 something else
25 something else
26 =======
26 =======
27 something
27 something
28 >>>>>>> other
28 >>>>>>> other
29
29
30 $ hg status
30 $ hg status
31 M a
31 M a
32 ? a.orig
32 ? a.orig
@@ -1,375 +1,375 b''
1 % add
1 % add
2 adding a
2 adding a
3 adding d1/d2/b
3 adding d1/d2/b
4 % modify
4 % modify
5 1:e0e2b8a9156b
5 1:e0e2b8a9156b
6 assuming destination a-hg
6 assuming destination a-hg
7 initializing svn repository 'a-hg'
7 initializing svn repository 'a-hg'
8 initializing svn working copy 'a-hg-wc'
8 initializing svn working copy 'a-hg-wc'
9 scanning source...
9 scanning source...
10 sorting...
10 sorting...
11 converting...
11 converting...
12 1 add a file
12 1 add a file
13 0 modify a file
13 0 modify a file
14 At revision 2.
14 At revision 2.
15 2 2 test .
15 2 2 test .
16 2 2 test a
16 2 2 test a
17 2 1 test d1
17 2 1 test d1
18 2 1 test d1/d2
18 2 1 test d1/d2
19 2 1 test d1/d2/b
19 2 1 test d1/d2/b
20 <?xml version="1.0"?>
20 <?xml version="1.0"?>
21 <log>
21 <log>
22 <logentry
22 <logentry
23 revision="2">
23 revision="2">
24 <author>test</author>
24 <author>test</author>
25 <date/>
25 <date/>
26 <paths>
26 <paths>
27 <path
27 <path
28 action="M">/a</path>
28 action="M">/a</path>
29 </paths>
29 </paths>
30 <msg>modify a file</msg>
30 <msg>modify a file</msg>
31 </logentry>
31 </logentry>
32 <logentry
32 <logentry
33 revision="1">
33 revision="1">
34 <author>test</author>
34 <author>test</author>
35 <date/>
35 <date/>
36 <paths>
36 <paths>
37 <path
37 <path
38 action="A">/a</path>
38 action="A">/a</path>
39 <path
39 <path
40 action="A">/d1</path>
40 action="A">/d1</path>
41 <path
41 <path
42 action="A">/d1/d2</path>
42 action="A">/d1/d2</path>
43 <path
43 <path
44 action="A">/d1/d2/b</path>
44 action="A">/d1/d2/b</path>
45 </paths>
45 </paths>
46 <msg>add a file</msg>
46 <msg>add a file</msg>
47 </logentry>
47 </logentry>
48 </log>
48 </log>
49 a:
49 a:
50 a
50 a
51 d1
51 d1
52
52
53 a-hg-wc:
53 a-hg-wc:
54 a
54 a
55 d1
55 d1
56 same
56 same
57 % rename
57 % rename
58 2:eb5169441d43
58 2:eb5169441d43
59 assuming destination a-hg
59 assuming destination a-hg
60 initializing svn working copy 'a-hg-wc'
60 initializing svn working copy 'a-hg-wc'
61 scanning source...
61 scanning source...
62 sorting...
62 sorting...
63 converting...
63 converting...
64 0 rename a file
64 0 rename a file
65 At revision 3.
65 At revision 3.
66 3 3 test .
66 3 3 test .
67 3 3 test b
67 3 3 test b
68 3 1 test d1
68 3 1 test d1
69 3 1 test d1/d2
69 3 1 test d1/d2
70 3 1 test d1/d2/b
70 3 1 test d1/d2/b
71 <?xml version="1.0"?>
71 <?xml version="1.0"?>
72 <log>
72 <log>
73 <logentry
73 <logentry
74 revision="3">
74 revision="3">
75 <author>test</author>
75 <author>test</author>
76 <date/>
76 <date/>
77 <paths>
77 <paths>
78 <path
78 <path
79 action="D">/a</path>
79 action="D">/a</path>
80 <path
80 <path
81 copyfrom-path="/a"
81 copyfrom-path="/a"
82 copyfrom-rev="2"
82 copyfrom-rev="2"
83 action="A">/b</path>
83 action="A">/b</path>
84 </paths>
84 </paths>
85 <msg>rename a file</msg>
85 <msg>rename a file</msg>
86 </logentry>
86 </logentry>
87 </log>
87 </log>
88 a:
88 a:
89 b
89 b
90 d1
90 d1
91
91
92 a-hg-wc:
92 a-hg-wc:
93 b
93 b
94 d1
94 d1
95 % copy
95 % copy
96 3:60effef6ab48
96 3:60effef6ab48
97 assuming destination a-hg
97 assuming destination a-hg
98 initializing svn working copy 'a-hg-wc'
98 initializing svn working copy 'a-hg-wc'
99 scanning source...
99 scanning source...
100 sorting...
100 sorting...
101 converting...
101 converting...
102 0 copy a file
102 0 copy a file
103 At revision 4.
103 At revision 4.
104 4 4 test .
104 4 4 test .
105 4 3 test b
105 4 3 test b
106 4 4 test c
106 4 4 test c
107 4 1 test d1
107 4 1 test d1
108 4 1 test d1/d2
108 4 1 test d1/d2
109 4 1 test d1/d2/b
109 4 1 test d1/d2/b
110 <?xml version="1.0"?>
110 <?xml version="1.0"?>
111 <log>
111 <log>
112 <logentry
112 <logentry
113 revision="4">
113 revision="4">
114 <author>test</author>
114 <author>test</author>
115 <date/>
115 <date/>
116 <paths>
116 <paths>
117 <path
117 <path
118 copyfrom-path="/b"
118 copyfrom-path="/b"
119 copyfrom-rev="3"
119 copyfrom-rev="3"
120 action="A">/c</path>
120 action="A">/c</path>
121 </paths>
121 </paths>
122 <msg>copy a file</msg>
122 <msg>copy a file</msg>
123 </logentry>
123 </logentry>
124 </log>
124 </log>
125 a:
125 a:
126 b
126 b
127 c
127 c
128 d1
128 d1
129
129
130 a-hg-wc:
130 a-hg-wc:
131 b
131 b
132 c
132 c
133 d1
133 d1
134 % remove
134 % remove
135 4:87bbe3013fb6
135 4:87bbe3013fb6
136 assuming destination a-hg
136 assuming destination a-hg
137 initializing svn working copy 'a-hg-wc'
137 initializing svn working copy 'a-hg-wc'
138 scanning source...
138 scanning source...
139 sorting...
139 sorting...
140 converting...
140 converting...
141 0 remove a file
141 0 remove a file
142 At revision 5.
142 At revision 5.
143 5 5 test .
143 5 5 test .
144 5 4 test c
144 5 4 test c
145 5 1 test d1
145 5 1 test d1
146 5 1 test d1/d2
146 5 1 test d1/d2
147 5 1 test d1/d2/b
147 5 1 test d1/d2/b
148 <?xml version="1.0"?>
148 <?xml version="1.0"?>
149 <log>
149 <log>
150 <logentry
150 <logentry
151 revision="5">
151 revision="5">
152 <author>test</author>
152 <author>test</author>
153 <date/>
153 <date/>
154 <paths>
154 <paths>
155 <path
155 <path
156 action="D">/b</path>
156 action="D">/b</path>
157 </paths>
157 </paths>
158 <msg>remove a file</msg>
158 <msg>remove a file</msg>
159 </logentry>
159 </logentry>
160 </log>
160 </log>
161 a:
161 a:
162 c
162 c
163 d1
163 d1
164
164
165 a-hg-wc:
165 a-hg-wc:
166 c
166 c
167 d1
167 d1
168 % executable
168 % executable
169 5:ff42e473c340
169 5:ff42e473c340
170 assuming destination a-hg
170 assuming destination a-hg
171 initializing svn working copy 'a-hg-wc'
171 initializing svn working copy 'a-hg-wc'
172 scanning source...
172 scanning source...
173 sorting...
173 sorting...
174 converting...
174 converting...
175 0 make a file executable
175 0 make a file executable
176 At revision 6.
176 At revision 6.
177 6 6 test .
177 6 6 test .
178 6 6 test c
178 6 6 test c
179 6 1 test d1
179 6 1 test d1
180 6 1 test d1/d2
180 6 1 test d1/d2
181 6 1 test d1/d2/b
181 6 1 test d1/d2/b
182 <?xml version="1.0"?>
182 <?xml version="1.0"?>
183 <log>
183 <log>
184 <logentry
184 <logentry
185 revision="6">
185 revision="6">
186 <author>test</author>
186 <author>test</author>
187 <date/>
187 <date/>
188 <paths>
188 <paths>
189 <path
189 <path
190 action="M">/c</path>
190 action="M">/c</path>
191 </paths>
191 </paths>
192 <msg>make a file executable</msg>
192 <msg>make a file executable</msg>
193 </logentry>
193 </logentry>
194 </log>
194 </log>
195 executable
195 executable
196 % executable in new directory
196 % executable in new directory
197 adding d1/a
197 adding d1/a
198 assuming destination a-hg
198 assuming destination a-hg
199 initializing svn repository 'a-hg'
199 initializing svn repository 'a-hg'
200 initializing svn working copy 'a-hg-wc'
200 initializing svn working copy 'a-hg-wc'
201 scanning source...
201 scanning source...
202 sorting...
202 sorting...
203 converting...
203 converting...
204 0 add executable file in new directory
204 0 add executable file in new directory
205 At revision 1.
205 At revision 1.
206 1 1 test .
206 1 1 test .
207 1 1 test d1
207 1 1 test d1
208 1 1 test d1/a
208 1 1 test d1/a
209 <?xml version="1.0"?>
209 <?xml version="1.0"?>
210 <log>
210 <log>
211 <logentry
211 <logentry
212 revision="1">
212 revision="1">
213 <author>test</author>
213 <author>test</author>
214 <date/>
214 <date/>
215 <paths>
215 <paths>
216 <path
216 <path
217 action="A">/d1</path>
217 action="A">/d1</path>
218 <path
218 <path
219 action="A">/d1/a</path>
219 action="A">/d1/a</path>
220 </paths>
220 </paths>
221 <msg>add executable file in new directory</msg>
221 <msg>add executable file in new directory</msg>
222 </logentry>
222 </logentry>
223 </log>
223 </log>
224 executable
224 executable
225 % copy to new directory
225 % copy to new directory
226 assuming destination a-hg
226 assuming destination a-hg
227 initializing svn working copy 'a-hg-wc'
227 initializing svn working copy 'a-hg-wc'
228 scanning source...
228 scanning source...
229 sorting...
229 sorting...
230 converting...
230 converting...
231 0 copy file to new directory
231 0 copy file to new directory
232 At revision 2.
232 At revision 2.
233 2 2 test .
233 2 2 test .
234 2 1 test d1
234 2 1 test d1
235 2 1 test d1/a
235 2 1 test d1/a
236 2 2 test d2
236 2 2 test d2
237 2 2 test d2/a
237 2 2 test d2/a
238 <?xml version="1.0"?>
238 <?xml version="1.0"?>
239 <log>
239 <log>
240 <logentry
240 <logentry
241 revision="2">
241 revision="2">
242 <author>test</author>
242 <author>test</author>
243 <date/>
243 <date/>
244 <paths>
244 <paths>
245 <path
245 <path
246 action="A">/d2</path>
246 action="A">/d2</path>
247 <path
247 <path
248 copyfrom-path="/d1/a"
248 copyfrom-path="/d1/a"
249 copyfrom-rev="1"
249 copyfrom-rev="1"
250 action="A">/d2/a</path>
250 action="A">/d2/a</path>
251 </paths>
251 </paths>
252 <msg>copy file to new directory</msg>
252 <msg>copy file to new directory</msg>
253 </logentry>
253 </logentry>
254 </log>
254 </log>
255 % branchy history
255 % branchy history
256 adding b
256 adding b
257 adding left-1
257 adding left-1
258 adding left-2
258 adding left-2
259 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
259 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
260 adding right-1
260 adding right-1
261 created new head
261 created new head
262 adding right-2
262 adding right-2
263 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
263 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
264 merging b
264 merging b
265 warning: conflicts during merge.
265 warning: conflicts during merge.
266 merging b failed!
266 merging b failed!
267 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
267 2 files updated, 0 files merged, 0 files removed, 1 files unresolved
268 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
268 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
269 assuming destination b-hg
269 assuming destination b-hg
270 initializing svn repository 'b-hg'
270 initializing svn repository 'b-hg'
271 initializing svn working copy 'b-hg-wc'
271 initializing svn working copy 'b-hg-wc'
272 scanning source...
272 scanning source...
273 sorting...
273 sorting...
274 converting...
274 converting...
275 5 base
275 5 base
276 4 left-1
276 4 left-1
277 3 left-2
277 3 left-2
278 2 right-1
278 2 right-1
279 1 right-2
279 1 right-2
280 0 merge
280 0 merge
281 % expect 4 changes
281 % expect 4 changes
282 At revision 4.
282 At revision 4.
283 4 4 test .
283 4 4 test .
284 4 3 test b
284 4 3 test b
285 4 2 test left-1
285 4 2 test left-1
286 4 3 test left-2
286 4 3 test left-2
287 4 4 test right-1
287 4 4 test right-1
288 4 4 test right-2
288 4 4 test right-2
289 <?xml version="1.0"?>
289 <?xml version="1.0"?>
290 <log>
290 <log>
291 <logentry
291 <logentry
292 revision="4">
292 revision="4">
293 <author>test</author>
293 <author>test</author>
294 <date/>
294 <date/>
295 <paths>
295 <paths>
296 <path
296 <path
297 action="A">/right-1</path>
297 action="A">/right-1</path>
298 <path
298 <path
299 action="A">/right-2</path>
299 action="A">/right-2</path>
300 </paths>
300 </paths>
301 <msg>merge</msg>
301 <msg>merge</msg>
302 </logentry>
302 </logentry>
303 <logentry
303 <logentry
304 revision="3">
304 revision="3">
305 <author>test</author>
305 <author>test</author>
306 <date/>
306 <date/>
307 <paths>
307 <paths>
308 <path
308 <path
309 action="M">/b</path>
309 action="M">/b</path>
310 <path
310 <path
311 action="A">/left-2</path>
311 action="A">/left-2</path>
312 </paths>
312 </paths>
313 <msg>left-2</msg>
313 <msg>left-2</msg>
314 </logentry>
314 </logentry>
315 <logentry
315 <logentry
316 revision="2">
316 revision="2">
317 <author>test</author>
317 <author>test</author>
318 <date/>
318 <date/>
319 <paths>
319 <paths>
320 <path
320 <path
321 action="M">/b</path>
321 action="M">/b</path>
322 <path
322 <path
323 action="A">/left-1</path>
323 action="A">/left-1</path>
324 </paths>
324 </paths>
325 <msg>left-1</msg>
325 <msg>left-1</msg>
326 </logentry>
326 </logentry>
327 <logentry
327 <logentry
328 revision="1">
328 revision="1">
329 <author>test</author>
329 <author>test</author>
330 <date/>
330 <date/>
331 <paths>
331 <paths>
332 <path
332 <path
333 action="A">/b</path>
333 action="A">/b</path>
334 </paths>
334 </paths>
335 <msg>base</msg>
335 <msg>base</msg>
336 </logentry>
336 </logentry>
337 </log>
337 </log>
338 % tags are not supported, but must not break conversion
338 % tags are not supported, but must not break conversion
339 adding a
339 adding a
340 assuming destination a-hg
340 assuming destination a-hg
341 initializing svn repository 'a-hg'
341 initializing svn repository 'a-hg'
342 initializing svn working copy 'a-hg-wc'
342 initializing svn working copy 'a-hg-wc'
343 scanning source...
343 scanning source...
344 sorting...
344 sorting...
345 converting...
345 converting...
346 1 Add file a
346 1 Add file a
347 0 Tagged as v1.0
347 0 Tagged as v1.0
348 writing Subversion tags is not yet implemented
348 writing Subversion tags is not yet implemented
349 At revision 2.
349 At revision 2.
350 2 2 test .
350 2 2 test .
351 2 1 test a
351 2 1 test a
352 2 2 test .hgtags
352 2 2 test .hgtags
353 <?xml version="1.0"?>
353 <?xml version="1.0"?>
354 <log>
354 <log>
355 <logentry
355 <logentry
356 revision="2">
356 revision="2">
357 <author>test</author>
357 <author>test</author>
358 <date/>
358 <date/>
359 <paths>
359 <paths>
360 <path
360 <path
361 action="A">/.hgtags</path>
361 action="A">/.hgtags</path>
362 </paths>
362 </paths>
363 <msg>Tagged as v1.0</msg>
363 <msg>Tagged as v1.0</msg>
364 </logentry>
364 </logentry>
365 <logentry
365 <logentry
366 revision="1">
366 revision="1">
367 <author>test</author>
367 <author>test</author>
368 <date/>
368 <date/>
369 <paths>
369 <paths>
370 <path
370 <path
371 action="A">/a</path>
371 action="A">/a</path>
372 </paths>
372 </paths>
373 <msg>Add file a</msg>
373 <msg>Add file a</msg>
374 </logentry>
374 </logentry>
375 </log>
375 </log>
@@ -1,923 +1,923 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > keyword =
3 > keyword =
4 > mq =
4 > mq =
5 > notify =
5 > notify =
6 > record =
6 > record =
7 > transplant =
7 > transplant =
8 > [ui]
8 > [ui]
9 > interactive = true
9 > interactive = true
10 > EOF
10 > EOF
11
11
12 Run kwdemo before [keyword] files are set up
12 Run kwdemo before [keyword] files are set up
13 as it would succeed without uisetup otherwise
13 as it would succeed without uisetup otherwise
14
14
15 $ hg --quiet kwdemo
15 $ hg --quiet kwdemo
16 [extensions]
16 [extensions]
17 keyword =
17 keyword =
18 [keyword]
18 [keyword]
19 demo.txt =
19 demo.txt =
20 [keywordmaps]
20 [keywordmaps]
21 Author = {author|user}
21 Author = {author|user}
22 Date = {date|utcdate}
22 Date = {date|utcdate}
23 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
23 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
24 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
24 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
25 RCSFile = {file|basename},v
25 RCSFile = {file|basename},v
26 RCSfile = {file|basename},v
26 RCSfile = {file|basename},v
27 Revision = {node|short}
27 Revision = {node|short}
28 Source = {root}/{file},v
28 Source = {root}/{file},v
29 \$Author: test \$
29 \$Author: test \$
30 \$Date: ..../../.. ..:..:.. \$
30 \$Date: ..../../.. ..:..:.. \$
31 \$Header: .*/demo.txt,v ............ ..../../.. ..:..:.. test \$
31 \$Header: .*/demo.txt,v ............ ..../../.. ..:..:.. test \$
32 \$Id: demo.txt,v ............ ..../../.. ..:..:.. test \$
32 \$Id: demo.txt,v ............ ..../../.. ..:..:.. test \$
33 \$RCSFile: demo.txt,v \$
33 \$RCSFile: demo.txt,v \$
34 \$RCSfile: demo.txt,v \$
34 \$RCSfile: demo.txt,v \$
35 \$Revision: ............ \$
35 \$Revision: ............ \$
36 \$Source: .*/demo.txt,v \$
36 \$Source: .*/demo.txt,v \$
37
37
38 $ hg --quiet kwdemo "Branch = {branches}"
38 $ hg --quiet kwdemo "Branch = {branches}"
39 [extensions]
39 [extensions]
40 keyword =
40 keyword =
41 [keyword]
41 [keyword]
42 demo.txt =
42 demo.txt =
43 [keywordmaps]
43 [keywordmaps]
44 Branch = {branches}
44 Branch = {branches}
45 $Branch: demobranch $
45 $Branch: demobranch $
46
46
47 $ cat <<EOF >> $HGRCPATH
47 $ cat <<EOF >> $HGRCPATH
48 > [keyword]
48 > [keyword]
49 > ** =
49 > ** =
50 > b = ignore
50 > b = ignore
51 > [hooks]
51 > [hooks]
52 > commit=
52 > commit=
53 > commit.test=cp a hooktest
53 > commit.test=cp a hooktest
54 > EOF
54 > EOF
55
55
56 $ hg init Test-bndl
56 $ hg init Test-bndl
57 $ cd Test-bndl
57 $ cd Test-bndl
58
58
59 kwshrink should exit silently in empty/invalid repo
59 kwshrink should exit silently in empty/invalid repo
60
60
61 $ hg kwshrink
61 $ hg kwshrink
62
62
63 Symlinks cannot be created on Windows.
63 Symlinks cannot be created on Windows.
64 A bundle to test this was made with:
64 A bundle to test this was made with:
65 hg init t
65 hg init t
66 cd t
66 cd t
67 echo a > a
67 echo a > a
68 ln -s a sym
68 ln -s a sym
69 hg add sym
69 hg add sym
70 hg ci -m addsym -u mercurial
70 hg ci -m addsym -u mercurial
71 hg bundle --base null ../test-keyword.hg
71 hg bundle --base null ../test-keyword.hg
72
72
73 $ hg pull -u "$TESTDIR"/test-keyword.hg
73 $ hg pull -u "$TESTDIR"/test-keyword.hg
74 pulling from .*test-keyword.hg
74 pulling from .*test-keyword.hg
75 requesting all changes
75 requesting all changes
76 adding changesets
76 adding changesets
77 adding manifests
77 adding manifests
78 adding file changes
78 adding file changes
79 added 1 changesets with 1 changes to 1 files
79 added 1 changesets with 1 changes to 1 files
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81
81
82 $ echo 'expand $Id$' > a
82 $ echo 'expand $Id$' > a
83 $ echo 'do not process $Id:' >> a
83 $ echo 'do not process $Id:' >> a
84 $ echo 'xxx $' >> a
84 $ echo 'xxx $' >> a
85 $ echo 'ignore $Id$' > b
85 $ echo 'ignore $Id$' > b
86
86
87 Output files as they were created
87 Output files as they were created
88
88
89 $ cat a b
89 $ cat a b
90 expand $Id$
90 expand $Id$
91 do not process $Id:
91 do not process $Id:
92 xxx $
92 xxx $
93 ignore $Id$
93 ignore $Id$
94
94
95 no kwfiles
95 no kwfiles
96
96
97 $ hg kwfiles
97 $ hg kwfiles
98
98
99 untracked candidates
99 untracked candidates
100
100
101 $ hg -v kwfiles --unknown
101 $ hg -v kwfiles --unknown
102 k a
102 k a
103
103
104 Add files and check status
104 Add files and check status
105
105
106 $ hg addremove
106 $ hg addremove
107 adding a
107 adding a
108 adding b
108 adding b
109 $ hg status
109 $ hg status
110 A a
110 A a
111 A b
111 A b
112
112
113
113
114 Default keyword expansion including commit hook
114 Default keyword expansion including commit hook
115 Interrupted commit should not change state or run commit hook
115 Interrupted commit should not change state or run commit hook
116
116
117 $ hg --debug commit
117 $ hg --debug commit
118 abort: empty commit message
118 abort: empty commit message
119 $ hg status
119 $ hg status
120 A a
120 A a
121 A b
121 A b
122
122
123 Commit with several checks
123 Commit with several checks
124
124
125 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
125 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
126 a
126 a
127 b
127 b
128 overwriting a expanding keywords
128 overwriting a expanding keywords
129 running hook commit.test: cp a hooktest
129 running hook commit.test: cp a hooktest
130 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
130 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
131 $ hg status
131 $ hg status
132 ? hooktest
132 ? hooktest
133 $ hg debugrebuildstate
133 $ hg debugrebuildstate
134 $ hg --quiet identify
134 $ hg --quiet identify
135 ef63ca68695b
135 ef63ca68695b
136
136
137 cat files in working directory with keywords expanded
137 cat files in working directory with keywords expanded
138
138
139 $ cat a b
139 $ cat a b
140 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
140 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
141 do not process $Id:
141 do not process $Id:
142 xxx $
142 xxx $
143 ignore $Id$
143 ignore $Id$
144
144
145 hg cat files and symlink, no expansion
145 hg cat files and symlink, no expansion
146
146
147 $ hg cat sym a b && echo
147 $ hg cat sym a b && echo
148 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
148 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
149 do not process $Id:
149 do not process $Id:
150 xxx $
150 xxx $
151 ignore $Id$
151 ignore $Id$
152 a.*
152 a.*
153
153
154 Test hook execution
154 Test hook execution
155
155
156 $ diff a hooktest
156 $ diff a hooktest
157
157
158 Removing commit hook from config
158 Removing commit hook from config
159
159
160 $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nohook
160 $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nohook
161 $ mv "$HGRCPATH".nohook "$HGRCPATH"
161 $ mv "$HGRCPATH".nohook "$HGRCPATH"
162 $ rm hooktest
162 $ rm hooktest
163
163
164 bundle
164 bundle
165
165
166 $ hg bundle --base null ../kw.hg
166 $ hg bundle --base null ../kw.hg
167 2 changesets found
167 2 changesets found
168 $ cd ..
168 $ cd ..
169 $ hg init Test
169 $ hg init Test
170 $ cd Test
170 $ cd Test
171
171
172 Notify on pull to check whether keywords stay as is in email
172 Notify on pull to check whether keywords stay as is in email
173 ie. if patch.diff wrapper acts as it should
173 ie. if patch.diff wrapper acts as it should
174
174
175 $ cat <<EOF >> $HGRCPATH
175 $ cat <<EOF >> $HGRCPATH
176 > [hooks]
176 > [hooks]
177 > incoming.notify = python:hgext.notify.hook
177 > incoming.notify = python:hgext.notify.hook
178 > [notify]
178 > [notify]
179 > sources = pull
179 > sources = pull
180 > diffstat = False
180 > diffstat = False
181 > [reposubs]
181 > [reposubs]
182 > * = Test
182 > * = Test
183 > EOF
183 > EOF
184
184
185 Pull from bundle and trigger notify
185 Pull from bundle and trigger notify
186
186
187 $ hg pull -u ../kw.hg
187 $ hg pull -u ../kw.hg
188 pulling from ../kw.hg
188 pulling from ../kw.hg
189 requesting all changes
189 requesting all changes
190 adding changesets
190 adding changesets
191 adding manifests
191 adding manifests
192 adding file changes
192 adding file changes
193 added 2 changesets with 3 changes to 3 files
193 added 2 changesets with 3 changes to 3 files
194 Content-Type: text/plain; charset="us-ascii"
194 Content-Type: text/plain; charset="us-ascii"
195 MIME-Version: 1.0
195 MIME-Version: 1.0
196 Content-Transfer-Encoding: 7bit
196 Content-Transfer-Encoding: 7bit
197 Date: .*
197 Date: .*
198 Subject: changeset in .*
198 Subject: changeset in .*
199 From: mercurial
199 From: mercurial
200 X-Hg-Notification: changeset a2392c293916
200 X-Hg-Notification: changeset a2392c293916
201 Message-Id: <hg.a2392c293916.*>
201 Message-Id: <hg.a2392c293916.*>
202 To: Test
202 To: Test
203
203
204 changeset a2392c293916 in .*
204 changeset a2392c293916 in .*
205 details: .*?cmd=changeset;node=a2392c293916
205 details: .*?cmd=changeset;node=a2392c293916
206 description:
206 description:
207 addsym
207 addsym
208
208
209 diffs (6 lines):
209 diffs (6 lines):
210
210
211 diff -r 000000000000 -r a2392c293916 sym
211 diff -r 000000000000 -r a2392c293916 sym
212 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
212 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
213 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
213 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
214 @@ -0,0 +1,1 @@
214 @@ -0,0 +1,1 @@
215 +a
215 +a
216 \ No newline at end of file
216 \ No newline at end of file
217 Content-Type: text/plain; charset="us-ascii"
217 Content-Type: text/plain; charset="us-ascii"
218 MIME-Version: 1.0
218 MIME-Version: 1.0
219 Content-Transfer-Encoding: 7bit
219 Content-Transfer-Encoding: 7bit
220 Date:.*
220 Date:.*
221 Subject: changeset in.*
221 Subject: changeset in.*
222 From: User Name <user@example.com>
222 From: User Name <user@example.com>
223 X-Hg-Notification: changeset ef63ca68695b
223 X-Hg-Notification: changeset ef63ca68695b
224 Message-Id: <hg.ef63ca68695b.*>
224 Message-Id: <hg.ef63ca68695b.*>
225 To: Test
225 To: Test
226
226
227 changeset ef63ca68695b in .*
227 changeset ef63ca68695b in .*
228 details: .*?cmd=changeset;node=ef63ca68695b
228 details: .*?cmd=changeset;node=ef63ca68695b
229 description:
229 description:
230 absym
230 absym
231
231
232 diffs (12 lines):
232 diffs (12 lines):
233
233
234 diff -r a2392c293916 -r ef63ca68695b a
234 diff -r a2392c293916 -r ef63ca68695b a
235 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
235 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
236 +++ b/a Thu Jan 01 00:00:00 1970 +0000
236 +++ b/a Thu Jan 01 00:00:00 1970 +0000
237 @@ -0,0 +1,3 @@
237 @@ -0,0 +1,3 @@
238 +expand $Id$
238 +expand $Id$
239 +do not process $Id:
239 +do not process $Id:
240 +xxx $
240 +xxx $
241 diff -r a2392c293916 -r ef63ca68695b b
241 diff -r a2392c293916 -r ef63ca68695b b
242 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
242 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
243 +++ b/b Thu Jan 01 00:00:00 1970 +0000
243 +++ b/b Thu Jan 01 00:00:00 1970 +0000
244 @@ -0,0 +1,1 @@
244 @@ -0,0 +1,1 @@
245 +ignore $Id$
245 +ignore $Id$
246 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
246 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
247
247
248 Remove notify config
248 Remove notify config
249
249
250 $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nonotify
250 $ sed -e '/\[hooks\]/,$ d' "$HGRCPATH" > $HGRCPATH.nonotify
251 $ mv "$HGRCPATH".nonotify "$HGRCPATH"
251 $ mv "$HGRCPATH".nonotify "$HGRCPATH"
252
252
253 Touch files and check with status
253 Touch files and check with status
254
254
255 $ touch a b
255 $ touch a b
256 $ hg status
256 $ hg status
257
257
258 Update and expand
258 Update and expand
259
259
260 $ rm sym a b
260 $ rm sym a b
261 $ hg update -C
261 $ hg update -C
262 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ cat a b
263 $ cat a b
264 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
264 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
265 do not process $Id:
265 do not process $Id:
266 xxx $
266 xxx $
267 ignore $Id$
267 ignore $Id$
268
268
269 Check whether expansion is filewise
269 Check whether expansion is filewise
270
270
271 $ echo '$Id$' > c
271 $ echo '$Id$' > c
272 $ echo 'tests for different changenodes' >> c
272 $ echo 'tests for different changenodes' >> c
273
273
274 commit file c
274 commit file c
275
275
276 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
276 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
277 adding c
277 adding c
278
278
279 force expansion
279 force expansion
280
280
281 $ hg -v kwexpand
281 $ hg -v kwexpand
282 overwriting a expanding keywords
282 overwriting a expanding keywords
283 overwriting c expanding keywords
283 overwriting c expanding keywords
284
284
285 compare changenodes in a and c
285 compare changenodes in a and c
286
286
287 $ cat a c
287 $ cat a c
288 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
288 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
289 do not process $Id:
289 do not process $Id:
290 xxx $
290 xxx $
291 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
291 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
292 tests for different changenodes
292 tests for different changenodes
293
293
294 record chunk
294 record chunk
295
295
296 $ python -c \
296 $ python -c \
297 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
297 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
298 $ hg record -d '1 10' -m rectest<<EOF
298 $ hg record -d '1 10' -m rectest<<EOF
299 > y
299 > y
300 > y
300 > y
301 > n
301 > n
302 > EOF
302 > EOF
303 diff --git a/a b/a
303 diff --git a/a b/a
304 2 hunks, 2 lines changed
304 2 hunks, 2 lines changed
305 examine changes to 'a'? [Ynsfdaq?]
305 examine changes to 'a'? [Ynsfdaq?]
306 @@ -1,3 +1,4 @@
306 @@ -1,3 +1,4 @@
307 expand $Id$
307 expand $Id$
308 +foo
308 +foo
309 do not process $Id:
309 do not process $Id:
310 xxx $
310 xxx $
311 record change 1/2 to 'a'? [Ynsfdaq?]
311 record change 1/2 to 'a'? [Ynsfdaq?]
312 @@ -2,2 +3,3 @@
312 @@ -2,2 +3,3 @@
313 do not process $Id:
313 do not process $Id:
314 xxx $
314 xxx $
315 +bar
315 +bar
316 record change 2/2 to 'a'? [Ynsfdaq?]
316 record change 2/2 to 'a'? [Ynsfdaq?]
317
317
318 $ hg identify
318 $ hg identify
319 d17e03c92c97+ tip
319 d17e03c92c97+ tip
320 $ hg status
320 $ hg status
321 M a
321 M a
322
322
323 Cat modified file a
323 Cat modified file a
324
324
325 $ cat a
325 $ cat a
326 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
326 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
327 foo
327 foo
328 do not process $Id:
328 do not process $Id:
329 xxx $
329 xxx $
330 bar
330 bar
331
331
332 Diff remaining chunk
332 Diff remaining chunk
333
333
334 $ hg diff
334 $ hg diff
335 diff -r d17e03c92c97 a
335 diff -r d17e03c92c97 a
336 --- a/a Wed Dec 31 23:59:51 1969 -0000
336 --- a/a Wed Dec 31 23:59:51 1969 -0000
337 \+\+\+ b/a .*
337 \+\+\+ b/a .*
338 @@ -2,3 +2,4 @@
338 @@ -2,3 +2,4 @@
339 foo
339 foo
340 do not process $Id:
340 do not process $Id:
341 xxx $
341 xxx $
342 +bar
342 +bar
343
343
344 $ hg rollback
344 $ hg rollback
345 rolling back to revision 2 (undo commit)
345 rolling back to revision 2 (undo commit)
346
346
347 Record all chunks in file a
347 Record all chunks in file a
348
348
349 $ echo foo > msg
349 $ echo foo > msg
350
350
351 - do not use "hg record -m" here!
351 - do not use "hg record -m" here!
352
352
353 $ hg record -l msg -d '1 11'<<EOF
353 $ hg record -l msg -d '1 11'<<EOF
354 > y
354 > y
355 > y
355 > y
356 > y
356 > y
357 > EOF
357 > EOF
358 diff --git a/a b/a
358 diff --git a/a b/a
359 2 hunks, 2 lines changed
359 2 hunks, 2 lines changed
360 examine changes to 'a'? [Ynsfdaq?]
360 examine changes to 'a'? [Ynsfdaq?]
361 @@ -1,3 +1,4 @@
361 @@ -1,3 +1,4 @@
362 expand $Id$
362 expand $Id$
363 +foo
363 +foo
364 do not process $Id:
364 do not process $Id:
365 xxx $
365 xxx $
366 record change 1/2 to 'a'? [Ynsfdaq?]
366 record change 1/2 to 'a'? [Ynsfdaq?]
367 @@ -2,2 +3,3 @@
367 @@ -2,2 +3,3 @@
368 do not process $Id:
368 do not process $Id:
369 xxx $
369 xxx $
370 +bar
370 +bar
371 record change 2/2 to 'a'? [Ynsfdaq?]
371 record change 2/2 to 'a'? [Ynsfdaq?]
372
372
373 File a should be clean
373 File a should be clean
374
374
375 $ hg status -A a
375 $ hg status -A a
376 C a
376 C a
377
377
378 $ rm msg
378 $ rm msg
379 $ hg rollback
379 $ hg rollback
380 rolling back to revision 2 (undo commit)
380 rolling back to revision 2 (undo commit)
381 $ hg update -C
381 $ hg update -C
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
383
383
384 Test patch queue repo
384 Test patch queue repo
385
385
386 $ hg init --mq
386 $ hg init --mq
387 $ hg qimport -r tip -n mqtest.diff
387 $ hg qimport -r tip -n mqtest.diff
388 $ hg commit --mq -m mqtest
388 $ hg commit --mq -m mqtest
389
389
390 Keywords should not be expanded in patch
390 Keywords should not be expanded in patch
391
391
392 $ cat .hg/patches/mqtest.diff
392 $ cat .hg/patches/mqtest.diff
393 # HG changeset patch
393 # HG changeset patch
394 # User User Name <user@example.com>
394 # User User Name <user@example.com>
395 # Date 1 0
395 # Date 1 0
396 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
396 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
397 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
397 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
398 cndiff
398 cndiff
399
399
400 diff -r ef63ca68695b -r 40a904bbbe4c c
400 diff -r ef63ca68695b -r 40a904bbbe4c c
401 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
401 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
402 +++ b/c Thu Jan 01 00:00:01 1970 +0000
402 +++ b/c Thu Jan 01 00:00:01 1970 +0000
403 @@ -0,0 +1,2 @@
403 @@ -0,0 +1,2 @@
404 +$Id$
404 +$Id$
405 +tests for different changenodes
405 +tests for different changenodes
406
406
407 $ hg qpop
407 $ hg qpop
408 popping mqtest.diff
408 popping mqtest.diff
409 patch queue now empty
409 patch queue now empty
410
410
411 qgoto, implying qpush, should expand
411 qgoto, implying qpush, should expand
412
412
413 $ hg qgoto mqtest.diff
413 $ hg qgoto mqtest.diff
414 applying mqtest.diff
414 applying mqtest.diff
415 now at: mqtest.diff
415 now at: mqtest.diff
416 $ cat c
416 $ cat c
417 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
417 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
418 tests for different changenodes
418 tests for different changenodes
419 $ hg cat c
419 $ hg cat c
420 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
420 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
421 tests for different changenodes
421 tests for different changenodes
422
422
423 Keywords should not be expanded in filelog
423 Keywords should not be expanded in filelog
424
424
425 $ hg --config 'extensions.keyword=!' cat c
425 $ hg --config 'extensions.keyword=!' cat c
426 $Id$
426 $Id$
427 tests for different changenodes
427 tests for different changenodes
428
428
429 qpop and move on
429 qpop and move on
430
430
431 $ hg qpop
431 $ hg qpop
432 popping mqtest.diff
432 popping mqtest.diff
433 patch queue now empty
433 patch queue now empty
434
434
435 Copy and show added kwfiles
435 Copy and show added kwfiles
436
436
437 $ hg cp a c
437 $ hg cp a c
438 $ hg kwfiles
438 $ hg kwfiles
439 a
439 a
440 c
440 c
441
441
442 Commit and show expansion in original and copy
442 Commit and show expansion in original and copy
443
443
444 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
444 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
445 c
445 c
446 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
446 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
447 overwriting c expanding keywords
447 overwriting c expanding keywords
448 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
448 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
449 $ cat a c
449 $ cat a c
450 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
450 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
451 do not process $Id:
451 do not process $Id:
452 xxx $
452 xxx $
453 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
453 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
454 do not process $Id:
454 do not process $Id:
455 xxx $
455 xxx $
456
456
457 Touch copied c and check its status
457 Touch copied c and check its status
458
458
459 $ touch c
459 $ touch c
460 $ hg status
460 $ hg status
461
461
462 Test different options of hg kwfiles
462 Test different options of hg kwfiles
463
463
464 $ hg kwfiles
464 $ hg kwfiles
465 a
465 a
466 c
466 c
467 $ hg -v kwfiles --ignore
467 $ hg -v kwfiles --ignore
468 I b
468 I b
469 I sym
469 I sym
470 $ hg kwfiles --all
470 $ hg kwfiles --all
471 K a
471 K a
472 K c
472 K c
473 I b
473 I b
474 I sym
474 I sym
475
475
476 Diff specific revision
476 Diff specific revision
477
477
478 $ hg diff --rev 1
478 $ hg diff --rev 1
479 diff -r ef63ca68695b c
479 diff -r ef63ca68695b c
480 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
480 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
481 \+\+\+ b/c .*
481 \+\+\+ b/c .*
482 @@ -0,0 +1,3 @@
482 @@ -0,0 +1,3 @@
483 +expand $Id$
483 +expand $Id$
484 +do not process $Id:
484 +do not process $Id:
485 +xxx $
485 +xxx $
486
486
487 Status after rollback:
487 Status after rollback:
488
488
489 $ hg rollback
489 $ hg rollback
490 rolling back to revision 1 (undo commit)
490 rolling back to revision 1 (undo commit)
491 $ hg status
491 $ hg status
492 A c
492 A c
493 $ hg update --clean
493 $ hg update --clean
494 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
494 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
495
495
496 Custom keywordmaps as argument to kwdemo
496 Custom keywordmaps as argument to kwdemo
497
497
498 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
498 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
499 [extensions]
499 [extensions]
500 keyword =
500 keyword =
501 [keyword]
501 [keyword]
502 ** =
502 ** =
503 b = ignore
503 b = ignore
504 demo.txt =
504 demo.txt =
505 [keywordmaps]
505 [keywordmaps]
506 Xinfo = {author}: {desc}
506 Xinfo = {author}: {desc}
507 $Xinfo: test: hg keyword configuration and expansion example $
507 $Xinfo: test: hg keyword configuration and expansion example $
508
508
509 Configure custom keywordmaps
509 Configure custom keywordmaps
510
510
511 $ cat <<EOF >>$HGRCPATH
511 $ cat <<EOF >>$HGRCPATH
512 > [keywordmaps]
512 > [keywordmaps]
513 > Id = {file} {node|short} {date|rfc822date} {author|user}
513 > Id = {file} {node|short} {date|rfc822date} {author|user}
514 > Xinfo = {author}: {desc}
514 > Xinfo = {author}: {desc}
515 > EOF
515 > EOF
516
516
517 Cat and hg cat files before custom expansion
517 Cat and hg cat files before custom expansion
518
518
519 $ cat a b
519 $ cat a b
520 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
520 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
521 do not process $Id:
521 do not process $Id:
522 xxx $
522 xxx $
523 ignore $Id$
523 ignore $Id$
524 $ hg cat sym a b && echo
524 $ hg cat sym a b && echo
525 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
525 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
526 do not process $Id:
526 do not process $Id:
527 xxx $
527 xxx $
528 ignore $Id$
528 ignore $Id$
529 a.*
529 a.*
530
530
531 Write custom keyword and prepare multiline commit message
531 Write custom keyword and prepare multiline commit message
532
532
533 $ echo '$Xinfo$' >> a
533 $ echo '$Xinfo$' >> a
534 $ cat <<EOF >> log
534 $ cat <<EOF >> log
535 > firstline
535 > firstline
536 > secondline
536 > secondline
537 > EOF
537 > EOF
538
538
539 Interrupted commit should not change state
539 Interrupted commit should not change state
540
540
541 $ hg commit
541 $ hg commit
542 abort: empty commit message
542 abort: empty commit message
543 $ hg status
543 $ hg status
544 M a
544 M a
545 ? c
545 ? c
546 ? log
546 ? log
547
547
548 Commit with multiline message and custom expansion
548 Commit with multiline message and custom expansion
549
549
550 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
550 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
551 a
551 a
552 overwriting a expanding keywords
552 overwriting a expanding keywords
553 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
553 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
554 $ rm log
554 $ rm log
555
555
556 Stat, verify and show custom expansion (firstline)
556 Stat, verify and show custom expansion (firstline)
557
557
558 $ hg status
558 $ hg status
559 ? c
559 ? c
560 $ hg verify
560 $ hg verify
561 checking changesets
561 checking changesets
562 checking manifests
562 checking manifests
563 crosschecking files in changesets and manifests
563 crosschecking files in changesets and manifests
564 checking files
564 checking files
565 3 files, 3 changesets, 4 total revisions
565 3 files, 3 changesets, 4 total revisions
566 $ cat a b
566 $ cat a b
567 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
567 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
568 do not process $Id:
568 do not process $Id:
569 xxx $
569 xxx $
570 $Xinfo: User Name <user@example.com>: firstline $
570 $Xinfo: User Name <user@example.com>: firstline $
571 ignore $Id$
571 ignore $Id$
572 $ hg cat sym a b && echo
572 $ hg cat sym a b && echo
573 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
573 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
574 do not process $Id:
574 do not process $Id:
575 xxx $
575 xxx $
576 $Xinfo: User Name <user@example.com>: firstline $
576 $Xinfo: User Name <user@example.com>: firstline $
577 ignore $Id$
577 ignore $Id$
578 a.*
578 a.*
579
579
580 annotate
580 annotate
581
581
582 $ hg annotate a
582 $ hg annotate a
583 1: expand $Id$
583 1: expand $Id$
584 1: do not process $Id:
584 1: do not process $Id:
585 1: xxx $
585 1: xxx $
586 2: $Xinfo$
586 2: $Xinfo$
587
587
588 remove with status checks
588 remove with status checks
589
589
590 $ hg debugrebuildstate
590 $ hg debugrebuildstate
591 $ hg remove a
591 $ hg remove a
592 $ hg --debug commit -m rma
592 $ hg --debug commit -m rma
593 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
593 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
594 $ hg status
594 $ hg status
595 ? c
595 ? c
596
596
597 Rollback, revert, and check expansion
597 Rollback, revert, and check expansion
598
598
599 $ hg rollback
599 $ hg rollback
600 rolling back to revision 2 (undo commit)
600 rolling back to revision 2 (undo commit)
601 $ hg status
601 $ hg status
602 R a
602 R a
603 ? c
603 ? c
604 $ hg revert --no-backup --rev tip a
604 $ hg revert --no-backup --rev tip a
605 $ cat a
605 $ cat a
606 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
606 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
607 do not process $Id:
607 do not process $Id:
608 xxx $
608 xxx $
609 $Xinfo: User Name <user@example.com>: firstline $
609 $Xinfo: User Name <user@example.com>: firstline $
610
610
611 Clone to test global and local configurations
611 Clone to test global and local configurations
612
612
613 $ cd ..
613 $ cd ..
614
614
615 Expansion in destinaton with global configuration
615 Expansion in destinaton with global configuration
616
616
617 $ hg --quiet clone Test globalconf
617 $ hg --quiet clone Test globalconf
618 $ cat globalconf/a
618 $ cat globalconf/a
619 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
619 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
620 do not process $Id:
620 do not process $Id:
621 xxx $
621 xxx $
622 $Xinfo: User Name <user@example.com>: firstline $
622 $Xinfo: User Name <user@example.com>: firstline $
623
623
624 No expansion in destination with local configuration in origin only
624 No expansion in destination with local configuration in origin only
625
625
626 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
626 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
627 $ cat localconf/a
627 $ cat localconf/a
628 expand $Id$
628 expand $Id$
629 do not process $Id:
629 do not process $Id:
630 xxx $
630 xxx $
631 $Xinfo$
631 $Xinfo$
632
632
633 Clone to test incoming
633 Clone to test incoming
634
634
635 $ hg clone -r1 Test Test-a
635 $ hg clone -r1 Test Test-a
636 requesting all changes
636 requesting all changes
637 adding changesets
637 adding changesets
638 adding manifests
638 adding manifests
639 adding file changes
639 adding file changes
640 added 2 changesets with 3 changes to 3 files
640 added 2 changesets with 3 changes to 3 files
641 updating to branch default
641 updating to branch default
642 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
642 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 $ cd Test-a
643 $ cd Test-a
644 $ cat <<EOF >> .hg/hgrc
644 $ cat <<EOF >> .hg/hgrc
645 > [paths]
645 > [paths]
646 > default = ../Test
646 > default = ../Test
647 > EOF
647 > EOF
648 $ hg incoming
648 $ hg incoming
649 comparing with .*test-keyword.t/Test
649 comparing with .*test-keyword.t/Test
650 searching for changes
650 searching for changes
651 changeset: 2:bb948857c743
651 changeset: 2:bb948857c743
652 tag: tip
652 tag: tip
653 user: User Name <user@example.com>
653 user: User Name <user@example.com>
654 date: Thu Jan 01 00:00:02 1970 +0000
654 date: Thu Jan 01 00:00:02 1970 +0000
655 summary: firstline
655 summary: firstline
656
656
657 Imported patch should not be rejected
657 Imported patch should not be rejected
658
658
659 $ sed -e 's/Id.*/& rejecttest/' a > a.new
659 $ sed -e 's/Id.*/& rejecttest/' a > a.new
660 $ mv a.new a
660 $ mv a.new a
661 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
661 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
662 a
662 a
663 overwriting a expanding keywords
663 overwriting a expanding keywords
664 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
664 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
665 $ hg export -o ../rejecttest.diff tip
665 $ hg export -o ../rejecttest.diff tip
666 $ cd ../Test
666 $ cd ../Test
667 $ hg import ../rejecttest.diff
667 $ hg import ../rejecttest.diff
668 applying ../rejecttest.diff
668 applying ../rejecttest.diff
669 $ cat a b
669 $ cat a b
670 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
670 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
671 do not process $Id: rejecttest
671 do not process $Id: rejecttest
672 xxx $
672 xxx $
673 $Xinfo: User Name <user@example.com>: rejects? $
673 $Xinfo: User Name <user@example.com>: rejects? $
674 ignore $Id$
674 ignore $Id$
675
675
676 $ hg rollback
676 $ hg rollback
677 rolling back to revision 2 (undo commit)
677 rolling back to revision 2 (undo commit)
678 $ hg update --clean
678 $ hg update --clean
679 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
679 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
680
680
681 kwexpand/kwshrink on selected files
681 kwexpand/kwshrink on selected files
682
682
683 $ mkdir x
683 $ mkdir x
684 $ hg copy a x/a
684 $ hg copy a x/a
685 $ hg --verbose kwexpand a
685 $ hg --verbose kwexpand a
686 overwriting a expanding keywords
686 overwriting a expanding keywords
687
687
688 kwexpand x/a should abort
688 kwexpand x/a should abort
689
689
690 $ hg --verbose kwexpand x/a
690 $ hg --verbose kwexpand x/a
691 abort: outstanding uncommitted changes
691 abort: outstanding uncommitted changes
692 $ cd x
692 $ cd x
693 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
693 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
694 x/a
694 x/a
695 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
695 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
696 overwriting x/a expanding keywords
696 overwriting x/a expanding keywords
697 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
697 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
698 $ cat a
698 $ cat a
699 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
699 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
700 do not process $Id:
700 do not process $Id:
701 xxx $
701 xxx $
702 $Xinfo: User Name <user@example.com>: xa $
702 $Xinfo: User Name <user@example.com>: xa $
703
703
704 kwshrink a inside directory x
704 kwshrink a inside directory x
705
705
706 $ hg --verbose kwshrink a
706 $ hg --verbose kwshrink a
707 overwriting x/a shrinking keywords
707 overwriting x/a shrinking keywords
708 $ cat a
708 $ cat a
709 expand $Id$
709 expand $Id$
710 do not process $Id:
710 do not process $Id:
711 xxx $
711 xxx $
712 $Xinfo$
712 $Xinfo$
713 $ cd ..
713 $ cd ..
714
714
715 kwexpand nonexistent
715 kwexpand nonexistent
716
716
717 $ hg kwexpand nonexistent
717 $ hg kwexpand nonexistent
718 nonexistent:.*
718 nonexistent:.*
719
719
720
720
721 hg serve
721 hg serve
722 - expand with hgweb file
722 - expand with hgweb file
723 - no expansion with hgweb annotate/changeset/filediff
723 - no expansion with hgweb annotate/changeset/filediff
724 - check errors
724 - check errors
725
725
726 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
726 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
727 $ cat hg.pid >> $DAEMON_PIDS
727 $ cat hg.pid >> $DAEMON_PIDS
728 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
728 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
729 200 Script output follows
729 200 Script output follows
730
730
731 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
731 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
732 do not process $Id:
732 do not process $Id:
733 xxx $
733 xxx $
734 $Xinfo: User Name <user@example.com>: firstline $
734 $Xinfo: User Name <user@example.com>: firstline $
735 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
735 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
736 200 Script output follows
736 200 Script output follows
737
737
738
738
739 user@1: expand $Id$
739 user@1: expand $Id$
740 user@1: do not process $Id:
740 user@1: do not process $Id:
741 user@1: xxx $
741 user@1: xxx $
742 user@2: $Xinfo$
742 user@2: $Xinfo$
743
743
744
744
745
745
746
746
747 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
747 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
748 200 Script output follows
748 200 Script output follows
749
749
750
750
751 # HG changeset patch
751 # HG changeset patch
752 # User User Name <user@example.com>
752 # User User Name <user@example.com>
753 # Date 3 0
753 # Date 3 0
754 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
754 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
755 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
755 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
756 xa
756 xa
757
757
758 diff -r bb948857c743 -r b4560182a3f9 x/a
758 diff -r bb948857c743 -r b4560182a3f9 x/a
759 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
759 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
760 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
760 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
761 @@ -0,0 +1,4 @@
761 @@ -0,0 +1,4 @@
762 +expand $Id$
762 +expand $Id$
763 +do not process $Id:
763 +do not process $Id:
764 +xxx $
764 +xxx $
765 +$Xinfo$
765 +$Xinfo$
766
766
767 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
767 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
768 200 Script output follows
768 200 Script output follows
769
769
770
770
771 diff -r ef63ca68695b -r bb948857c743 a
771 diff -r ef63ca68695b -r bb948857c743 a
772 --- a/a Thu Jan 01 00:00:00 1970 +0000
772 --- a/a Thu Jan 01 00:00:00 1970 +0000
773 +++ b/a Thu Jan 01 00:00:02 1970 +0000
773 +++ b/a Thu Jan 01 00:00:02 1970 +0000
774 @@ -1,3 +1,4 @@
774 @@ -1,3 +1,4 @@
775 expand $Id$
775 expand $Id$
776 do not process $Id:
776 do not process $Id:
777 xxx $
777 xxx $
778 +$Xinfo$
778 +$Xinfo$
779
779
780
780
781
781
782
782
783 $ cat errors.log
783 $ cat errors.log
784
784
785 Prepare merge and resolve tests
785 Prepare merge and resolve tests
786
786
787 $ echo '$Id$' > m
787 $ echo '$Id$' > m
788 $ hg add m
788 $ hg add m
789 $ hg commit -m 4kw
789 $ hg commit -m 4kw
790 $ echo foo >> m
790 $ echo foo >> m
791 $ hg commit -m 5foo
791 $ hg commit -m 5foo
792
792
793 simplemerge
793 simplemerge
794
794
795 $ hg update 4
795 $ hg update 4
796 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 $ echo foo >> m
797 $ echo foo >> m
798 $ hg commit -m 6foo
798 $ hg commit -m 6foo
799 created new head
799 created new head
800 $ hg merge
800 $ hg merge
801 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
801 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
802 (branch merge, don't forget to commit)
802 (branch merge, don't forget to commit)
803 $ hg commit -m simplemerge
803 $ hg commit -m simplemerge
804 $ cat m
804 $ cat m
805 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
805 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
806 foo
806 foo
807
807
808 conflict: keyword should stay outside conflict zone
808 conflict: keyword should stay outside conflict zone
809
809
810 $ hg update 4
810 $ hg update 4
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
812 $ echo bar >> m
812 $ echo bar >> m
813 $ hg commit -m 8bar
813 $ hg commit -m 8bar
814 created new head
814 created new head
815 $ hg merge
815 $ hg merge
816 merging m
816 merging m
817 warning: conflicts during merge.
817 warning: conflicts during merge.
818 merging m failed!
818 merging m failed!
819 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
819 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
820 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
820 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
821 $ cat m
821 $ cat m
822 $Id$
822 $Id$
823 <<<<<<< local
823 <<<<<<< local
824 bar
824 bar
825 =======
825 =======
826 foo
826 foo
827 >>>>>>> other
827 >>>>>>> other
828
828
829 resolve to local
829 resolve to local
830
830
831 $ HGMERGE=internal:local hg resolve -a
831 $ HGMERGE=internal:local hg resolve -a
832 $ hg commit -m localresolve
832 $ hg commit -m localresolve
833 $ cat m
833 $ cat m
834 $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
834 $Id: m 41efa6d38e9b Thu, 01 Jan 1970 00:00:00 +0000 test $
835 bar
835 bar
836
836
837 Test restricted mode with transplant -b
837 Test restricted mode with transplant -b
838
838
839 $ hg update 6
839 $ hg update 6
840 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
841 $ hg branch foo
841 $ hg branch foo
842 marked working directory as branch foo
842 marked working directory as branch foo
843 $ mv a a.bak
843 $ mv a a.bak
844 $ echo foobranch > a
844 $ echo foobranch > a
845 $ cat a.bak >> a
845 $ cat a.bak >> a
846 $ rm a.bak
846 $ rm a.bak
847 $ hg commit -m 9foobranch
847 $ hg commit -m 9foobranch
848 $ hg update default
848 $ hg update default
849 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
849 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
850 $ hg -y transplant -b foo tip
850 $ hg -y transplant -b foo tip
851 applying 4aa30d025d50
851 applying 4aa30d025d50
852 4aa30d025d50 transplanted to 5a4da427c162
852 4aa30d025d50 transplanted to 5a4da427c162
853
853
854 Expansion in changeset but not in file
854 Expansion in changeset but not in file
855
855
856 $ hg tip -p
856 $ hg tip -p
857 changeset: 11:5a4da427c162
857 changeset: 11:5a4da427c162
858 tag: tip
858 tag: tip
859 parent: 9:41efa6d38e9b
859 parent: 9:41efa6d38e9b
860 user: test
860 user: test
861 date: Thu Jan 01 00:00:00 1970 +0000
861 date: Thu Jan 01 00:00:00 1970 +0000
862 summary: 9foobranch
862 summary: 9foobranch
863
863
864 diff -r 41efa6d38e9b -r 5a4da427c162 a
864 diff -r 41efa6d38e9b -r 5a4da427c162 a
865 --- a/a Thu Jan 01 00:00:00 1970 +0000
865 --- a/a Thu Jan 01 00:00:00 1970 +0000
866 +++ b/a Thu Jan 01 00:00:00 1970 +0000
866 +++ b/a Thu Jan 01 00:00:00 1970 +0000
867 @@ -1,3 +1,4 @@
867 @@ -1,3 +1,4 @@
868 +foobranch
868 +foobranch
869 expand $Id$
869 expand $Id$
870 do not process $Id:
870 do not process $Id:
871 xxx $
871 xxx $
872
872
873 $ head -n 2 a
873 $ head -n 2 a
874 foobranch
874 foobranch
875 expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
875 expand $Id: a 5a4da427c162 Thu, 01 Jan 1970 00:00:00 +0000 test $
876
876
877 Switch of expansion
877 Switch of expansion
878
878
879 $ hg -q rollback
879 $ hg -q rollback
880 $ hg -q update -C
880 $ hg -q update -C
881
881
882 kwshrink with unknown file u
882 kwshrink with unknown file u
883
883
884 $ cp a u
884 $ cp a u
885 $ hg --verbose kwshrink
885 $ hg --verbose kwshrink
886 overwriting a shrinking keywords
886 overwriting a shrinking keywords
887 overwriting m shrinking keywords
887 overwriting m shrinking keywords
888 overwriting x/a shrinking keywords
888 overwriting x/a shrinking keywords
889
889
890 Keywords shrunk in working directory, but not yet disabled
890 Keywords shrunk in working directory, but not yet disabled
891 - cat shows unexpanded keywords
891 - cat shows unexpanded keywords
892 - hg cat shows expanded keywords
892 - hg cat shows expanded keywords
893
893
894 $ cat a b
894 $ cat a b
895 expand $Id$
895 expand $Id$
896 do not process $Id:
896 do not process $Id:
897 xxx $
897 xxx $
898 $Xinfo$
898 $Xinfo$
899 ignore $Id$
899 ignore $Id$
900 $ hg cat sym a b && echo
900 $ hg cat sym a b && echo
901 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
901 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
902 do not process $Id:
902 do not process $Id:
903 xxx $
903 xxx $
904 $Xinfo: User Name <user@example.com>: firstline $
904 $Xinfo: User Name <user@example.com>: firstline $
905 ignore $Id$
905 ignore $Id$
906 a.*
906 a.*
907
907
908 Now disable keyword expansion
908 Now disable keyword expansion
909
909
910 $ rm "$HGRCPATH"
910 $ rm "$HGRCPATH"
911 $ cat a b
911 $ cat a b
912 expand $Id$
912 expand $Id$
913 do not process $Id:
913 do not process $Id:
914 xxx $
914 xxx $
915 $Xinfo$
915 $Xinfo$
916 ignore $Id$
916 ignore $Id$
917 $ hg cat sym a b && echo
917 $ hg cat sym a b && echo
918 expand $Id$
918 expand $Id$
919 do not process $Id:
919 do not process $Id:
920 xxx $
920 xxx $
921 $Xinfo$
921 $Xinfo$
922 ignore $Id$
922 ignore $Id$
923 a.*
923 a.*
@@ -1,1018 +1,1018 b''
1 $ hg init a
1 $ hg init a
2
2
3 $ cd a
3 $ cd a
4 $ echo a > a
4 $ echo a > a
5 $ hg ci -Ama -d '1 0'
5 $ hg ci -Ama -d '1 0'
6 adding a
6 adding a
7
7
8 $ hg cp a b
8 $ hg cp a b
9 $ hg ci -mb -d '2 0'
9 $ hg ci -mb -d '2 0'
10
10
11 $ mkdir dir
11 $ mkdir dir
12 $ hg mv b dir
12 $ hg mv b dir
13 $ hg ci -mc -d '3 0'
13 $ hg ci -mc -d '3 0'
14
14
15 $ hg mv a b
15 $ hg mv a b
16 $ echo a > d
16 $ echo a > d
17 $ hg add d
17 $ hg add d
18 $ hg ci -md -d '4 0'
18 $ hg ci -md -d '4 0'
19
19
20 $ hg mv dir/b e
20 $ hg mv dir/b e
21 $ hg ci -me -d '5 0'
21 $ hg ci -me -d '5 0'
22
22
23 $ hg log a
23 $ hg log a
24 changeset: 0:8580ff50825a
24 changeset: 0:8580ff50825a
25 user: test
25 user: test
26 date: Thu Jan 01 00:00:01 1970 +0000
26 date: Thu Jan 01 00:00:01 1970 +0000
27 summary: a
27 summary: a
28
28
29
29
30 -f, directory
30 -f, directory
31
31
32 $ hg log -f dir
32 $ hg log -f dir
33 abort: cannot follow nonexistent file: "dir"
33 abort: cannot follow nonexistent file: "dir"
34
34
35 -f, but no args
35 -f, but no args
36
36
37 $ hg log -f
37 $ hg log -f
38 changeset: 4:66c1345dc4f9
38 changeset: 4:66c1345dc4f9
39 tag: tip
39 tag: tip
40 user: test
40 user: test
41 date: Thu Jan 01 00:00:05 1970 +0000
41 date: Thu Jan 01 00:00:05 1970 +0000
42 summary: e
42 summary: e
43
43
44 changeset: 3:7c6c671bb7cc
44 changeset: 3:7c6c671bb7cc
45 user: test
45 user: test
46 date: Thu Jan 01 00:00:04 1970 +0000
46 date: Thu Jan 01 00:00:04 1970 +0000
47 summary: d
47 summary: d
48
48
49 changeset: 2:41dd4284081e
49 changeset: 2:41dd4284081e
50 user: test
50 user: test
51 date: Thu Jan 01 00:00:03 1970 +0000
51 date: Thu Jan 01 00:00:03 1970 +0000
52 summary: c
52 summary: c
53
53
54 changeset: 1:784de7cef101
54 changeset: 1:784de7cef101
55 user: test
55 user: test
56 date: Thu Jan 01 00:00:02 1970 +0000
56 date: Thu Jan 01 00:00:02 1970 +0000
57 summary: b
57 summary: b
58
58
59 changeset: 0:8580ff50825a
59 changeset: 0:8580ff50825a
60 user: test
60 user: test
61 date: Thu Jan 01 00:00:01 1970 +0000
61 date: Thu Jan 01 00:00:01 1970 +0000
62 summary: a
62 summary: a
63
63
64
64
65 one rename
65 one rename
66
66
67 $ hg log -vf a
67 $ hg log -vf a
68 changeset: 0:8580ff50825a
68 changeset: 0:8580ff50825a
69 user: test
69 user: test
70 date: Thu Jan 01 00:00:01 1970 +0000
70 date: Thu Jan 01 00:00:01 1970 +0000
71 files: a
71 files: a
72 description:
72 description:
73 a
73 a
74
74
75
75
76
76
77 many renames
77 many renames
78
78
79 $ hg log -vf e
79 $ hg log -vf e
80 changeset: 4:66c1345dc4f9
80 changeset: 4:66c1345dc4f9
81 tag: tip
81 tag: tip
82 user: test
82 user: test
83 date: Thu Jan 01 00:00:05 1970 +0000
83 date: Thu Jan 01 00:00:05 1970 +0000
84 files: dir/b e
84 files: dir/b e
85 description:
85 description:
86 e
86 e
87
87
88
88
89 changeset: 2:41dd4284081e
89 changeset: 2:41dd4284081e
90 user: test
90 user: test
91 date: Thu Jan 01 00:00:03 1970 +0000
91 date: Thu Jan 01 00:00:03 1970 +0000
92 files: b dir/b
92 files: b dir/b
93 description:
93 description:
94 c
94 c
95
95
96
96
97 changeset: 1:784de7cef101
97 changeset: 1:784de7cef101
98 user: test
98 user: test
99 date: Thu Jan 01 00:00:02 1970 +0000
99 date: Thu Jan 01 00:00:02 1970 +0000
100 files: b
100 files: b
101 description:
101 description:
102 b
102 b
103
103
104
104
105 changeset: 0:8580ff50825a
105 changeset: 0:8580ff50825a
106 user: test
106 user: test
107 date: Thu Jan 01 00:00:01 1970 +0000
107 date: Thu Jan 01 00:00:01 1970 +0000
108 files: a
108 files: a
109 description:
109 description:
110 a
110 a
111
111
112
112
113
113
114
114
115 log -pf dir/b
115 log -pf dir/b
116
116
117 $ hg log -pf dir/b
117 $ hg log -pf dir/b
118 changeset: 2:41dd4284081e
118 changeset: 2:41dd4284081e
119 user: test
119 user: test
120 date: Thu Jan 01 00:00:03 1970 +0000
120 date: Thu Jan 01 00:00:03 1970 +0000
121 summary: c
121 summary: c
122
122
123 diff -r 784de7cef101 -r 41dd4284081e dir/b
123 diff -r 784de7cef101 -r 41dd4284081e dir/b
124 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
124 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
125 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
125 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
126 @@ -0,0 +1,1 @@
126 @@ -0,0 +1,1 @@
127 +a
127 +a
128
128
129 changeset: 1:784de7cef101
129 changeset: 1:784de7cef101
130 user: test
130 user: test
131 date: Thu Jan 01 00:00:02 1970 +0000
131 date: Thu Jan 01 00:00:02 1970 +0000
132 summary: b
132 summary: b
133
133
134 diff -r 8580ff50825a -r 784de7cef101 b
134 diff -r 8580ff50825a -r 784de7cef101 b
135 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
135 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
136 +++ b/b Thu Jan 01 00:00:02 1970 +0000
136 +++ b/b Thu Jan 01 00:00:02 1970 +0000
137 @@ -0,0 +1,1 @@
137 @@ -0,0 +1,1 @@
138 +a
138 +a
139
139
140 changeset: 0:8580ff50825a
140 changeset: 0:8580ff50825a
141 user: test
141 user: test
142 date: Thu Jan 01 00:00:01 1970 +0000
142 date: Thu Jan 01 00:00:01 1970 +0000
143 summary: a
143 summary: a
144
144
145 diff -r 000000000000 -r 8580ff50825a a
145 diff -r 000000000000 -r 8580ff50825a a
146 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
146 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
147 +++ b/a Thu Jan 01 00:00:01 1970 +0000
147 +++ b/a Thu Jan 01 00:00:01 1970 +0000
148 @@ -0,0 +1,1 @@
148 @@ -0,0 +1,1 @@
149 +a
149 +a
150
150
151
151
152 log -vf dir/b
152 log -vf dir/b
153
153
154 $ hg log -vf dir/b
154 $ hg log -vf dir/b
155 changeset: 2:41dd4284081e
155 changeset: 2:41dd4284081e
156 user: test
156 user: test
157 date: Thu Jan 01 00:00:03 1970 +0000
157 date: Thu Jan 01 00:00:03 1970 +0000
158 files: b dir/b
158 files: b dir/b
159 description:
159 description:
160 c
160 c
161
161
162
162
163 changeset: 1:784de7cef101
163 changeset: 1:784de7cef101
164 user: test
164 user: test
165 date: Thu Jan 01 00:00:02 1970 +0000
165 date: Thu Jan 01 00:00:02 1970 +0000
166 files: b
166 files: b
167 description:
167 description:
168 b
168 b
169
169
170
170
171 changeset: 0:8580ff50825a
171 changeset: 0:8580ff50825a
172 user: test
172 user: test
173 date: Thu Jan 01 00:00:01 1970 +0000
173 date: Thu Jan 01 00:00:01 1970 +0000
174 files: a
174 files: a
175 description:
175 description:
176 a
176 a
177
177
178
178
179
179
180
180
181 log copies with --copies
181 log copies with --copies
182
182
183 $ hg log -vC --template '{rev} {file_copies}\n'
183 $ hg log -vC --template '{rev} {file_copies}\n'
184 4 e (dir/b)
184 4 e (dir/b)
185 3 b (a)
185 3 b (a)
186 2 dir/b (b)
186 2 dir/b (b)
187 1 b (a)
187 1 b (a)
188 0
188 0
189
189
190 log copies switch without --copies, with old filecopy template
190 log copies switch without --copies, with old filecopy template
191
191
192 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
192 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
193 4
193 4
194 3
194 3
195 2
195 2
196 1
196 1
197 0
197 0
198
198
199 log copies switch with --copies
199 log copies switch with --copies
200
200
201 $ hg log -vC --template '{rev} {file_copies_switch}\n'
201 $ hg log -vC --template '{rev} {file_copies_switch}\n'
202 4 e (dir/b)
202 4 e (dir/b)
203 3 b (a)
203 3 b (a)
204 2 dir/b (b)
204 2 dir/b (b)
205 1 b (a)
205 1 b (a)
206 0
206 0
207
207
208
208
209 log copies with hardcoded style and with --style=default
209 log copies with hardcoded style and with --style=default
210
210
211 $ hg log -vC -r4
211 $ hg log -vC -r4
212 changeset: 4:66c1345dc4f9
212 changeset: 4:66c1345dc4f9
213 tag: tip
213 tag: tip
214 user: test
214 user: test
215 date: Thu Jan 01 00:00:05 1970 +0000
215 date: Thu Jan 01 00:00:05 1970 +0000
216 files: dir/b e
216 files: dir/b e
217 copies: e (dir/b)
217 copies: e (dir/b)
218 description:
218 description:
219 e
219 e
220
220
221
221
222 $ hg log -vC -r4 --style=default
222 $ hg log -vC -r4 --style=default
223 changeset: 4:66c1345dc4f9
223 changeset: 4:66c1345dc4f9
224 tag: tip
224 tag: tip
225 user: test
225 user: test
226 date: Thu Jan 01 00:00:05 1970 +0000
226 date: Thu Jan 01 00:00:05 1970 +0000
227 files: dir/b e
227 files: dir/b e
228 copies: e (dir/b)
228 copies: e (dir/b)
229 description:
229 description:
230 e
230 e
231
231
232
232
233
233
234
234
235 log copies, non-linear manifest
235 log copies, non-linear manifest
236
236
237 $ hg up -C 3
237 $ hg up -C 3
238 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
238 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 $ hg mv dir/b e
239 $ hg mv dir/b e
240 $ echo foo > foo
240 $ echo foo > foo
241 $ hg ci -Ame2 -d '6 0'
241 $ hg ci -Ame2 -d '6 0'
242 adding foo
242 adding foo
243 created new head
243 created new head
244 $ hg log -v --template '{rev} {file_copies}\n' -r 5
244 $ hg log -v --template '{rev} {file_copies}\n' -r 5
245 5 e (dir/b)
245 5 e (dir/b)
246
246
247
247
248 log copies, execute bit set
248 log copies, execute bit set
249
249
250 $ chmod +x e
250 $ chmod +x e
251 $ hg ci -me3 -d '7 0'
251 $ hg ci -me3 -d '7 0'
252 $ hg log -v --template '{rev} {file_copies}\n' -r 6
252 $ hg log -v --template '{rev} {file_copies}\n' -r 6
253 6
253 6
254
254
255
255
256 log -p d
256 log -p d
257
257
258 $ hg log -pv d
258 $ hg log -pv d
259 changeset: 3:7c6c671bb7cc
259 changeset: 3:7c6c671bb7cc
260 user: test
260 user: test
261 date: Thu Jan 01 00:00:04 1970 +0000
261 date: Thu Jan 01 00:00:04 1970 +0000
262 files: a b d
262 files: a b d
263 description:
263 description:
264 d
264 d
265
265
266
266
267 diff -r 41dd4284081e -r 7c6c671bb7cc d
267 diff -r 41dd4284081e -r 7c6c671bb7cc d
268 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
268 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
269 +++ b/d Thu Jan 01 00:00:04 1970 +0000
269 +++ b/d Thu Jan 01 00:00:04 1970 +0000
270 @@ -0,0 +1,1 @@
270 @@ -0,0 +1,1 @@
271 +a
271 +a
272
272
273
273
274
274
275 log --removed file
275 log --removed file
276
276
277 $ hg log --removed -v a
277 $ hg log --removed -v a
278 changeset: 3:7c6c671bb7cc
278 changeset: 3:7c6c671bb7cc
279 user: test
279 user: test
280 date: Thu Jan 01 00:00:04 1970 +0000
280 date: Thu Jan 01 00:00:04 1970 +0000
281 files: a b d
281 files: a b d
282 description:
282 description:
283 d
283 d
284
284
285
285
286 changeset: 0:8580ff50825a
286 changeset: 0:8580ff50825a
287 user: test
287 user: test
288 date: Thu Jan 01 00:00:01 1970 +0000
288 date: Thu Jan 01 00:00:01 1970 +0000
289 files: a
289 files: a
290 description:
290 description:
291 a
291 a
292
292
293
293
294
294
295 log --removed revrange file
295 log --removed revrange file
296
296
297 $ hg log --removed -v -r0:2 a
297 $ hg log --removed -v -r0:2 a
298 changeset: 0:8580ff50825a
298 changeset: 0:8580ff50825a
299 user: test
299 user: test
300 date: Thu Jan 01 00:00:01 1970 +0000
300 date: Thu Jan 01 00:00:01 1970 +0000
301 files: a
301 files: a
302 description:
302 description:
303 a
303 a
304
304
305
305
306
306
307
307
308 log --follow tests
308 log --follow tests
309
309
310 $ hg init ../follow
310 $ hg init ../follow
311 $ cd ../follow
311 $ cd ../follow
312
312
313 $ echo base > base
313 $ echo base > base
314 $ hg ci -Ambase -d '1 0'
314 $ hg ci -Ambase -d '1 0'
315 adding base
315 adding base
316
316
317 $ echo r1 >> base
317 $ echo r1 >> base
318 $ hg ci -Amr1 -d '1 0'
318 $ hg ci -Amr1 -d '1 0'
319 $ echo r2 >> base
319 $ echo r2 >> base
320 $ hg ci -Amr2 -d '1 0'
320 $ hg ci -Amr2 -d '1 0'
321
321
322 $ hg up -C 1
322 $ hg up -C 1
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
324 $ echo b1 > b1
324 $ echo b1 > b1
325 $ hg ci -Amb1 -d '1 0'
325 $ hg ci -Amb1 -d '1 0'
326 adding b1
326 adding b1
327 created new head
327 created new head
328
328
329
329
330 log -f
330 log -f
331
331
332 $ hg log -f
332 $ hg log -f
333 changeset: 3:e62f78d544b4
333 changeset: 3:e62f78d544b4
334 tag: tip
334 tag: tip
335 parent: 1:3d5bf5654eda
335 parent: 1:3d5bf5654eda
336 user: test
336 user: test
337 date: Thu Jan 01 00:00:01 1970 +0000
337 date: Thu Jan 01 00:00:01 1970 +0000
338 summary: b1
338 summary: b1
339
339
340 changeset: 1:3d5bf5654eda
340 changeset: 1:3d5bf5654eda
341 user: test
341 user: test
342 date: Thu Jan 01 00:00:01 1970 +0000
342 date: Thu Jan 01 00:00:01 1970 +0000
343 summary: r1
343 summary: r1
344
344
345 changeset: 0:67e992f2c4f3
345 changeset: 0:67e992f2c4f3
346 user: test
346 user: test
347 date: Thu Jan 01 00:00:01 1970 +0000
347 date: Thu Jan 01 00:00:01 1970 +0000
348 summary: base
348 summary: base
349
349
350
350
351
351
352 log -f -r 1:tip
352 log -f -r 1:tip
353
353
354 $ hg up -C 0
354 $ hg up -C 0
355 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
355 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
356 $ echo b2 > b2
356 $ echo b2 > b2
357 $ hg ci -Amb2 -d '1 0'
357 $ hg ci -Amb2 -d '1 0'
358 adding b2
358 adding b2
359 created new head
359 created new head
360 $ hg log -f -r 1:tip
360 $ hg log -f -r 1:tip
361 changeset: 1:3d5bf5654eda
361 changeset: 1:3d5bf5654eda
362 user: test
362 user: test
363 date: Thu Jan 01 00:00:01 1970 +0000
363 date: Thu Jan 01 00:00:01 1970 +0000
364 summary: r1
364 summary: r1
365
365
366 changeset: 2:60c670bf5b30
366 changeset: 2:60c670bf5b30
367 user: test
367 user: test
368 date: Thu Jan 01 00:00:01 1970 +0000
368 date: Thu Jan 01 00:00:01 1970 +0000
369 summary: r2
369 summary: r2
370
370
371 changeset: 3:e62f78d544b4
371 changeset: 3:e62f78d544b4
372 parent: 1:3d5bf5654eda
372 parent: 1:3d5bf5654eda
373 user: test
373 user: test
374 date: Thu Jan 01 00:00:01 1970 +0000
374 date: Thu Jan 01 00:00:01 1970 +0000
375 summary: b1
375 summary: b1
376
376
377
377
378
378
379 log -r . with two parents
379 log -r . with two parents
380
380
381 $ hg up -C 3
381 $ hg up -C 3
382 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
382 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
383 $ hg merge tip
383 $ hg merge tip
384 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
384 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 (branch merge, don't forget to commit)
385 (branch merge, don't forget to commit)
386 $ hg log -r .
386 $ hg log -r .
387 changeset: 3:e62f78d544b4
387 changeset: 3:e62f78d544b4
388 parent: 1:3d5bf5654eda
388 parent: 1:3d5bf5654eda
389 user: test
389 user: test
390 date: Thu Jan 01 00:00:01 1970 +0000
390 date: Thu Jan 01 00:00:01 1970 +0000
391 summary: b1
391 summary: b1
392
392
393
393
394
394
395 log -r . with one parent
395 log -r . with one parent
396
396
397 $ hg ci -mm12 -d '1 0'
397 $ hg ci -mm12 -d '1 0'
398 $ hg log -r .
398 $ hg log -r .
399 changeset: 5:302e9dd6890d
399 changeset: 5:302e9dd6890d
400 tag: tip
400 tag: tip
401 parent: 3:e62f78d544b4
401 parent: 3:e62f78d544b4
402 parent: 4:ddb82e70d1a1
402 parent: 4:ddb82e70d1a1
403 user: test
403 user: test
404 date: Thu Jan 01 00:00:01 1970 +0000
404 date: Thu Jan 01 00:00:01 1970 +0000
405 summary: m12
405 summary: m12
406
406
407
407
408 $ echo postm >> b1
408 $ echo postm >> b1
409 $ hg ci -Amb1.1 -d'1 0'
409 $ hg ci -Amb1.1 -d'1 0'
410
410
411
411
412 log --follow-first
412 log --follow-first
413
413
414 $ hg log --follow-first
414 $ hg log --follow-first
415 changeset: 6:2404bbcab562
415 changeset: 6:2404bbcab562
416 tag: tip
416 tag: tip
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:01 1970 +0000
418 date: Thu Jan 01 00:00:01 1970 +0000
419 summary: b1.1
419 summary: b1.1
420
420
421 changeset: 5:302e9dd6890d
421 changeset: 5:302e9dd6890d
422 parent: 3:e62f78d544b4
422 parent: 3:e62f78d544b4
423 parent: 4:ddb82e70d1a1
423 parent: 4:ddb82e70d1a1
424 user: test
424 user: test
425 date: Thu Jan 01 00:00:01 1970 +0000
425 date: Thu Jan 01 00:00:01 1970 +0000
426 summary: m12
426 summary: m12
427
427
428 changeset: 3:e62f78d544b4
428 changeset: 3:e62f78d544b4
429 parent: 1:3d5bf5654eda
429 parent: 1:3d5bf5654eda
430 user: test
430 user: test
431 date: Thu Jan 01 00:00:01 1970 +0000
431 date: Thu Jan 01 00:00:01 1970 +0000
432 summary: b1
432 summary: b1
433
433
434 changeset: 1:3d5bf5654eda
434 changeset: 1:3d5bf5654eda
435 user: test
435 user: test
436 date: Thu Jan 01 00:00:01 1970 +0000
436 date: Thu Jan 01 00:00:01 1970 +0000
437 summary: r1
437 summary: r1
438
438
439 changeset: 0:67e992f2c4f3
439 changeset: 0:67e992f2c4f3
440 user: test
440 user: test
441 date: Thu Jan 01 00:00:01 1970 +0000
441 date: Thu Jan 01 00:00:01 1970 +0000
442 summary: base
442 summary: base
443
443
444
444
445
445
446 log -P 2
446 log -P 2
447
447
448 $ hg log -P 2
448 $ hg log -P 2
449 changeset: 6:2404bbcab562
449 changeset: 6:2404bbcab562
450 tag: tip
450 tag: tip
451 user: test
451 user: test
452 date: Thu Jan 01 00:00:01 1970 +0000
452 date: Thu Jan 01 00:00:01 1970 +0000
453 summary: b1.1
453 summary: b1.1
454
454
455 changeset: 5:302e9dd6890d
455 changeset: 5:302e9dd6890d
456 parent: 3:e62f78d544b4
456 parent: 3:e62f78d544b4
457 parent: 4:ddb82e70d1a1
457 parent: 4:ddb82e70d1a1
458 user: test
458 user: test
459 date: Thu Jan 01 00:00:01 1970 +0000
459 date: Thu Jan 01 00:00:01 1970 +0000
460 summary: m12
460 summary: m12
461
461
462 changeset: 4:ddb82e70d1a1
462 changeset: 4:ddb82e70d1a1
463 parent: 0:67e992f2c4f3
463 parent: 0:67e992f2c4f3
464 user: test
464 user: test
465 date: Thu Jan 01 00:00:01 1970 +0000
465 date: Thu Jan 01 00:00:01 1970 +0000
466 summary: b2
466 summary: b2
467
467
468 changeset: 3:e62f78d544b4
468 changeset: 3:e62f78d544b4
469 parent: 1:3d5bf5654eda
469 parent: 1:3d5bf5654eda
470 user: test
470 user: test
471 date: Thu Jan 01 00:00:01 1970 +0000
471 date: Thu Jan 01 00:00:01 1970 +0000
472 summary: b1
472 summary: b1
473
473
474
474
475
475
476 log -r tip -p --git
476 log -r tip -p --git
477
477
478 $ hg log -r tip -p --git
478 $ hg log -r tip -p --git
479 changeset: 6:2404bbcab562
479 changeset: 6:2404bbcab562
480 tag: tip
480 tag: tip
481 user: test
481 user: test
482 date: Thu Jan 01 00:00:01 1970 +0000
482 date: Thu Jan 01 00:00:01 1970 +0000
483 summary: b1.1
483 summary: b1.1
484
484
485 diff --git a/b1 b/b1
485 diff --git a/b1 b/b1
486 --- a/b1
486 --- a/b1
487 +++ b/b1
487 +++ b/b1
488 @@ -1,1 +1,2 @@
488 @@ -1,1 +1,2 @@
489 b1
489 b1
490 +postm
490 +postm
491
491
492
492
493
493
494 log -r ""
494 log -r ""
495
495
496 $ hg log -r ''
496 $ hg log -r ''
497 hg: parse error: empty query
497 hg: parse error: empty query
498
498
499 log -r <some unknown node id>
499 log -r <some unknown node id>
500
500
501 $ hg log -r 1000000000000000000000000000000000000000
501 $ hg log -r 1000000000000000000000000000000000000000
502 abort: unknown revision '1000000000000000000000000000000000000000'!
502 abort: unknown revision '1000000000000000000000000000000000000000'!
503
503
504 log -k r1
504 log -k r1
505
505
506 $ hg log -k r1
506 $ hg log -k r1
507 changeset: 1:3d5bf5654eda
507 changeset: 1:3d5bf5654eda
508 user: test
508 user: test
509 date: Thu Jan 01 00:00:01 1970 +0000
509 date: Thu Jan 01 00:00:01 1970 +0000
510 summary: r1
510 summary: r1
511
511
512
512
513
513
514 log -d -1
514 log -d -1
515
515
516 $ hg log -d -1
516 $ hg log -d -1
517
517
518
518
519 log -p -l2 --color=always
519 log -p -l2 --color=always
520
520
521 $ hg --config extensions.color= --config color.mode=ansi \
521 $ hg --config extensions.color= --config color.mode=ansi \
522 > log -p -l2 --color=always
522 > log -p -l2 --color=always
523 changeset: 6:2404bbcab562
523 changeset: 6:2404bbcab562
524 tag: tip
524 tag: tip
525 user: test
525 user: test
526 date: Thu Jan 01 00:00:01 1970 +0000
526 date: Thu Jan 01 00:00:01 1970 +0000
527 summary: b1.1
527 summary: b1.1
528
528
529 diff -r 302e9dd6890d -r 2404bbcab562 b1
529 diff -r 302e9dd6890d -r 2404bbcab562 b1
530 --- a/b1 Thu Jan 01 00:00:01 1970 +0000
530 --- a/b1 Thu Jan 01 00:00:01 1970 +0000
531 +++ b/b1 Thu Jan 01 00:00:01 1970 +0000
531 +++ b/b1 Thu Jan 01 00:00:01 1970 +0000
532 @@ -1,1 +1,2 @@
532 @@ -1,1 +1,2 @@
533 b1
533 b1
534 +postm
534 +postm
535
535
536 changeset: 5:302e9dd6890d
536 changeset: 5:302e9dd6890d
537 parent: 3:e62f78d544b4
537 parent: 3:e62f78d544b4
538 parent: 4:ddb82e70d1a1
538 parent: 4:ddb82e70d1a1
539 user: test
539 user: test
540 date: Thu Jan 01 00:00:01 1970 +0000
540 date: Thu Jan 01 00:00:01 1970 +0000
541 summary: m12
541 summary: m12
542
542
543 diff -r e62f78d544b4 -r 302e9dd6890d b2
543 diff -r e62f78d544b4 -r 302e9dd6890d b2
544 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
544 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
545 +++ b/b2 Thu Jan 01 00:00:01 1970 +0000
545 +++ b/b2 Thu Jan 01 00:00:01 1970 +0000
546 @@ -0,0 +1,1 @@
546 @@ -0,0 +1,1 @@
547 +b2
547 +b2
548
548
549
549
550
550
551 log -r tip --stat
551 log -r tip --stat
552
552
553 $ hg log -r tip --stat
553 $ hg log -r tip --stat
554 changeset: 6:2404bbcab562
554 changeset: 6:2404bbcab562
555 tag: tip
555 tag: tip
556 user: test
556 user: test
557 date: Thu Jan 01 00:00:01 1970 +0000
557 date: Thu Jan 01 00:00:01 1970 +0000
558 summary: b1.1
558 summary: b1.1
559
559
560 b1 | 1 +
560 b1 | 1 +
561 1 files changed, 1 insertions(+), 0 deletions(-)
561 1 files changed, 1 insertions(+), 0 deletions(-)
562
562
563
563
564 $ cd ..
564 $ cd ..
565
565
566 $ hg init usertest
566 $ hg init usertest
567 $ cd usertest
567 $ cd usertest
568
568
569 $ echo a > a
569 $ echo a > a
570 $ hg ci -A -m "a" -u "User One <user1@example.org>"
570 $ hg ci -A -m "a" -u "User One <user1@example.org>"
571 adding a
571 adding a
572 $ echo b > b
572 $ echo b > b
573 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
573 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
574 adding b
574 adding b
575
575
576 $ hg log -u "User One <user1@example.org>"
576 $ hg log -u "User One <user1@example.org>"
577 changeset: 0:29a4c94f1924
577 changeset: 0:29a4c94f1924
578 user: User One <user1@example.org>
578 user: User One <user1@example.org>
579 date: Thu Jan 01 00:00:00 1970 +0000
579 date: Thu Jan 01 00:00:00 1970 +0000
580 summary: a
580 summary: a
581
581
582 $ hg log -u "user1" -u "user2"
582 $ hg log -u "user1" -u "user2"
583 changeset: 1:e834b5e69c0e
583 changeset: 1:e834b5e69c0e
584 tag: tip
584 tag: tip
585 user: User Two <user2@example.org>
585 user: User Two <user2@example.org>
586 date: Thu Jan 01 00:00:00 1970 +0000
586 date: Thu Jan 01 00:00:00 1970 +0000
587 summary: b
587 summary: b
588
588
589 changeset: 0:29a4c94f1924
589 changeset: 0:29a4c94f1924
590 user: User One <user1@example.org>
590 user: User One <user1@example.org>
591 date: Thu Jan 01 00:00:00 1970 +0000
591 date: Thu Jan 01 00:00:00 1970 +0000
592 summary: a
592 summary: a
593
593
594 $ hg log -u "user3"
594 $ hg log -u "user3"
595
595
596 $ cd ..
596 $ cd ..
597
597
598 $ hg init branches
598 $ hg init branches
599 $ cd branches
599 $ cd branches
600
600
601 $ echo a > a
601 $ echo a > a
602 $ hg ci -A -m "commit on default"
602 $ hg ci -A -m "commit on default"
603 adding a
603 adding a
604 $ hg branch test
604 $ hg branch test
605 marked working directory as branch test
605 marked working directory as branch test
606 $ echo b > b
606 $ echo b > b
607 $ hg ci -A -m "commit on test"
607 $ hg ci -A -m "commit on test"
608 adding b
608 adding b
609
609
610 $ hg up default
610 $ hg up default
611 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
611 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
612 $ echo c > c
612 $ echo c > c
613 $ hg ci -A -m "commit on default"
613 $ hg ci -A -m "commit on default"
614 adding c
614 adding c
615 $ hg up test
615 $ hg up test
616 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
616 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
617 $ echo c > c
617 $ echo c > c
618 $ hg ci -A -m "commit on test"
618 $ hg ci -A -m "commit on test"
619 adding c
619 adding c
620
620
621
621
622 log -b default
622 log -b default
623
623
624 $ hg log -b default
624 $ hg log -b default
625 changeset: 2:c3a4f03cc9a7
625 changeset: 2:c3a4f03cc9a7
626 parent: 0:24427303d56f
626 parent: 0:24427303d56f
627 user: test
627 user: test
628 date: Thu Jan 01 00:00:00 1970 +0000
628 date: Thu Jan 01 00:00:00 1970 +0000
629 summary: commit on default
629 summary: commit on default
630
630
631 changeset: 0:24427303d56f
631 changeset: 0:24427303d56f
632 user: test
632 user: test
633 date: Thu Jan 01 00:00:00 1970 +0000
633 date: Thu Jan 01 00:00:00 1970 +0000
634 summary: commit on default
634 summary: commit on default
635
635
636
636
637
637
638 log -b test
638 log -b test
639
639
640 $ hg log -b test
640 $ hg log -b test
641 changeset: 3:f5d8de11c2e2
641 changeset: 3:f5d8de11c2e2
642 branch: test
642 branch: test
643 tag: tip
643 tag: tip
644 parent: 1:d32277701ccb
644 parent: 1:d32277701ccb
645 user: test
645 user: test
646 date: Thu Jan 01 00:00:00 1970 +0000
646 date: Thu Jan 01 00:00:00 1970 +0000
647 summary: commit on test
647 summary: commit on test
648
648
649 changeset: 1:d32277701ccb
649 changeset: 1:d32277701ccb
650 branch: test
650 branch: test
651 user: test
651 user: test
652 date: Thu Jan 01 00:00:00 1970 +0000
652 date: Thu Jan 01 00:00:00 1970 +0000
653 summary: commit on test
653 summary: commit on test
654
654
655
655
656
656
657 log -b dummy
657 log -b dummy
658
658
659 $ hg log -b dummy
659 $ hg log -b dummy
660 abort: unknown revision 'dummy'!
660 abort: unknown revision 'dummy'!
661
661
662
662
663 log -b .
663 log -b .
664
664
665 $ hg log -b .
665 $ hg log -b .
666 changeset: 3:f5d8de11c2e2
666 changeset: 3:f5d8de11c2e2
667 branch: test
667 branch: test
668 tag: tip
668 tag: tip
669 parent: 1:d32277701ccb
669 parent: 1:d32277701ccb
670 user: test
670 user: test
671 date: Thu Jan 01 00:00:00 1970 +0000
671 date: Thu Jan 01 00:00:00 1970 +0000
672 summary: commit on test
672 summary: commit on test
673
673
674 changeset: 1:d32277701ccb
674 changeset: 1:d32277701ccb
675 branch: test
675 branch: test
676 user: test
676 user: test
677 date: Thu Jan 01 00:00:00 1970 +0000
677 date: Thu Jan 01 00:00:00 1970 +0000
678 summary: commit on test
678 summary: commit on test
679
679
680
680
681
681
682 log -b default -b test
682 log -b default -b test
683
683
684 $ hg log -b default -b test
684 $ hg log -b default -b test
685 changeset: 3:f5d8de11c2e2
685 changeset: 3:f5d8de11c2e2
686 branch: test
686 branch: test
687 tag: tip
687 tag: tip
688 parent: 1:d32277701ccb
688 parent: 1:d32277701ccb
689 user: test
689 user: test
690 date: Thu Jan 01 00:00:00 1970 +0000
690 date: Thu Jan 01 00:00:00 1970 +0000
691 summary: commit on test
691 summary: commit on test
692
692
693 changeset: 2:c3a4f03cc9a7
693 changeset: 2:c3a4f03cc9a7
694 parent: 0:24427303d56f
694 parent: 0:24427303d56f
695 user: test
695 user: test
696 date: Thu Jan 01 00:00:00 1970 +0000
696 date: Thu Jan 01 00:00:00 1970 +0000
697 summary: commit on default
697 summary: commit on default
698
698
699 changeset: 1:d32277701ccb
699 changeset: 1:d32277701ccb
700 branch: test
700 branch: test
701 user: test
701 user: test
702 date: Thu Jan 01 00:00:00 1970 +0000
702 date: Thu Jan 01 00:00:00 1970 +0000
703 summary: commit on test
703 summary: commit on test
704
704
705 changeset: 0:24427303d56f
705 changeset: 0:24427303d56f
706 user: test
706 user: test
707 date: Thu Jan 01 00:00:00 1970 +0000
707 date: Thu Jan 01 00:00:00 1970 +0000
708 summary: commit on default
708 summary: commit on default
709
709
710
710
711
711
712 log -b default -b .
712 log -b default -b .
713
713
714 $ hg log -b default -b .
714 $ hg log -b default -b .
715 changeset: 3:f5d8de11c2e2
715 changeset: 3:f5d8de11c2e2
716 branch: test
716 branch: test
717 tag: tip
717 tag: tip
718 parent: 1:d32277701ccb
718 parent: 1:d32277701ccb
719 user: test
719 user: test
720 date: Thu Jan 01 00:00:00 1970 +0000
720 date: Thu Jan 01 00:00:00 1970 +0000
721 summary: commit on test
721 summary: commit on test
722
722
723 changeset: 2:c3a4f03cc9a7
723 changeset: 2:c3a4f03cc9a7
724 parent: 0:24427303d56f
724 parent: 0:24427303d56f
725 user: test
725 user: test
726 date: Thu Jan 01 00:00:00 1970 +0000
726 date: Thu Jan 01 00:00:00 1970 +0000
727 summary: commit on default
727 summary: commit on default
728
728
729 changeset: 1:d32277701ccb
729 changeset: 1:d32277701ccb
730 branch: test
730 branch: test
731 user: test
731 user: test
732 date: Thu Jan 01 00:00:00 1970 +0000
732 date: Thu Jan 01 00:00:00 1970 +0000
733 summary: commit on test
733 summary: commit on test
734
734
735 changeset: 0:24427303d56f
735 changeset: 0:24427303d56f
736 user: test
736 user: test
737 date: Thu Jan 01 00:00:00 1970 +0000
737 date: Thu Jan 01 00:00:00 1970 +0000
738 summary: commit on default
738 summary: commit on default
739
739
740
740
741
741
742 log -b . -b test
742 log -b . -b test
743
743
744 $ hg log -b . -b test
744 $ hg log -b . -b test
745 changeset: 3:f5d8de11c2e2
745 changeset: 3:f5d8de11c2e2
746 branch: test
746 branch: test
747 tag: tip
747 tag: tip
748 parent: 1:d32277701ccb
748 parent: 1:d32277701ccb
749 user: test
749 user: test
750 date: Thu Jan 01 00:00:00 1970 +0000
750 date: Thu Jan 01 00:00:00 1970 +0000
751 summary: commit on test
751 summary: commit on test
752
752
753 changeset: 1:d32277701ccb
753 changeset: 1:d32277701ccb
754 branch: test
754 branch: test
755 user: test
755 user: test
756 date: Thu Jan 01 00:00:00 1970 +0000
756 date: Thu Jan 01 00:00:00 1970 +0000
757 summary: commit on test
757 summary: commit on test
758
758
759
759
760
760
761 log -b 2
761 log -b 2
762
762
763 $ hg log -b 2
763 $ hg log -b 2
764 changeset: 2:c3a4f03cc9a7
764 changeset: 2:c3a4f03cc9a7
765 parent: 0:24427303d56f
765 parent: 0:24427303d56f
766 user: test
766 user: test
767 date: Thu Jan 01 00:00:00 1970 +0000
767 date: Thu Jan 01 00:00:00 1970 +0000
768 summary: commit on default
768 summary: commit on default
769
769
770 changeset: 0:24427303d56f
770 changeset: 0:24427303d56f
771 user: test
771 user: test
772 date: Thu Jan 01 00:00:00 1970 +0000
772 date: Thu Jan 01 00:00:00 1970 +0000
773 summary: commit on default
773 summary: commit on default
774
774
775
775
776
776
777 log -p --cwd dir (in subdir)
777 log -p --cwd dir (in subdir)
778
778
779 $ mkdir dir
779 $ mkdir dir
780 $ hg log -p --cwd dir
780 $ hg log -p --cwd dir
781 changeset: 3:f5d8de11c2e2
781 changeset: 3:f5d8de11c2e2
782 branch: test
782 branch: test
783 tag: tip
783 tag: tip
784 parent: 1:d32277701ccb
784 parent: 1:d32277701ccb
785 user: test
785 user: test
786 date: Thu Jan 01 00:00:00 1970 +0000
786 date: Thu Jan 01 00:00:00 1970 +0000
787 summary: commit on test
787 summary: commit on test
788
788
789 diff -r d32277701ccb -r f5d8de11c2e2 c
789 diff -r d32277701ccb -r f5d8de11c2e2 c
790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
790 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
791 +++ b/c Thu Jan 01 00:00:00 1970 +0000
791 +++ b/c Thu Jan 01 00:00:00 1970 +0000
792 @@ -0,0 +1,1 @@
792 @@ -0,0 +1,1 @@
793 +c
793 +c
794
794
795 changeset: 2:c3a4f03cc9a7
795 changeset: 2:c3a4f03cc9a7
796 parent: 0:24427303d56f
796 parent: 0:24427303d56f
797 user: test
797 user: test
798 date: Thu Jan 01 00:00:00 1970 +0000
798 date: Thu Jan 01 00:00:00 1970 +0000
799 summary: commit on default
799 summary: commit on default
800
800
801 diff -r 24427303d56f -r c3a4f03cc9a7 c
801 diff -r 24427303d56f -r c3a4f03cc9a7 c
802 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
802 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
803 +++ b/c Thu Jan 01 00:00:00 1970 +0000
803 +++ b/c Thu Jan 01 00:00:00 1970 +0000
804 @@ -0,0 +1,1 @@
804 @@ -0,0 +1,1 @@
805 +c
805 +c
806
806
807 changeset: 1:d32277701ccb
807 changeset: 1:d32277701ccb
808 branch: test
808 branch: test
809 user: test
809 user: test
810 date: Thu Jan 01 00:00:00 1970 +0000
810 date: Thu Jan 01 00:00:00 1970 +0000
811 summary: commit on test
811 summary: commit on test
812
812
813 diff -r 24427303d56f -r d32277701ccb b
813 diff -r 24427303d56f -r d32277701ccb b
814 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
814 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
815 +++ b/b Thu Jan 01 00:00:00 1970 +0000
815 +++ b/b Thu Jan 01 00:00:00 1970 +0000
816 @@ -0,0 +1,1 @@
816 @@ -0,0 +1,1 @@
817 +b
817 +b
818
818
819 changeset: 0:24427303d56f
819 changeset: 0:24427303d56f
820 user: test
820 user: test
821 date: Thu Jan 01 00:00:00 1970 +0000
821 date: Thu Jan 01 00:00:00 1970 +0000
822 summary: commit on default
822 summary: commit on default
823
823
824 diff -r 000000000000 -r 24427303d56f a
824 diff -r 000000000000 -r 24427303d56f a
825 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
825 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
826 +++ b/a Thu Jan 01 00:00:00 1970 +0000
826 +++ b/a Thu Jan 01 00:00:00 1970 +0000
827 @@ -0,0 +1,1 @@
827 @@ -0,0 +1,1 @@
828 +a
828 +a
829
829
830
830
831
831
832 log -p -R repo
832 log -p -R repo
833
833
834 $ cd dir
834 $ cd dir
835 $ hg log -p -R .. ../a
835 $ hg log -p -R .. ../a
836 changeset: 0:24427303d56f
836 changeset: 0:24427303d56f
837 user: test
837 user: test
838 date: Thu Jan 01 00:00:00 1970 +0000
838 date: Thu Jan 01 00:00:00 1970 +0000
839 summary: commit on default
839 summary: commit on default
840
840
841 diff -r 000000000000 -r 24427303d56f a
841 diff -r 000000000000 -r 24427303d56f a
842 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
842 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
843 +++ b/a Thu Jan 01 00:00:00 1970 +0000
843 +++ b/a Thu Jan 01 00:00:00 1970 +0000
844 @@ -0,0 +1,1 @@
844 @@ -0,0 +1,1 @@
845 +a
845 +a
846
846
847
847
848
848
849 $ cd ..
849 $ cd ..
850 $ hg init follow2
850 $ hg init follow2
851 $ cd follow2
851 $ cd follow2
852
852
853
853
854 # Build the following history:
854 # Build the following history:
855 # tip - o - x - o - x - x
855 # tip - o - x - o - x - x
856 # \ /
856 # \ /
857 # o - o - o - x
857 # o - o - o - x
858 # \ /
858 # \ /
859 # o
859 # o
860 #
860 #
861
861
862 # Where "o" is a revision containing "foo" and
862 # Where "o" is a revision containing "foo" and
863 # "x" is a revision without "foo"
863 # "x" is a revision without "foo"
864
864
865 $ touch init
865 $ touch init
866 $ hg ci -A -m "init, unrelated"
866 $ hg ci -A -m "init, unrelated"
867 adding init
867 adding init
868 $ echo 'foo' > init
868 $ echo 'foo' > init
869 $ hg ci -m "change, unrelated"
869 $ hg ci -m "change, unrelated"
870 $ echo 'foo' > foo
870 $ echo 'foo' > foo
871 $ hg ci -A -m "add unrelated old foo"
871 $ hg ci -A -m "add unrelated old foo"
872 adding foo
872 adding foo
873 $ hg rm foo
873 $ hg rm foo
874 $ hg ci -m "delete foo, unrelated"
874 $ hg ci -m "delete foo, unrelated"
875 $ echo 'related' > foo
875 $ echo 'related' > foo
876 $ hg ci -A -m "add foo, related"
876 $ hg ci -A -m "add foo, related"
877 adding foo
877 adding foo
878
878
879 $ hg up 0
879 $ hg up 0
880 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
880 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
881 $ touch branch
881 $ touch branch
882 $ hg ci -A -m "first branch, unrelated"
882 $ hg ci -A -m "first branch, unrelated"
883 adding branch
883 adding branch
884 created new head
884 created new head
885 $ touch foo
885 $ touch foo
886 $ hg ci -A -m "create foo, related"
886 $ hg ci -A -m "create foo, related"
887 adding foo
887 adding foo
888 $ echo 'change' > foo
888 $ echo 'change' > foo
889 $ hg ci -m "change foo, related"
889 $ hg ci -m "change foo, related"
890
890
891 $ hg up 6
891 $ hg up 6
892 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
892 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
893 $ echo 'change foo in branch' > foo
893 $ echo 'change foo in branch' > foo
894 $ hg ci -m "change foo in branch, related"
894 $ hg ci -m "change foo in branch, related"
895 created new head
895 created new head
896 $ hg merge 7
896 $ hg merge 7
897 merging foo
897 merging foo
898 warning: conflicts during merge.
898 warning: conflicts during merge.
899 merging foo failed!
899 merging foo failed!
900 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
900 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
901 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
901 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
902 $ echo 'merge 1' > foo
902 $ echo 'merge 1' > foo
903 $ hg resolve -m foo
903 $ hg resolve -m foo
904 $ hg ci -m "First merge, related"
904 $ hg ci -m "First merge, related"
905
905
906 $ hg merge 4
906 $ hg merge 4
907 merging foo
907 merging foo
908 warning: conflicts during merge.
908 warning: conflicts during merge.
909 merging foo failed!
909 merging foo failed!
910 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
910 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
911 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
911 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
912 $ echo 'merge 2' > foo
912 $ echo 'merge 2' > foo
913 $ hg resolve -m foo
913 $ hg resolve -m foo
914 $ hg ci -m "Last merge, related"
914 $ hg ci -m "Last merge, related"
915
915
916 $ hg --config "extensions.graphlog=" glog
916 $ hg --config "extensions.graphlog=" glog
917 @ changeset: 10:4dae8563d2c5
917 @ changeset: 10:4dae8563d2c5
918 |\ tag: tip
918 |\ tag: tip
919 | | parent: 9:7b35701b003e
919 | | parent: 9:7b35701b003e
920 | | parent: 4:88176d361b69
920 | | parent: 4:88176d361b69
921 | | user: test
921 | | user: test
922 | | date: Thu Jan 01 00:00:00 1970 +0000
922 | | date: Thu Jan 01 00:00:00 1970 +0000
923 | | summary: Last merge, related
923 | | summary: Last merge, related
924 | |
924 | |
925 | o changeset: 9:7b35701b003e
925 | o changeset: 9:7b35701b003e
926 | |\ parent: 8:e5416ad8a855
926 | |\ parent: 8:e5416ad8a855
927 | | | parent: 7:87fe3144dcfa
927 | | | parent: 7:87fe3144dcfa
928 | | | user: test
928 | | | user: test
929 | | | date: Thu Jan 01 00:00:00 1970 +0000
929 | | | date: Thu Jan 01 00:00:00 1970 +0000
930 | | | summary: First merge, related
930 | | | summary: First merge, related
931 | | |
931 | | |
932 | | o changeset: 8:e5416ad8a855
932 | | o changeset: 8:e5416ad8a855
933 | | | parent: 6:dc6c325fe5ee
933 | | | parent: 6:dc6c325fe5ee
934 | | | user: test
934 | | | user: test
935 | | | date: Thu Jan 01 00:00:00 1970 +0000
935 | | | date: Thu Jan 01 00:00:00 1970 +0000
936 | | | summary: change foo in branch, related
936 | | | summary: change foo in branch, related
937 | | |
937 | | |
938 | o | changeset: 7:87fe3144dcfa
938 | o | changeset: 7:87fe3144dcfa
939 | |/ user: test
939 | |/ user: test
940 | | date: Thu Jan 01 00:00:00 1970 +0000
940 | | date: Thu Jan 01 00:00:00 1970 +0000
941 | | summary: change foo, related
941 | | summary: change foo, related
942 | |
942 | |
943 | o changeset: 6:dc6c325fe5ee
943 | o changeset: 6:dc6c325fe5ee
944 | | user: test
944 | | user: test
945 | | date: Thu Jan 01 00:00:00 1970 +0000
945 | | date: Thu Jan 01 00:00:00 1970 +0000
946 | | summary: create foo, related
946 | | summary: create foo, related
947 | |
947 | |
948 | o changeset: 5:73db34516eb9
948 | o changeset: 5:73db34516eb9
949 | | parent: 0:e87515fd044a
949 | | parent: 0:e87515fd044a
950 | | user: test
950 | | user: test
951 | | date: Thu Jan 01 00:00:00 1970 +0000
951 | | date: Thu Jan 01 00:00:00 1970 +0000
952 | | summary: first branch, unrelated
952 | | summary: first branch, unrelated
953 | |
953 | |
954 o | changeset: 4:88176d361b69
954 o | changeset: 4:88176d361b69
955 | | user: test
955 | | user: test
956 | | date: Thu Jan 01 00:00:00 1970 +0000
956 | | date: Thu Jan 01 00:00:00 1970 +0000
957 | | summary: add foo, related
957 | | summary: add foo, related
958 | |
958 | |
959 o | changeset: 3:dd78ae4afb56
959 o | changeset: 3:dd78ae4afb56
960 | | user: test
960 | | user: test
961 | | date: Thu Jan 01 00:00:00 1970 +0000
961 | | date: Thu Jan 01 00:00:00 1970 +0000
962 | | summary: delete foo, unrelated
962 | | summary: delete foo, unrelated
963 | |
963 | |
964 o | changeset: 2:c4c64aedf0f7
964 o | changeset: 2:c4c64aedf0f7
965 | | user: test
965 | | user: test
966 | | date: Thu Jan 01 00:00:00 1970 +0000
966 | | date: Thu Jan 01 00:00:00 1970 +0000
967 | | summary: add unrelated old foo
967 | | summary: add unrelated old foo
968 | |
968 | |
969 o | changeset: 1:e5faa7440653
969 o | changeset: 1:e5faa7440653
970 |/ user: test
970 |/ user: test
971 | date: Thu Jan 01 00:00:00 1970 +0000
971 | date: Thu Jan 01 00:00:00 1970 +0000
972 | summary: change, unrelated
972 | summary: change, unrelated
973 |
973 |
974 o changeset: 0:e87515fd044a
974 o changeset: 0:e87515fd044a
975 user: test
975 user: test
976 date: Thu Jan 01 00:00:00 1970 +0000
976 date: Thu Jan 01 00:00:00 1970 +0000
977 summary: init, unrelated
977 summary: init, unrelated
978
978
979
979
980 $ hg --traceback log -f foo
980 $ hg --traceback log -f foo
981 changeset: 10:4dae8563d2c5
981 changeset: 10:4dae8563d2c5
982 tag: tip
982 tag: tip
983 parent: 9:7b35701b003e
983 parent: 9:7b35701b003e
984 parent: 4:88176d361b69
984 parent: 4:88176d361b69
985 user: test
985 user: test
986 date: Thu Jan 01 00:00:00 1970 +0000
986 date: Thu Jan 01 00:00:00 1970 +0000
987 summary: Last merge, related
987 summary: Last merge, related
988
988
989 changeset: 9:7b35701b003e
989 changeset: 9:7b35701b003e
990 parent: 8:e5416ad8a855
990 parent: 8:e5416ad8a855
991 parent: 7:87fe3144dcfa
991 parent: 7:87fe3144dcfa
992 user: test
992 user: test
993 date: Thu Jan 01 00:00:00 1970 +0000
993 date: Thu Jan 01 00:00:00 1970 +0000
994 summary: First merge, related
994 summary: First merge, related
995
995
996 changeset: 8:e5416ad8a855
996 changeset: 8:e5416ad8a855
997 parent: 6:dc6c325fe5ee
997 parent: 6:dc6c325fe5ee
998 user: test
998 user: test
999 date: Thu Jan 01 00:00:00 1970 +0000
999 date: Thu Jan 01 00:00:00 1970 +0000
1000 summary: change foo in branch, related
1000 summary: change foo in branch, related
1001
1001
1002 changeset: 7:87fe3144dcfa
1002 changeset: 7:87fe3144dcfa
1003 user: test
1003 user: test
1004 date: Thu Jan 01 00:00:00 1970 +0000
1004 date: Thu Jan 01 00:00:00 1970 +0000
1005 summary: change foo, related
1005 summary: change foo, related
1006
1006
1007 changeset: 6:dc6c325fe5ee
1007 changeset: 6:dc6c325fe5ee
1008 user: test
1008 user: test
1009 date: Thu Jan 01 00:00:00 1970 +0000
1009 date: Thu Jan 01 00:00:00 1970 +0000
1010 summary: create foo, related
1010 summary: create foo, related
1011
1011
1012 changeset: 4:88176d361b69
1012 changeset: 4:88176d361b69
1013 user: test
1013 user: test
1014 date: Thu Jan 01 00:00:00 1970 +0000
1014 date: Thu Jan 01 00:00:00 1970 +0000
1015 summary: add foo, related
1015 summary: add foo, related
1016
1016
1017
1017
1018 $ exit 0
1018 $ exit 0
@@ -1,111 +1,111 b''
1 # Make sure that the internal merge tools (internal:fail, internal:local, and
1 # Make sure that the internal merge tools (internal:fail, internal:local, and
2 # internal:other) are used when matched by a merge-pattern in hgrc
2 # internal:other) are used when matched by a merge-pattern in hgrc
3
3
4 Make sure HGMERGE doesn't interfere with the test:
4 Make sure HGMERGE doesn't interfere with the test:
5
5
6 $ unset HGMERGE
6 $ unset HGMERGE
7
7
8 $ hg init
8 $ hg init
9
9
10 Initial file contents:
10 Initial file contents:
11
11
12 $ echo "line 1" > f
12 $ echo "line 1" > f
13 $ echo "line 2" >> f
13 $ echo "line 2" >> f
14 $ echo "line 3" >> f
14 $ echo "line 3" >> f
15 $ hg ci -Am "revision 0"
15 $ hg ci -Am "revision 0"
16 adding f
16 adding f
17
17
18 $ cat f
18 $ cat f
19 line 1
19 line 1
20 line 2
20 line 2
21 line 3
21 line 3
22
22
23 Branch 1: editing line 1:
23 Branch 1: editing line 1:
24
24
25 $ sed 's/line 1/first line/' f > f.new
25 $ sed 's/line 1/first line/' f > f.new
26 $ mv f.new f
26 $ mv f.new f
27 $ hg ci -Am "edited first line"
27 $ hg ci -Am "edited first line"
28
28
29 Branch 2: editing line 3:
29 Branch 2: editing line 3:
30
30
31 $ hg update 0
31 $ hg update 0
32 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 $ sed 's/line 3/third line/' f > f.new
33 $ sed 's/line 3/third line/' f > f.new
34 $ mv f.new f
34 $ mv f.new f
35 $ hg ci -Am "edited third line"
35 $ hg ci -Am "edited third line"
36 created new head
36 created new head
37
37
38 Merge using internal:fail tool:
38 Merge using internal:fail tool:
39
39
40 $ echo "[merge-patterns]" > .hg/hgrc
40 $ echo "[merge-patterns]" > .hg/hgrc
41 $ echo "* = internal:fail" >> .hg/hgrc
41 $ echo "* = internal:fail" >> .hg/hgrc
42
42
43 $ hg merge
43 $ hg merge
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
44 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
45 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
46
46
47 $ cat f
47 $ cat f
48 line 1
48 line 1
49 line 2
49 line 2
50 third line
50 third line
51
51
52 $ hg stat
52 $ hg stat
53 M f
53 M f
54
54
55 Merge using internal:local tool:
55 Merge using internal:local tool:
56
56
57 $ hg update -C 2
57 $ hg update -C 2
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
59 $ sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new
59 $ sed 's/internal:fail/internal:local/' .hg/hgrc > .hg/hgrc.new
60 $ mv .hg/hgrc.new .hg/hgrc
60 $ mv .hg/hgrc.new .hg/hgrc
61
61
62 $ hg merge
62 $ hg merge
63 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
63 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
64 (branch merge, don't forget to commit)
64 (branch merge, don't forget to commit)
65
65
66 $ cat f
66 $ cat f
67 line 1
67 line 1
68 line 2
68 line 2
69 third line
69 third line
70
70
71 $ hg stat
71 $ hg stat
72 M f
72 M f
73
73
74 Merge using internal:other tool:
74 Merge using internal:other tool:
75
75
76 $ hg update -C 2
76 $ hg update -C 2
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new
78 $ sed 's/internal:local/internal:other/' .hg/hgrc > .hg/hgrc.new
79 $ mv .hg/hgrc.new .hg/hgrc
79 $ mv .hg/hgrc.new .hg/hgrc
80
80
81 $ hg merge
81 $ hg merge
82 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
82 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
83 (branch merge, don't forget to commit)
83 (branch merge, don't forget to commit)
84
84
85 $ cat f
85 $ cat f
86 first line
86 first line
87 line 2
87 line 2
88 line 3
88 line 3
89
89
90 $ hg stat
90 $ hg stat
91 M f
91 M f
92
92
93 Merge using default tool:
93 Merge using default tool:
94
94
95 $ hg update -C 2
95 $ hg update -C 2
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ rm .hg/hgrc
97 $ rm .hg/hgrc
98
98
99 $ hg merge
99 $ hg merge
100 merging f
100 merging f
101 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
101 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
102 (branch merge, don't forget to commit)
102 (branch merge, don't forget to commit)
103
103
104 $ cat f
104 $ cat f
105 first line
105 first line
106 line 2
106 line 2
107 third line
107 third line
108
108
109 $ hg stat
109 $ hg stat
110 M f
110 M f
111
111
@@ -1,547 +1,547 b''
1 # revision 0
1 # revision 0
2 adding f
2 adding f
3 # revision 1
3 # revision 1
4 # revision 2
4 # revision 2
5 created new head
5 created new head
6 # revision 3 - simple to merge
6 # revision 3 - simple to merge
7 created new head
7 created new head
8
8
9
9
10 Tool selection
10 Tool selection
11
11
12 # default is internal merge:
12 # default is internal merge:
13 [merge-tools]
13 [merge-tools]
14 # hg update -C 1
14 # hg update -C 1
15 # hg merge -r 2
15 # hg merge -r 2
16 merging f
16 merging f
17 warning: conflicts during merge.
17 warning: conflicts during merge.
18 merging f failed!
18 merging f failed!
19 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
19 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
20 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
20 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
21 # cat f
21 # cat f
22 <<<<<<< local
22 <<<<<<< local
23 revision 1
23 revision 1
24 =======
24 =======
25 revision 2
25 revision 2
26 >>>>>>> other
26 >>>>>>> other
27 space
27 space
28 # hg stat
28 # hg stat
29 M f
29 M f
30 ? f.orig
30 ? f.orig
31
31
32 # simplest hgrc using false for merge:
32 # simplest hgrc using false for merge:
33 [merge-tools]
33 [merge-tools]
34 false.whatever=
34 false.whatever=
35 # hg update -C 1
35 # hg update -C 1
36 # hg merge -r 2
36 # hg merge -r 2
37 merging f
37 merging f
38 merging f failed!
38 merging f failed!
39 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
39 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
40 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
40 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
41 # cat f
41 # cat f
42 revision 1
42 revision 1
43 space
43 space
44 # hg stat
44 # hg stat
45 M f
45 M f
46 ? f.orig
46 ? f.orig
47
47
48 # true with higher .priority gets precedence:
48 # true with higher .priority gets precedence:
49 [merge-tools]
49 [merge-tools]
50 false.whatever=
50 false.whatever=
51 true.priority=1
51 true.priority=1
52 # hg update -C 1
52 # hg update -C 1
53 # hg merge -r 2
53 # hg merge -r 2
54 merging f
54 merging f
55 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
55 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
56 (branch merge, don't forget to commit)
56 (branch merge, don't forget to commit)
57 # cat f
57 # cat f
58 revision 1
58 revision 1
59 space
59 space
60 # hg stat
60 # hg stat
61 M f
61 M f
62
62
63 # unless lowered on command line:
63 # unless lowered on command line:
64 [merge-tools]
64 [merge-tools]
65 false.whatever=
65 false.whatever=
66 true.priority=1
66 true.priority=1
67 # hg update -C 1
67 # hg update -C 1
68 # hg merge -r 2 --config merge-tools.true.priority=-7
68 # hg merge -r 2 --config merge-tools.true.priority=-7
69 merging f
69 merging f
70 merging f failed!
70 merging f failed!
71 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
71 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
72 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
72 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
73 # cat f
73 # cat f
74 revision 1
74 revision 1
75 space
75 space
76 # hg stat
76 # hg stat
77 M f
77 M f
78 ? f.orig
78 ? f.orig
79
79
80 # or false set higher on command line:
80 # or false set higher on command line:
81 [merge-tools]
81 [merge-tools]
82 false.whatever=
82 false.whatever=
83 true.priority=1
83 true.priority=1
84 # hg update -C 1
84 # hg update -C 1
85 # hg merge -r 2 --config merge-tools.false.priority=117
85 # hg merge -r 2 --config merge-tools.false.priority=117
86 merging f
86 merging f
87 merging f failed!
87 merging f failed!
88 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
88 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
89 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
89 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
90 # cat f
90 # cat f
91 revision 1
91 revision 1
92 space
92 space
93 # hg stat
93 # hg stat
94 M f
94 M f
95 ? f.orig
95 ? f.orig
96
96
97 # or true.executable not found in PATH:
97 # or true.executable not found in PATH:
98 [merge-tools]
98 [merge-tools]
99 false.whatever=
99 false.whatever=
100 true.priority=1
100 true.priority=1
101 # hg update -C 1
101 # hg update -C 1
102 # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
102 # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool
103 merging f
103 merging f
104 merging f failed!
104 merging f failed!
105 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
105 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
106 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
106 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
107 # cat f
107 # cat f
108 revision 1
108 revision 1
109 space
109 space
110 # hg stat
110 # hg stat
111 M f
111 M f
112 ? f.orig
112 ? f.orig
113
113
114 # or true.executable with bogus path:
114 # or true.executable with bogus path:
115 [merge-tools]
115 [merge-tools]
116 false.whatever=
116 false.whatever=
117 true.priority=1
117 true.priority=1
118 # hg update -C 1
118 # hg update -C 1
119 # hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
119 # hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool
120 merging f
120 merging f
121 merging f failed!
121 merging f failed!
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
122 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
123 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
123 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
124 # cat f
124 # cat f
125 revision 1
125 revision 1
126 space
126 space
127 # hg stat
127 # hg stat
128 M f
128 M f
129 ? f.orig
129 ? f.orig
130
130
131 # but true.executable set to cat found in PATH works:
131 # but true.executable set to cat found in PATH works:
132 [merge-tools]
132 [merge-tools]
133 false.whatever=
133 false.whatever=
134 true.priority=1
134 true.priority=1
135 true.executable=cat
135 true.executable=cat
136 # hg update -C 1
136 # hg update -C 1
137 # hg merge -r 2
137 # hg merge -r 2
138 revision 1
138 revision 1
139 space
139 space
140 revision 0
140 revision 0
141 space
141 space
142 revision 2
142 revision 2
143 space
143 space
144 merging f
144 merging f
145 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
145 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
146 (branch merge, don't forget to commit)
146 (branch merge, don't forget to commit)
147 # cat f
147 # cat f
148 revision 1
148 revision 1
149 space
149 space
150 # hg stat
150 # hg stat
151 M f
151 M f
152
152
153 # and true.executable set to cat with path works:
153 # and true.executable set to cat with path works:
154 [merge-tools]
154 [merge-tools]
155 false.whatever=
155 false.whatever=
156 true.priority=1
156 true.priority=1
157 true.executable=cat
157 true.executable=cat
158 # hg update -C 1
158 # hg update -C 1
159 # hg merge -r 2 --config merge-tools.true.executable=cat
159 # hg merge -r 2 --config merge-tools.true.executable=cat
160 revision 1
160 revision 1
161 space
161 space
162 revision 0
162 revision 0
163 space
163 space
164 revision 2
164 revision 2
165 space
165 space
166 merging f
166 merging f
167 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
167 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
168 (branch merge, don't forget to commit)
168 (branch merge, don't forget to commit)
169 # cat f
169 # cat f
170 revision 1
170 revision 1
171 space
171 space
172 # hg stat
172 # hg stat
173 M f
173 M f
174
174
175
175
176 Tool selection and merge-patterns
176 Tool selection and merge-patterns
177
177
178 # merge-patterns specifies new tool false:
178 # merge-patterns specifies new tool false:
179 [merge-tools]
179 [merge-tools]
180 false.whatever=
180 false.whatever=
181 true.priority=1
181 true.priority=1
182 true.executable=cat
182 true.executable=cat
183 # hg update -C 1
183 # hg update -C 1
184 # hg merge -r 2 --config merge-patterns.f=false
184 # hg merge -r 2 --config merge-patterns.f=false
185 merging f
185 merging f
186 merging f failed!
186 merging f failed!
187 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
187 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
188 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
188 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
189 # cat f
189 # cat f
190 revision 1
190 revision 1
191 space
191 space
192 # hg stat
192 # hg stat
193 M f
193 M f
194 ? f.orig
194 ? f.orig
195
195
196 # merge-patterns specifies executable not found in PATH and gets warning:
196 # merge-patterns specifies executable not found in PATH and gets warning:
197 [merge-tools]
197 [merge-tools]
198 false.whatever=
198 false.whatever=
199 true.priority=1
199 true.priority=1
200 true.executable=cat
200 true.executable=cat
201 # hg update -C 1
201 # hg update -C 1
202 # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
202 # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool
203 couldn't find merge tool true specified for f
203 couldn't find merge tool true specified for f
204 merging f
204 merging f
205 merging f failed!
205 merging f failed!
206 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
206 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
207 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
207 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
208 # cat f
208 # cat f
209 revision 1
209 revision 1
210 space
210 space
211 # hg stat
211 # hg stat
212 M f
212 M f
213 ? f.orig
213 ? f.orig
214
214
215 # merge-patterns specifies executable with bogus path and gets warning:
215 # merge-patterns specifies executable with bogus path and gets warning:
216 [merge-tools]
216 [merge-tools]
217 false.whatever=
217 false.whatever=
218 true.priority=1
218 true.priority=1
219 true.executable=cat
219 true.executable=cat
220 # hg update -C 1
220 # hg update -C 1
221 # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
221 # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool
222 couldn't find merge tool true specified for f
222 couldn't find merge tool true specified for f
223 merging f
223 merging f
224 merging f failed!
224 merging f failed!
225 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
225 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
226 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
226 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
227 # cat f
227 # cat f
228 revision 1
228 revision 1
229 space
229 space
230 # hg stat
230 # hg stat
231 M f
231 M f
232 ? f.orig
232 ? f.orig
233
233
234
234
235 ui.merge overrules priority
235 ui.merge overrules priority
236
236
237 # ui.merge specifies false:
237 # ui.merge specifies false:
238 [merge-tools]
238 [merge-tools]
239 false.whatever=
239 false.whatever=
240 true.priority=1
240 true.priority=1
241 true.executable=cat
241 true.executable=cat
242 # hg update -C 1
242 # hg update -C 1
243 # hg merge -r 2 --config ui.merge=false
243 # hg merge -r 2 --config ui.merge=false
244 merging f
244 merging f
245 merging f failed!
245 merging f failed!
246 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
246 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
247 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
247 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
248 # cat f
248 # cat f
249 revision 1
249 revision 1
250 space
250 space
251 # hg stat
251 # hg stat
252 M f
252 M f
253 ? f.orig
253 ? f.orig
254
254
255 # ui.merge specifies internal:fail:
255 # ui.merge specifies internal:fail:
256 [merge-tools]
256 [merge-tools]
257 false.whatever=
257 false.whatever=
258 true.priority=1
258 true.priority=1
259 true.executable=cat
259 true.executable=cat
260 # hg update -C 1
260 # hg update -C 1
261 # hg merge -r 2 --config ui.merge=internal:fail
261 # hg merge -r 2 --config ui.merge=internal:fail
262 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
262 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
263 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
263 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
264 # cat f
264 # cat f
265 revision 1
265 revision 1
266 space
266 space
267 # hg stat
267 # hg stat
268 M f
268 M f
269
269
270 # ui.merge specifies internal:local:
270 # ui.merge specifies internal:local:
271 [merge-tools]
271 [merge-tools]
272 false.whatever=
272 false.whatever=
273 true.priority=1
273 true.priority=1
274 true.executable=cat
274 true.executable=cat
275 # hg update -C 1
275 # hg update -C 1
276 # hg merge -r 2 --config ui.merge=internal:local
276 # hg merge -r 2 --config ui.merge=internal:local
277 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
277 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
278 (branch merge, don't forget to commit)
278 (branch merge, don't forget to commit)
279 # cat f
279 # cat f
280 revision 1
280 revision 1
281 space
281 space
282 # hg stat
282 # hg stat
283 M f
283 M f
284
284
285 # ui.merge specifies internal:other:
285 # ui.merge specifies internal:other:
286 [merge-tools]
286 [merge-tools]
287 false.whatever=
287 false.whatever=
288 true.priority=1
288 true.priority=1
289 true.executable=cat
289 true.executable=cat
290 # hg update -C 1
290 # hg update -C 1
291 # hg merge -r 2 --config ui.merge=internal:other
291 # hg merge -r 2 --config ui.merge=internal:other
292 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
292 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
293 (branch merge, don't forget to commit)
293 (branch merge, don't forget to commit)
294 # cat f
294 # cat f
295 revision 2
295 revision 2
296 space
296 space
297 # hg stat
297 # hg stat
298 M f
298 M f
299
299
300 # ui.merge specifies internal:prompt:
300 # ui.merge specifies internal:prompt:
301 [merge-tools]
301 [merge-tools]
302 false.whatever=
302 false.whatever=
303 true.priority=1
303 true.priority=1
304 true.executable=cat
304 true.executable=cat
305 # hg update -C 1
305 # hg update -C 1
306 # hg merge -r 2 --config ui.merge=internal:prompt
306 # hg merge -r 2 --config ui.merge=internal:prompt
307 no tool found to merge f
307 no tool found to merge f
308 keep (l)ocal or take (o)ther? l
308 keep (l)ocal or take (o)ther? l
309 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
309 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
310 (branch merge, don't forget to commit)
310 (branch merge, don't forget to commit)
311 # cat f
311 # cat f
312 revision 1
312 revision 1
313 space
313 space
314 # hg stat
314 # hg stat
315 M f
315 M f
316
316
317 # ui.merge specifies internal:dump:
317 # ui.merge specifies internal:dump:
318 [merge-tools]
318 [merge-tools]
319 false.whatever=
319 false.whatever=
320 true.priority=1
320 true.priority=1
321 true.executable=cat
321 true.executable=cat
322 # hg update -C 1
322 # hg update -C 1
323 # hg merge -r 2 --config ui.merge=internal:dump
323 # hg merge -r 2 --config ui.merge=internal:dump
324 merging f
324 merging f
325 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
325 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
326 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
326 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
327 # cat f
327 # cat f
328 revision 1
328 revision 1
329 space
329 space
330 # hg stat
330 # hg stat
331 M f
331 M f
332 ? f.base
332 ? f.base
333 ? f.local
333 ? f.local
334 ? f.orig
334 ? f.orig
335 ? f.other
335 ? f.other
336
336
337 f.base:
337 f.base:
338 revision 0
338 revision 0
339 space
339 space
340 f.local:
340 f.local:
341 revision 1
341 revision 1
342 space
342 space
343 f.other:
343 f.other:
344 revision 2
344 revision 2
345 space
345 space
346
346
347 # ui.merge specifies internal:other but is overruled by pattern for false:
347 # ui.merge specifies internal:other but is overruled by pattern for false:
348 [merge-tools]
348 [merge-tools]
349 false.whatever=
349 false.whatever=
350 true.priority=1
350 true.priority=1
351 true.executable=cat
351 true.executable=cat
352 # hg update -C 1
352 # hg update -C 1
353 # hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
353 # hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
354 merging f
354 merging f
355 merging f failed!
355 merging f failed!
356 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
356 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
357 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
357 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
358 # cat f
358 # cat f
359 revision 1
359 revision 1
360 space
360 space
361 # hg stat
361 # hg stat
362 M f
362 M f
363 ? f.orig
363 ? f.orig
364
364
365
365
366 Premerge
366 Premerge
367
367
368 # Default is silent simplemerge:
368 # Default is silent simplemerge:
369 [merge-tools]
369 [merge-tools]
370 false.whatever=
370 false.whatever=
371 true.priority=1
371 true.priority=1
372 true.executable=cat
372 true.executable=cat
373 # hg update -C 1
373 # hg update -C 1
374 # hg merge -r 3
374 # hg merge -r 3
375 merging f
375 merging f
376 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
376 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
377 (branch merge, don't forget to commit)
377 (branch merge, don't forget to commit)
378 # cat f
378 # cat f
379 revision 1
379 revision 1
380 space
380 space
381 revision 3
381 revision 3
382 # hg stat
382 # hg stat
383 M f
383 M f
384
384
385 # .premerge=True is same:
385 # .premerge=True is same:
386 [merge-tools]
386 [merge-tools]
387 false.whatever=
387 false.whatever=
388 true.priority=1
388 true.priority=1
389 true.executable=cat
389 true.executable=cat
390 # hg update -C 1
390 # hg update -C 1
391 # hg merge -r 3 --config merge-tools.true.premerge=True
391 # hg merge -r 3 --config merge-tools.true.premerge=True
392 merging f
392 merging f
393 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
393 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
394 (branch merge, don't forget to commit)
394 (branch merge, don't forget to commit)
395 # cat f
395 # cat f
396 revision 1
396 revision 1
397 space
397 space
398 revision 3
398 revision 3
399 # hg stat
399 # hg stat
400 M f
400 M f
401
401
402 # .premerge=False executes merge-tool:
402 # .premerge=False executes merge-tool:
403 [merge-tools]
403 [merge-tools]
404 false.whatever=
404 false.whatever=
405 true.priority=1
405 true.priority=1
406 true.executable=cat
406 true.executable=cat
407 # hg update -C 1
407 # hg update -C 1
408 # hg merge -r 3 --config merge-tools.true.premerge=False
408 # hg merge -r 3 --config merge-tools.true.premerge=False
409 revision 1
409 revision 1
410 space
410 space
411 revision 0
411 revision 0
412 space
412 space
413 revision 0
413 revision 0
414 space
414 space
415 revision 3
415 revision 3
416 merging f
416 merging f
417 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
417 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
418 (branch merge, don't forget to commit)
418 (branch merge, don't forget to commit)
419 # cat f
419 # cat f
420 revision 1
420 revision 1
421 space
421 space
422 # hg stat
422 # hg stat
423 M f
423 M f
424
424
425
425
426 Tool execution
426 Tool execution
427
427
428 # set tools.args explicit to include $base $local $other $output:
428 # set tools.args explicit to include $base $local $other $output:
429 [merge-tools]
429 [merge-tools]
430 false.whatever=
430 false.whatever=
431 true.priority=1
431 true.priority=1
432 true.executable=cat
432 true.executable=cat
433 # hg update -C 1
433 # hg update -C 1
434 ==> ... <==
434 ==> ... <==
435 revision 0
435 revision 0
436 space
436 space
437
437
438 ==> ... <==
438 ==> ... <==
439 revision 1
439 revision 1
440 space
440 space
441
441
442 ==> ... <==
442 ==> ... <==
443 revision 2
443 revision 2
444 space
444 space
445
445
446 ==> ... <==
446 ==> ... <==
447 revision 1
447 revision 1
448 space
448 space
449 merging f
449 merging f
450 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
450 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
451 (branch merge, don't forget to commit)
451 (branch merge, don't forget to commit)
452 # cat f
452 # cat f
453 revision 1
453 revision 1
454 space
454 space
455 # hg stat
455 # hg stat
456 M f
456 M f
457
457
458 # Merge with "echo mergeresult > $local":
458 # Merge with "echo mergeresult > $local":
459 [merge-tools]
459 [merge-tools]
460 false.whatever=
460 false.whatever=
461 true.priority=1
461 true.priority=1
462 true.executable=cat
462 true.executable=cat
463 # hg update -C 1
463 # hg update -C 1
464 merging f
464 merging f
465 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
465 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
466 (branch merge, don't forget to commit)
466 (branch merge, don't forget to commit)
467 # cat f
467 # cat f
468 mergeresult
468 mergeresult
469 # hg stat
469 # hg stat
470 M f
470 M f
471
471
472 # - and $local is the file f:
472 # - and $local is the file f:
473 [merge-tools]
473 [merge-tools]
474 false.whatever=
474 false.whatever=
475 true.priority=1
475 true.priority=1
476 true.executable=cat
476 true.executable=cat
477 # hg update -C 1
477 # hg update -C 1
478 merging f
478 merging f
479 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
479 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
480 (branch merge, don't forget to commit)
480 (branch merge, don't forget to commit)
481 # cat f
481 # cat f
482 mergeresult
482 mergeresult
483 # hg stat
483 # hg stat
484 M f
484 M f
485
485
486 # Merge with "echo mergeresult > $output" - the variable is a bit magic:
486 # Merge with "echo mergeresult > $output" - the variable is a bit magic:
487 [merge-tools]
487 [merge-tools]
488 false.whatever=
488 false.whatever=
489 true.priority=1
489 true.priority=1
490 true.executable=cat
490 true.executable=cat
491 # hg update -C 1
491 # hg update -C 1
492 merging f
492 merging f
493 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
493 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
494 (branch merge, don't forget to commit)
494 (branch merge, don't forget to commit)
495 # cat f
495 # cat f
496 mergeresult
496 mergeresult
497 # hg stat
497 # hg stat
498 M f
498 M f
499
499
500 # Merge using tool with a path that must be quoted:
500 # Merge using tool with a path that must be quoted:
501 [merge-tools]
501 [merge-tools]
502 false.whatever=
502 false.whatever=
503 true.priority=1
503 true.priority=1
504 true.executable=cat
504 true.executable=cat
505 # hg update -C 1
505 # hg update -C 1
506 merging f
506 merging f
507 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
507 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
508 (branch merge, don't forget to commit)
508 (branch merge, don't forget to commit)
509 # cat f
509 # cat f
510 revision 0
510 revision 0
511 space
511 space
512 revision 1
512 revision 1
513 space
513 space
514 revision 2
514 revision 2
515 space
515 space
516 # hg stat
516 # hg stat
517 M f
517 M f
518
518
519
519
520 Merge post-processing
520 Merge post-processing
521
521
522 # cat is a bad merge-tool and doesn't change:
522 # cat is a bad merge-tool and doesn't change:
523 [merge-tools]
523 [merge-tools]
524 false.whatever=
524 false.whatever=
525 true.priority=1
525 true.priority=1
526 true.executable=cat
526 true.executable=cat
527 # hg update -C 1
527 # hg update -C 1
528 # hg merge -y -r 2 --config merge-tools.true.checkchanged=1
528 # hg merge -y -r 2 --config merge-tools.true.checkchanged=1
529 revision 1
529 revision 1
530 space
530 space
531 revision 0
531 revision 0
532 space
532 space
533 revision 2
533 revision 2
534 space
534 space
535 merging f
535 merging f
536 output file f appears unchanged
536 output file f appears unchanged
537 was merge successful (yn)? n
537 was merge successful (yn)? n
538 merging f failed!
538 merging f failed!
539 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
539 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
540 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
540 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
541 # cat f
541 # cat f
542 revision 1
542 revision 1
543 space
543 space
544 # hg stat
544 # hg stat
545 M f
545 M f
546 ? f.orig
546 ? f.orig
547
547
@@ -1,143 +1,143 b''
1 initial
1 initial
2 $ hg init test-a
2 $ hg init test-a
3 $ cd test-a
3 $ cd test-a
4 $ cat >test.txt <<"EOF"
4 $ cat >test.txt <<"EOF"
5 > 1
5 > 1
6 > 2
6 > 2
7 > 3
7 > 3
8 > EOF
8 > EOF
9 $ hg add test.txt
9 $ hg add test.txt
10 $ hg commit -m "Initial"
10 $ hg commit -m "Initial"
11
11
12 clone
12 clone
13 $ cd ..
13 $ cd ..
14 $ hg clone test-a test-b
14 $ hg clone test-a test-b
15 updating to branch default
15 updating to branch default
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17
17
18 change test-a
18 change test-a
19 $ cd test-a
19 $ cd test-a
20 $ cat >test.txt <<"EOF"
20 $ cat >test.txt <<"EOF"
21 > one
21 > one
22 > two
22 > two
23 > three
23 > three
24 > EOF
24 > EOF
25 $ hg commit -m "Numbers as words"
25 $ hg commit -m "Numbers as words"
26
26
27 change test-b
27 change test-b
28 $ cd ../test-b
28 $ cd ../test-b
29 $ cat >test.txt <<"EOF"
29 $ cat >test.txt <<"EOF"
30 > 1
30 > 1
31 > 2.5
31 > 2.5
32 > 3
32 > 3
33 > EOF
33 > EOF
34 $ hg commit -m "2 -> 2.5"
34 $ hg commit -m "2 -> 2.5"
35
35
36 now pull and merge from test-a
36 now pull and merge from test-a
37 $ hg pull ../test-a
37 $ hg pull ../test-a
38 pulling from ../test-a
38 pulling from ../test-a
39 searching for changes
39 searching for changes
40 adding changesets
40 adding changesets
41 adding manifests
41 adding manifests
42 adding file changes
42 adding file changes
43 added 1 changesets with 1 changes to 1 files (+1 heads)
43 added 1 changesets with 1 changes to 1 files (+1 heads)
44 (run 'hg heads' to see heads, 'hg merge' to merge)
44 (run 'hg heads' to see heads, 'hg merge' to merge)
45 $ hg merge
45 $ hg merge
46 merging test.txt
46 merging test.txt
47 warning: conflicts during merge.
47 warning: conflicts during merge.
48 merging test.txt failed!
48 merging test.txt failed!
49 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
49 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
50 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
50 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
51 resolve conflict
51 resolve conflict
52 $ cat >test.txt <<"EOF"
52 $ cat >test.txt <<"EOF"
53 > one
53 > one
54 > two-point-five
54 > two-point-five
55 > three
55 > three
56 > EOF
56 > EOF
57 $ rm -f *.orig
57 $ rm -f *.orig
58 $ hg resolve -m test.txt
58 $ hg resolve -m test.txt
59 $ hg commit -m "Merge 1"
59 $ hg commit -m "Merge 1"
60
60
61 change test-a again
61 change test-a again
62 $ cd ../test-a
62 $ cd ../test-a
63 $ cat >test.txt <<"EOF"
63 $ cat >test.txt <<"EOF"
64 > one
64 > one
65 > two-point-one
65 > two-point-one
66 > three
66 > three
67 > EOF
67 > EOF
68 $ hg commit -m "two -> two-point-one"
68 $ hg commit -m "two -> two-point-one"
69
69
70 pull and merge from test-a again
70 pull and merge from test-a again
71 $ cd ../test-b
71 $ cd ../test-b
72 $ hg pull ../test-a
72 $ hg pull ../test-a
73 pulling from ../test-a
73 pulling from ../test-a
74 searching for changes
74 searching for changes
75 adding changesets
75 adding changesets
76 adding manifests
76 adding manifests
77 adding file changes
77 adding file changes
78 added 1 changesets with 1 changes to 1 files (+1 heads)
78 added 1 changesets with 1 changes to 1 files (+1 heads)
79 (run 'hg heads' to see heads, 'hg merge' to merge)
79 (run 'hg heads' to see heads, 'hg merge' to merge)
80 $ hg merge --debug
80 $ hg merge --debug
81 searching for copies back to rev 1
81 searching for copies back to rev 1
82 resolving manifests
82 resolving manifests
83 overwrite None partial False
83 overwrite None partial False
84 ancestor 96b70246a118 local 50c3a7e29886+ remote 40d11a4173a8
84 ancestor 96b70246a118 local 50c3a7e29886+ remote 40d11a4173a8
85 test.txt: versions differ -> m
85 test.txt: versions differ -> m
86 preserving test.txt for resolve of test.txt
86 preserving test.txt for resolve of test.txt
87 updating: test.txt 1/1 files (100.00%)
87 updating: test.txt 1/1 files (100.00%)
88 picked tool 'internal:merge' for test.txt (binary False symlink False)
88 picked tool 'internal:merge' for test.txt (binary False symlink False)
89 merging test.txt
89 merging test.txt
90 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
90 my test.txt@50c3a7e29886+ other test.txt@40d11a4173a8 ancestor test.txt@96b70246a118
91 warning: conflicts during merge.
91 warning: conflicts during merge.
92 merging test.txt failed!
92 merging test.txt failed!
93 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
93 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
94 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
94 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
95
95
96 $ cat test.txt
96 $ cat test.txt
97 one
97 one
98 <<<<<<< local
98 <<<<<<< local
99 two-point-five
99 two-point-five
100 =======
100 =======
101 two-point-one
101 two-point-one
102 >>>>>>> other
102 >>>>>>> other
103 three
103 three
104
104
105 $ hg debugindex .hg/store/data/test.txt.i
105 $ hg debugindex .hg/store/data/test.txt.i
106 rev offset length base linkrev nodeid p1 p2
106 rev offset length base linkrev nodeid p1 p2
107 0 0 7 0 0 01365c4cca56 000000000000 000000000000
107 0 0 7 0 0 01365c4cca56 000000000000 000000000000
108 1 7 9 1 1 7b013192566a 01365c4cca56 000000000000
108 1 7 9 1 1 7b013192566a 01365c4cca56 000000000000
109 2 16 15 2 2 8fe46a3eb557 01365c4cca56 000000000000
109 2 16 15 2 2 8fe46a3eb557 01365c4cca56 000000000000
110 3 31 27 2 3 fc3148072371 7b013192566a 8fe46a3eb557
110 3 31 27 2 3 fc3148072371 7b013192566a 8fe46a3eb557
111 4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000
111 4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000
112
112
113 $ hg log
113 $ hg log
114 changeset: 4:40d11a4173a8
114 changeset: 4:40d11a4173a8
115 tag: tip
115 tag: tip
116 parent: 2:96b70246a118
116 parent: 2:96b70246a118
117 user: test
117 user: test
118 date: Thu Jan 01 00:00:00 1970 +0000
118 date: Thu Jan 01 00:00:00 1970 +0000
119 summary: two -> two-point-one
119 summary: two -> two-point-one
120
120
121 changeset: 3:50c3a7e29886
121 changeset: 3:50c3a7e29886
122 parent: 1:d1e159716d41
122 parent: 1:d1e159716d41
123 parent: 2:96b70246a118
123 parent: 2:96b70246a118
124 user: test
124 user: test
125 date: Thu Jan 01 00:00:00 1970 +0000
125 date: Thu Jan 01 00:00:00 1970 +0000
126 summary: Merge 1
126 summary: Merge 1
127
127
128 changeset: 2:96b70246a118
128 changeset: 2:96b70246a118
129 parent: 0:b1832b9d912a
129 parent: 0:b1832b9d912a
130 user: test
130 user: test
131 date: Thu Jan 01 00:00:00 1970 +0000
131 date: Thu Jan 01 00:00:00 1970 +0000
132 summary: Numbers as words
132 summary: Numbers as words
133
133
134 changeset: 1:d1e159716d41
134 changeset: 1:d1e159716d41
135 user: test
135 user: test
136 date: Thu Jan 01 00:00:00 1970 +0000
136 date: Thu Jan 01 00:00:00 1970 +0000
137 summary: 2 -> 2.5
137 summary: 2 -> 2.5
138
138
139 changeset: 0:b1832b9d912a
139 changeset: 0:b1832b9d912a
140 user: test
140 user: test
141 date: Thu Jan 01 00:00:00 1970 +0000
141 date: Thu Jan 01 00:00:00 1970 +0000
142 summary: Initial
142 summary: Initial
143
143
@@ -1,90 +1,90 b''
1 test that we don't interrupt the merge session if
1 test that we don't interrupt the merge session if
2 a file-level merge failed
2 a file-level merge failed
3
3
4 $ hg init repo
4 $ hg init repo
5 $ cd repo
5 $ cd repo
6
6
7 $ echo foo > foo
7 $ echo foo > foo
8 $ echo a > bar
8 $ echo a > bar
9 $ hg ci -Am 'add foo'
9 $ hg ci -Am 'add foo'
10 adding bar
10 adding bar
11 adding foo
11 adding foo
12
12
13 $ hg mv foo baz
13 $ hg mv foo baz
14 $ echo b >> bar
14 $ echo b >> bar
15 $ echo quux > quux1
15 $ echo quux > quux1
16 $ hg ci -Am 'mv foo baz'
16 $ hg ci -Am 'mv foo baz'
17 adding quux1
17 adding quux1
18
18
19 $ hg up -qC 0
19 $ hg up -qC 0
20 $ echo >> foo
20 $ echo >> foo
21 $ echo c >> bar
21 $ echo c >> bar
22 $ echo quux > quux2
22 $ echo quux > quux2
23 $ hg ci -Am 'change foo'
23 $ hg ci -Am 'change foo'
24 adding quux2
24 adding quux2
25 created new head
25 created new head
26
26
27 test with the rename on the remote side
27 test with the rename on the remote side
28 $ HGMERGE=false hg merge
28 $ HGMERGE=false hg merge
29 merging bar
29 merging bar
30 merging bar failed!
30 merging bar failed!
31 merging foo and baz to baz
31 merging foo and baz to baz
32 1 files updated, 1 files merged, 0 files removed, 1 files unresolved
32 1 files updated, 1 files merged, 0 files removed, 1 files unresolved
33 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
33 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
34 $ hg resolve -l
34 $ hg resolve -l
35 U bar
35 U bar
36 R baz
36 R baz
37
37
38 test with the rename on the local side
38 test with the rename on the local side
39 $ hg up -C 1
39 $ hg up -C 1
40 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
41 $ HGMERGE=false hg merge
41 $ HGMERGE=false hg merge
42 merging bar
42 merging bar
43 merging bar failed!
43 merging bar failed!
44 merging baz and foo to baz
44 merging baz and foo to baz
45 1 files updated, 1 files merged, 0 files removed, 1 files unresolved
45 1 files updated, 1 files merged, 0 files removed, 1 files unresolved
46 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
46 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
47
47
48 show unresolved
48 show unresolved
49 $ hg resolve -l
49 $ hg resolve -l
50 U bar
50 U bar
51 R baz
51 R baz
52
52
53 unmark baz
53 unmark baz
54 $ hg resolve -u baz
54 $ hg resolve -u baz
55
55
56 show
56 show
57 $ hg resolve -l
57 $ hg resolve -l
58 U bar
58 U bar
59 U baz
59 U baz
60 $ hg st
60 $ hg st
61 M bar
61 M bar
62 M baz
62 M baz
63 M quux2
63 M quux2
64 ? bar.orig
64 ? bar.orig
65
65
66 re-resolve baz
66 re-resolve baz
67 $ hg resolve baz
67 $ hg resolve baz
68 merging baz and foo to baz
68 merging baz and foo to baz
69
69
70 after resolve
70 after resolve
71 $ hg resolve -l
71 $ hg resolve -l
72 U bar
72 U bar
73 R baz
73 R baz
74
74
75 resolve all warning
75 resolve all warning
76 $ hg resolve
76 $ hg resolve
77 abort: no files or directories specified; use --all to remerge all files
77 abort: no files or directories specified; use --all to remerge all files
78
78
79 resolve all
79 resolve all
80 $ hg resolve -a
80 $ hg resolve -a
81 merging bar
81 merging bar
82 warning: conflicts during merge.
82 warning: conflicts during merge.
83 merging bar failed!
83 merging bar failed!
84
84
85 after
85 after
86 $ hg resolve -l
86 $ hg resolve -l
87 U bar
87 U bar
88 R baz
88 R baz
89
89
90 $ true
90 $ true
@@ -1,120 +1,120 b''
1 %%% plain headers
1 %%% plain headers
2 adding a
2 adding a
3 % qnew should refuse bad patch names
3 % qnew should refuse bad patch names
4 abort: "series" cannot be used as the name of a patch
4 abort: "series" cannot be used as the name of a patch
5 abort: "status" cannot be used as the name of a patch
5 abort: "status" cannot be used as the name of a patch
6 abort: "guards" cannot be used as the name of a patch
6 abort: "guards" cannot be used as the name of a patch
7 abort: ".hgignore" cannot be used as the name of a patch
7 abort: ".hgignore" cannot be used as the name of a patch
8 abort: ".mqfoo" cannot be used as the name of a patch
8 abort: ".mqfoo" cannot be used as the name of a patch
9 abort: "foo#bar" cannot be used as the name of a patch
9 abort: "foo#bar" cannot be used as the name of a patch
10 abort: "foo:bar" cannot be used as the name of a patch
10 abort: "foo:bar" cannot be used as the name of a patch
11 % qnew with name containing slash
11 % qnew with name containing slash
12 foo/bar.patch
12 foo/bar.patch
13 popping foo/bar.patch
13 popping foo/bar.patch
14 patch queue now empty
14 patch queue now empty
15 % qnew with uncommitted changes
15 % qnew with uncommitted changes
16 uncommitted.patch
16 uncommitted.patch
17 % qnew implies add
17 % qnew implies add
18 A .hgignore
18 A .hgignore
19 A series
19 A series
20 A uncommitted.patch
20 A uncommitted.patch
21 % qnew missing
21 % qnew missing
22 abort: missing: No such file or directory
22 abort: missing: No such file or directory
23 % qnew -m
23 % qnew -m
24 foo bar
24 foo bar
25
25
26 % qnew twice
26 % qnew twice
27 abort: patch "first.patch" already exists
27 abort: patch "first.patch" already exists
28 abort: patch "first.patch" already exists
28 abort: patch "first.patch" already exists
29 % qnew -f from a subdirectory
29 % qnew -f from a subdirectory
30 popping first.patch
30 popping first.patch
31 popping mtest.patch
31 popping mtest.patch
32 popping uncommitted.patch
32 popping uncommitted.patch
33 patch queue now empty
33 patch queue now empty
34 adding d/b
34 adding d/b
35 M d/b
35 M d/b
36 diff --git a/d/b b/d/b
36 diff --git a/d/b b/d/b
37 --- a/d/b
37 --- a/d/b
38 +++ b/d/b
38 +++ b/d/b
39 @@ -1,1 +1,2 @@
39 @@ -1,1 +1,2 @@
40 b
40 b
41 +b
41 +b
42 % qnew -u with no username configured
42 % qnew -u with no username configured
43 From: blue
43 From: blue
44
44
45 % qnew -e -u with no username configured
45 % qnew -e -u with no username configured
46 From: chartreuse
46 From: chartreuse
47
47
48 % fail when trying to import a merge
48 % fail when trying to import a merge
49 adding a
49 adding a
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 created new head
51 created new head
52 merging a
52 merging a
53 warning: conflicts during merge.
53 warning: conflicts during merge.
54 merging a failed!
54 merging a failed!
55 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
55 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
56 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
56 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
57 abort: cannot manage merge changesets
57 abort: cannot manage merge changesets
58 %%% hg headers
58 %%% hg headers
59 adding a
59 adding a
60 % qnew should refuse bad patch names
60 % qnew should refuse bad patch names
61 abort: "series" cannot be used as the name of a patch
61 abort: "series" cannot be used as the name of a patch
62 abort: "status" cannot be used as the name of a patch
62 abort: "status" cannot be used as the name of a patch
63 abort: "guards" cannot be used as the name of a patch
63 abort: "guards" cannot be used as the name of a patch
64 abort: ".hgignore" cannot be used as the name of a patch
64 abort: ".hgignore" cannot be used as the name of a patch
65 abort: ".mqfoo" cannot be used as the name of a patch
65 abort: ".mqfoo" cannot be used as the name of a patch
66 abort: "foo#bar" cannot be used as the name of a patch
66 abort: "foo#bar" cannot be used as the name of a patch
67 abort: "foo:bar" cannot be used as the name of a patch
67 abort: "foo:bar" cannot be used as the name of a patch
68 % qnew with name containing slash
68 % qnew with name containing slash
69 foo/bar.patch
69 foo/bar.patch
70 popping foo/bar.patch
70 popping foo/bar.patch
71 patch queue now empty
71 patch queue now empty
72 % qnew with uncommitted changes
72 % qnew with uncommitted changes
73 uncommitted.patch
73 uncommitted.patch
74 % qnew implies add
74 % qnew implies add
75 A .hgignore
75 A .hgignore
76 A series
76 A series
77 A uncommitted.patch
77 A uncommitted.patch
78 % qnew missing
78 % qnew missing
79 abort: missing: No such file or directory
79 abort: missing: No such file or directory
80 % qnew -m
80 % qnew -m
81 # HG changeset patch
81 # HG changeset patch
82 # Parent
82 # Parent
83 foo bar
83 foo bar
84
84
85 % qnew twice
85 % qnew twice
86 abort: patch "first.patch" already exists
86 abort: patch "first.patch" already exists
87 abort: patch "first.patch" already exists
87 abort: patch "first.patch" already exists
88 % qnew -f from a subdirectory
88 % qnew -f from a subdirectory
89 popping first.patch
89 popping first.patch
90 popping mtest.patch
90 popping mtest.patch
91 popping uncommitted.patch
91 popping uncommitted.patch
92 patch queue now empty
92 patch queue now empty
93 adding d/b
93 adding d/b
94 M d/b
94 M d/b
95 # HG changeset patch
95 # HG changeset patch
96 # Parent
96 # Parent
97 diff --git a/d/b b/d/b
97 diff --git a/d/b b/d/b
98 --- a/d/b
98 --- a/d/b
99 +++ b/d/b
99 +++ b/d/b
100 @@ -1,1 +1,2 @@
100 @@ -1,1 +1,2 @@
101 b
101 b
102 +b
102 +b
103 % qnew -u with no username configured
103 % qnew -u with no username configured
104 # HG changeset patch
104 # HG changeset patch
105 # Parent
105 # Parent
106 # User blue
106 # User blue
107 % qnew -e -u with no username configured
107 % qnew -e -u with no username configured
108 # HG changeset patch
108 # HG changeset patch
109 # Parent
109 # Parent
110 # User chartreuse
110 # User chartreuse
111 % fail when trying to import a merge
111 % fail when trying to import a merge
112 adding a
112 adding a
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 created new head
114 created new head
115 merging a
115 merging a
116 warning: conflicts during merge.
116 warning: conflicts during merge.
117 merging a failed!
117 merging a failed!
118 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
118 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
119 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
119 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
120 abort: cannot manage merge changesets
120 abort: cannot manage merge changesets
@@ -1,43 +1,43 b''
1 test that a commit clears the merge state.
1 test that a commit clears the merge state.
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5
5
6 $ echo foo > file
6 $ echo foo > file
7 $ hg commit -Am 'add file'
7 $ hg commit -Am 'add file'
8 adding file
8 adding file
9
9
10 $ echo bar >> file
10 $ echo bar >> file
11 $ hg commit -Am 'append bar'
11 $ hg commit -Am 'append bar'
12
12
13
13
14 create a second head
14 create a second head
15
15
16 $ hg up -C 0
16 $ hg up -C 0
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 $ echo baz >> file
18 $ echo baz >> file
19 $ hg commit -Am 'append baz'
19 $ hg commit -Am 'append baz'
20 created new head
20 created new head
21
21
22 failing merge
22 failing merge
23
23
24 $ HGMERGE=internal:fail hg merge
24 $ HGMERGE=internal:fail hg merge
25 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
25 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
26 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
26 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
27
27
28 $ echo resolved > file
28 $ echo resolved > file
29 $ hg resolve -m file
29 $ hg resolve -m file
30 $ hg commit -m 'resolved'
30 $ hg commit -m 'resolved'
31
31
32 resolve -l, should be empty
32 resolve -l, should be empty
33
33
34 $ hg resolve -l
34 $ hg resolve -l
35
35
36 test crashed merge with empty mergestate
36 test crashed merge with empty mergestate
37
37
38 $ mkdir .hg/merge
38 $ mkdir .hg/merge
39 $ touch .hg/merge/state
39 $ touch .hg/merge/state
40
40
41 resolve -l, should be empty
41 resolve -l, should be empty
42
42
43 $ hg resolve -l
43 $ hg resolve -l
@@ -1,277 +1,277 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
2 $ echo "color=" >> $HGRCPATH
3 $ echo "[color]" >> $HGRCPATH
3 $ echo "[color]" >> $HGRCPATH
4 $ echo "mode=ansi" >> $HGRCPATH
4 $ echo "mode=ansi" >> $HGRCPATH
5
5
6 $ hg init repo1
6 $ hg init repo1
7 $ cd repo1
7 $ cd repo1
8 $ mkdir a b a/1 b/1 b/2
8 $ mkdir a b a/1 b/1 b/2
9 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
9 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
10
10
11 hg status in repo root:
11 hg status in repo root:
12
12
13 $ hg status --color=always
13 $ hg status --color=always
14 ? a/1/in_a_1
14 ? a/1/in_a_1
15 ? a/in_a
15 ? a/in_a
16 ? b/1/in_b_1
16 ? b/1/in_b_1
17 ? b/2/in_b_2
17 ? b/2/in_b_2
18 ? b/in_b
18 ? b/in_b
19 ? in_root
19 ? in_root
20
20
21 hg status . in repo root:
21 hg status . in repo root:
22
22
23 $ hg status --color=always .
23 $ hg status --color=always .
24 ? a/1/in_a_1
24 ? a/1/in_a_1
25 ? a/in_a
25 ? a/in_a
26 ? b/1/in_b_1
26 ? b/1/in_b_1
27 ? b/2/in_b_2
27 ? b/2/in_b_2
28 ? b/in_b
28 ? b/in_b
29 ? in_root
29 ? in_root
30
30
31 $ hg status --color=always --cwd a
31 $ hg status --color=always --cwd a
32 ? a/1/in_a_1
32 ? a/1/in_a_1
33 ? a/in_a
33 ? a/in_a
34 ? b/1/in_b_1
34 ? b/1/in_b_1
35 ? b/2/in_b_2
35 ? b/2/in_b_2
36 ? b/in_b
36 ? b/in_b
37 ? in_root
37 ? in_root
38 $ hg status --color=always --cwd a .
38 $ hg status --color=always --cwd a .
39 ? 1/in_a_1
39 ? 1/in_a_1
40 ? in_a
40 ? in_a
41 $ hg status --color=always --cwd a ..
41 $ hg status --color=always --cwd a ..
42 ? 1/in_a_1
42 ? 1/in_a_1
43 ? in_a
43 ? in_a
44 ? ../b/1/in_b_1
44 ? ../b/1/in_b_1
45 ? ../b/2/in_b_2
45 ? ../b/2/in_b_2
46 ? ../b/in_b
46 ? ../b/in_b
47 ? ../in_root
47 ? ../in_root
48
48
49 $ hg status --color=always --cwd b
49 $ hg status --color=always --cwd b
50 ? a/1/in_a_1
50 ? a/1/in_a_1
51 ? a/in_a
51 ? a/in_a
52 ? b/1/in_b_1
52 ? b/1/in_b_1
53 ? b/2/in_b_2
53 ? b/2/in_b_2
54 ? b/in_b
54 ? b/in_b
55 ? in_root
55 ? in_root
56 $ hg status --color=always --cwd b .
56 $ hg status --color=always --cwd b .
57 ? 1/in_b_1
57 ? 1/in_b_1
58 ? 2/in_b_2
58 ? 2/in_b_2
59 ? in_b
59 ? in_b
60 $ hg status --color=always --cwd b ..
60 $ hg status --color=always --cwd b ..
61 ? ../a/1/in_a_1
61 ? ../a/1/in_a_1
62 ? ../a/in_a
62 ? ../a/in_a
63 ? 1/in_b_1
63 ? 1/in_b_1
64 ? 2/in_b_2
64 ? 2/in_b_2
65 ? in_b
65 ? in_b
66 ? ../in_root
66 ? ../in_root
67
67
68 $ hg status --color=always --cwd a/1
68 $ hg status --color=always --cwd a/1
69 ? a/1/in_a_1
69 ? a/1/in_a_1
70 ? a/in_a
70 ? a/in_a
71 ? b/1/in_b_1
71 ? b/1/in_b_1
72 ? b/2/in_b_2
72 ? b/2/in_b_2
73 ? b/in_b
73 ? b/in_b
74 ? in_root
74 ? in_root
75 $ hg status --color=always --cwd a/1 .
75 $ hg status --color=always --cwd a/1 .
76 ? in_a_1
76 ? in_a_1
77 $ hg status --color=always --cwd a/1 ..
77 $ hg status --color=always --cwd a/1 ..
78 ? in_a_1
78 ? in_a_1
79 ? ../in_a
79 ? ../in_a
80
80
81 $ hg status --color=always --cwd b/1
81 $ hg status --color=always --cwd b/1
82 ? a/1/in_a_1
82 ? a/1/in_a_1
83 ? a/in_a
83 ? a/in_a
84 ? b/1/in_b_1
84 ? b/1/in_b_1
85 ? b/2/in_b_2
85 ? b/2/in_b_2
86 ? b/in_b
86 ? b/in_b
87 ? in_root
87 ? in_root
88 $ hg status --color=always --cwd b/1 .
88 $ hg status --color=always --cwd b/1 .
89 ? in_b_1
89 ? in_b_1
90 $ hg status --color=always --cwd b/1 ..
90 $ hg status --color=always --cwd b/1 ..
91 ? in_b_1
91 ? in_b_1
92 ? ../2/in_b_2
92 ? ../2/in_b_2
93 ? ../in_b
93 ? ../in_b
94
94
95 $ hg status --color=always --cwd b/2
95 $ hg status --color=always --cwd b/2
96 ? a/1/in_a_1
96 ? a/1/in_a_1
97 ? a/in_a
97 ? a/in_a
98 ? b/1/in_b_1
98 ? b/1/in_b_1
99 ? b/2/in_b_2
99 ? b/2/in_b_2
100 ? b/in_b
100 ? b/in_b
101 ? in_root
101 ? in_root
102 $ hg status --color=always --cwd b/2 .
102 $ hg status --color=always --cwd b/2 .
103 ? in_b_2
103 ? in_b_2
104 $ hg status --color=always --cwd b/2 ..
104 $ hg status --color=always --cwd b/2 ..
105 ? ../1/in_b_1
105 ? ../1/in_b_1
106 ? in_b_2
106 ? in_b_2
107 ? ../in_b
107 ? ../in_b
108 $ cd ..
108 $ cd ..
109
109
110 $ hg init repo2
110 $ hg init repo2
111 $ cd repo2
111 $ cd repo2
112 $ touch modified removed deleted ignored
112 $ touch modified removed deleted ignored
113 $ echo "^ignored$" > .hgignore
113 $ echo "^ignored$" > .hgignore
114 $ hg ci -A -m 'initial checkin'
114 $ hg ci -A -m 'initial checkin'
115 adding .hgignore
115 adding .hgignore
116 adding deleted
116 adding deleted
117 adding modified
117 adding modified
118 adding removed
118 adding removed
119 $ touch modified added unknown ignored
119 $ touch modified added unknown ignored
120 $ hg add added
120 $ hg add added
121 $ hg remove removed
121 $ hg remove removed
122 $ rm deleted
122 $ rm deleted
123
123
124 hg status:
124 hg status:
125
125
126 $ hg status --color=always
126 $ hg status --color=always
127 A added
127 A added
128 R removed
128 R removed
129 ! deleted
129 ! deleted
130 ? unknown
130 ? unknown
131
131
132 hg status modified added removed deleted unknown never-existed ignored:
132 hg status modified added removed deleted unknown never-existed ignored:
133
133
134 $ hg status --color=always modified added removed deleted unknown never-existed ignored
134 $ hg status --color=always modified added removed deleted unknown never-existed ignored
135 never-existed: No such file or directory
135 never-existed: No such file or directory
136 A added
136 A added
137 R removed
137 R removed
138 ! deleted
138 ! deleted
139 ? unknown
139 ? unknown
140
140
141 $ hg copy modified copied
141 $ hg copy modified copied
142
142
143 hg status -C:
143 hg status -C:
144
144
145 $ hg status --color=always -C
145 $ hg status --color=always -C
146 A added
146 A added
147 A copied
147 A copied
148  modified
148  modified
149 R removed
149 R removed
150 ! deleted
150 ! deleted
151 ? unknown
151 ? unknown
152
152
153 hg status -A:
153 hg status -A:
154
154
155 $ hg status --color=always -A
155 $ hg status --color=always -A
156 A added
156 A added
157 A copied
157 A copied
158  modified
158  modified
159 R removed
159 R removed
160 ! deleted
160 ! deleted
161 ? unknown
161 ? unknown
162 I ignored
162 I ignored
163 C .hgignore
163 C .hgignore
164 C modified
164 C modified
165
165
166
166
167 $ echo "^ignoreddir$" > .hgignore
167 $ echo "^ignoreddir$" > .hgignore
168 $ mkdir ignoreddir
168 $ mkdir ignoreddir
169 $ touch ignoreddir/file
169 $ touch ignoreddir/file
170
170
171 hg status ignoreddir/file:
171 hg status ignoreddir/file:
172
172
173 $ hg status --color=always ignoreddir/file
173 $ hg status --color=always ignoreddir/file
174
174
175 hg status -i ignoreddir/file:
175 hg status -i ignoreddir/file:
176
176
177 $ hg status --color=always -i ignoreddir/file
177 $ hg status --color=always -i ignoreddir/file
178 I ignoreddir/file
178 I ignoreddir/file
179 $ cd ..
179 $ cd ..
180
180
181 # check 'status -q' and some combinations
181 # check 'status -q' and some combinations
182
182
183 $ hg init repo3
183 $ hg init repo3
184 $ cd repo3
184 $ cd repo3
185 $ touch modified removed deleted ignored
185 $ touch modified removed deleted ignored
186 $ echo "^ignored$" > .hgignore
186 $ echo "^ignored$" > .hgignore
187 $ hg commit -A -m 'initial checkin'
187 $ hg commit -A -m 'initial checkin'
188 adding .hgignore
188 adding .hgignore
189 adding deleted
189 adding deleted
190 adding modified
190 adding modified
191 adding removed
191 adding removed
192 $ touch added unknown ignored
192 $ touch added unknown ignored
193 $ hg add added
193 $ hg add added
194 $ echo "test" >> modified
194 $ echo "test" >> modified
195 $ hg remove removed
195 $ hg remove removed
196 $ rm deleted
196 $ rm deleted
197 $ hg copy modified copied
197 $ hg copy modified copied
198
198
199 test unknown color
199 test unknown color
200
200
201 $ hg --config color.status.modified=periwinkle status --color=always
201 $ hg --config color.status.modified=periwinkle status --color=always
202 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
202 ignoring unknown color/effect 'periwinkle' (configured in color.status.modified)
203 M modified
203 M modified
204 A added
204 A added
205 A copied
205 A copied
206 R removed
206 R removed
207 ! deleted
207 ! deleted
208 ? unknown
208 ? unknown
209
209
210 # Run status with 2 different flags.
210 # Run status with 2 different flags.
211 # Check if result is the same or different.
211 # Check if result is the same or different.
212 # If result is not as expected, raise error
212 # If result is not as expected, raise error
213 $ assert() {
213 $ assert() {
214 > hg status --color=always $1 > ../a
214 > hg status --color=always $1 > ../a
215 > hg status --color=always $2 > ../b
215 > hg status --color=always $2 > ../b
216 > out=`diff ../a ../b`
216 > out=`diff ../a ../b`
217 > if [ $? -ne 0 ]; then
217 > if [ $? -ne 0 ]; then
218 > out=1
218 > out=1
219 > else
219 > else
220 > out=0
220 > out=0
221 > fi
221 > fi
222 > if [ $3 -eq 0 ]; then
222 > if [ $3 -eq 0 ]; then
223 > df="same"
223 > df="same"
224 > else
224 > else
225 > df="different"
225 > df="different"
226 > fi
226 > fi
227 > if [ $out -ne $3 ]; then
227 > if [ $out -ne $3 ]; then
228 > echo "Error on $1 and $2, should be $df."
228 > echo "Error on $1 and $2, should be $df."
229 > fi
229 > fi
230 > }
230 > }
231
231
232 # assert flag1 flag2 [0-same | 1-different]
232 # assert flag1 flag2 [0-same | 1-different]
233
233
234 $ assert "-q" "-mard" 0
234 $ assert "-q" "-mard" 0
235 $ assert "-A" "-marduicC" 0
235 $ assert "-A" "-marduicC" 0
236 $ assert "-qA" "-mardcC" 0
236 $ assert "-qA" "-mardcC" 0
237 $ assert "-qAui" "-A" 0
237 $ assert "-qAui" "-A" 0
238 $ assert "-qAu" "-marducC" 0
238 $ assert "-qAu" "-marducC" 0
239 $ assert "-qAi" "-mardicC" 0
239 $ assert "-qAi" "-mardicC" 0
240 $ assert "-qu" "-u" 0
240 $ assert "-qu" "-u" 0
241 $ assert "-q" "-u" 1
241 $ assert "-q" "-u" 1
242 $ assert "-m" "-a" 1
242 $ assert "-m" "-a" 1
243 $ assert "-r" "-d" 1
243 $ assert "-r" "-d" 1
244 $ cd ..
244 $ cd ..
245
245
246 # test 'resolve -l'
246 # test 'resolve -l'
247 $ hg init repo4
247 $ hg init repo4
248 $ cd repo4
248 $ cd repo4
249 $ echo "file a" > a
249 $ echo "file a" > a
250 $ echo "file b" > b
250 $ echo "file b" > b
251 $ hg add a b
251 $ hg add a b
252 $ hg commit -m "initial"
252 $ hg commit -m "initial"
253 $ echo "file a change 1" > a
253 $ echo "file a change 1" > a
254 $ echo "file b change 1" > b
254 $ echo "file b change 1" > b
255 $ hg commit -m "head 1"
255 $ hg commit -m "head 1"
256 $ hg update 0
256 $ hg update 0
257 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 $ echo "file a change 2" > a
258 $ echo "file a change 2" > a
259 $ echo "file b change 2" > b
259 $ echo "file b change 2" > b
260 $ hg commit -m "head 2"
260 $ hg commit -m "head 2"
261 created new head
261 created new head
262 $ hg merge
262 $ hg merge
263 merging a
263 merging a
264 warning: conflicts during merge.
264 warning: conflicts during merge.
265 merging a failed!
265 merging a failed!
266 merging b
266 merging b
267 warning: conflicts during merge.
267 warning: conflicts during merge.
268 merging b failed!
268 merging b failed!
269 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
269 0 files updated, 0 files merged, 0 files removed, 2 files unresolved
270 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
270 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
271 $ hg resolve -m b
271 $ hg resolve -m b
272
272
273 hg resolve with one unresolved, one resolved:
273 hg resolve with one unresolved, one resolved:
274
274
275 $ hg resolve --color=always -l
275 $ hg resolve --color=always -l
276 U a
276 U a
277 R b
277 R b
@@ -1,584 +1,584 b''
1 $ rm -rf sub
1 $ rm -rf sub
2 $ mkdir sub
2 $ mkdir sub
3 $ cd sub
3 $ cd sub
4 $ hg init t
4 $ hg init t
5 $ cd t
5 $ cd t
6
6
7 first revision, no sub
7 first revision, no sub
8
8
9 $ echo a > a
9 $ echo a > a
10 $ hg ci -Am0
10 $ hg ci -Am0
11 adding a
11 adding a
12
12
13 add first sub
13 add first sub
14
14
15 $ echo s = s > .hgsub
15 $ echo s = s > .hgsub
16 $ hg add .hgsub
16 $ hg add .hgsub
17 $ hg init s
17 $ hg init s
18 $ echo a > s/a
18 $ echo a > s/a
19
19
20 issue2232 - committing a subrepo without .hgsub
20 issue2232 - committing a subrepo without .hgsub
21
21
22 $ hg ci -mbad s
22 $ hg ci -mbad s
23 abort: can't commit subrepos without .hgsub
23 abort: can't commit subrepos without .hgsub
24
24
25 $ hg -R s ci -Ams0
25 $ hg -R s ci -Ams0
26 adding a
26 adding a
27 $ hg sum
27 $ hg sum
28 parent: 0:f7b1eb17ad24 tip
28 parent: 0:f7b1eb17ad24 tip
29 0
29 0
30 branch: default
30 branch: default
31 commit: 1 added, 1 subrepos
31 commit: 1 added, 1 subrepos
32 update: (current)
32 update: (current)
33 $ hg ci -m1
33 $ hg ci -m1
34 committing subrepository s
34 committing subrepository s
35
35
36 issue 2022 - update -C
36 issue 2022 - update -C
37
37
38 $ echo b > s/a
38 $ echo b > s/a
39 $ hg sum
39 $ hg sum
40 parent: 1:7cf8cfea66e4 tip
40 parent: 1:7cf8cfea66e4 tip
41 1
41 1
42 branch: default
42 branch: default
43 commit: 1 subrepos
43 commit: 1 subrepos
44 update: (current)
44 update: (current)
45 $ hg co -C 1
45 $ hg co -C 1
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
47 $ hg sum
47 $ hg sum
48 parent: 1:7cf8cfea66e4 tip
48 parent: 1:7cf8cfea66e4 tip
49 1
49 1
50 branch: default
50 branch: default
51 commit: (clean)
51 commit: (clean)
52 update: (current)
52 update: (current)
53
53
54 add sub sub
54 add sub sub
55
55
56 $ echo ss = ss > s/.hgsub
56 $ echo ss = ss > s/.hgsub
57 $ hg init s/ss
57 $ hg init s/ss
58 $ echo a > s/ss/a
58 $ echo a > s/ss/a
59 $ hg -R s add s/.hgsub
59 $ hg -R s add s/.hgsub
60 $ hg -R s/ss add s/ss/a
60 $ hg -R s/ss add s/ss/a
61 $ hg sum
61 $ hg sum
62 parent: 1:7cf8cfea66e4 tip
62 parent: 1:7cf8cfea66e4 tip
63 1
63 1
64 branch: default
64 branch: default
65 commit: 1 subrepos
65 commit: 1 subrepos
66 update: (current)
66 update: (current)
67 $ hg ci -m2
67 $ hg ci -m2
68 committing subrepository s
68 committing subrepository s
69 committing subrepository s/ss
69 committing subrepository s/ss
70 $ hg sum
70 $ hg sum
71 parent: 2:df30734270ae tip
71 parent: 2:df30734270ae tip
72 2
72 2
73 branch: default
73 branch: default
74 commit: (clean)
74 commit: (clean)
75 update: (current)
75 update: (current)
76
76
77 bump sub rev
77 bump sub rev
78
78
79 $ echo b > s/a
79 $ echo b > s/a
80 $ hg -R s ci -ms1
80 $ hg -R s ci -ms1
81 $ hg ci -m3
81 $ hg ci -m3
82 committing subrepository s
82 committing subrepository s
83
83
84 leave sub dirty
84 leave sub dirty
85
85
86 $ echo c > s/a
86 $ echo c > s/a
87 $ hg ci -m4
87 $ hg ci -m4
88 committing subrepository s
88 committing subrepository s
89 $ hg tip -R s
89 $ hg tip -R s
90 changeset: 3:1c833a7a9e3a
90 changeset: 3:1c833a7a9e3a
91 tag: tip
91 tag: tip
92 user: test
92 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
93 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: 4
94 summary: 4
95
95
96
96
97 check caching
97 check caching
98
98
99 $ hg co 0
99 $ hg co 0
100 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
100 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
101 $ hg debugsub
101 $ hg debugsub
102
102
103 restore
103 restore
104
104
105 $ hg co
105 $ hg co
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 $ hg debugsub
107 $ hg debugsub
108 path s
108 path s
109 source s
109 source s
110 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
110 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
111
111
112 new branch for merge tests
112 new branch for merge tests
113
113
114 $ hg co 1
114 $ hg co 1
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 $ echo t = t >> .hgsub
116 $ echo t = t >> .hgsub
117 $ hg init t
117 $ hg init t
118 $ echo t > t/t
118 $ echo t > t/t
119 $ hg -R t add t
119 $ hg -R t add t
120 adding t/t
120 adding t/t
121
121
122 5
122 5
123
123
124 $ hg ci -m5 # add sub
124 $ hg ci -m5 # add sub
125 committing subrepository t
125 committing subrepository t
126 created new head
126 created new head
127 $ echo t2 > t/t
127 $ echo t2 > t/t
128
128
129 6
129 6
130
130
131 $ hg st -R s
131 $ hg st -R s
132 $ hg ci -m6 # change sub
132 $ hg ci -m6 # change sub
133 committing subrepository t
133 committing subrepository t
134 $ hg debugsub
134 $ hg debugsub
135 path s
135 path s
136 source s
136 source s
137 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
137 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
138 path t
138 path t
139 source t
139 source t
140 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
140 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
141 $ echo t3 > t/t
141 $ echo t3 > t/t
142
142
143 7
143 7
144
144
145 $ hg ci -m7 # change sub again for conflict test
145 $ hg ci -m7 # change sub again for conflict test
146 committing subrepository t
146 committing subrepository t
147 $ hg rm .hgsub
147 $ hg rm .hgsub
148
148
149 8
149 8
150
150
151 $ hg ci -m8 # remove sub
151 $ hg ci -m8 # remove sub
152
152
153 merge tests
153 merge tests
154
154
155 $ hg co -C 3
155 $ hg co -C 3
156 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 $ hg merge 5 # test adding
157 $ hg merge 5 # test adding
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 (branch merge, don't forget to commit)
159 (branch merge, don't forget to commit)
160 $ hg debugsub
160 $ hg debugsub
161 path s
161 path s
162 source s
162 source s
163 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
163 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
164 path t
164 path t
165 source t
165 source t
166 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
166 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
167 $ hg ci -m9
167 $ hg ci -m9
168 created new head
168 created new head
169 $ hg merge 6 --debug # test change
169 $ hg merge 6 --debug # test change
170 searching for copies back to rev 2
170 searching for copies back to rev 2
171 resolving manifests
171 resolving manifests
172 overwrite None partial False
172 overwrite None partial False
173 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
173 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
174 .hgsubstate: versions differ -> m
174 .hgsubstate: versions differ -> m
175 updating: .hgsubstate 1/1 files (100.00%)
175 updating: .hgsubstate 1/1 files (100.00%)
176 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
176 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
177 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
177 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
178 getting subrepo t
178 getting subrepo t
179 resolving manifests
179 resolving manifests
180 overwrite True partial False
180 overwrite True partial False
181 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
181 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
182 t: remote is newer -> g
182 t: remote is newer -> g
183 updating: t 1/1 files (100.00%)
183 updating: t 1/1 files (100.00%)
184 getting t
184 getting t
185 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 (branch merge, don't forget to commit)
186 (branch merge, don't forget to commit)
187 $ hg debugsub
187 $ hg debugsub
188 path s
188 path s
189 source s
189 source s
190 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
190 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
191 path t
191 path t
192 source t
192 source t
193 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
193 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
194 $ echo conflict > t/t
194 $ echo conflict > t/t
195 $ hg ci -m10
195 $ hg ci -m10
196 committing subrepository t
196 committing subrepository t
197 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
197 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
198 searching for copies back to rev 2
198 searching for copies back to rev 2
199 resolving manifests
199 resolving manifests
200 overwrite None partial False
200 overwrite None partial False
201 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
201 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
202 .hgsubstate: versions differ -> m
202 .hgsubstate: versions differ -> m
203 updating: .hgsubstate 1/1 files (100.00%)
203 updating: .hgsubstate 1/1 files (100.00%)
204 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
204 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
205 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
205 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
206 merging subrepo t
206 merging subrepo t
207 searching for copies back to rev 2
207 searching for copies back to rev 2
208 resolving manifests
208 resolving manifests
209 overwrite None partial False
209 overwrite None partial False
210 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
210 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
211 t: versions differ -> m
211 t: versions differ -> m
212 preserving t for resolve of t
212 preserving t for resolve of t
213 updating: t 1/1 files (100.00%)
213 updating: t 1/1 files (100.00%)
214 picked tool 'internal:merge' for t (binary False symlink False)
214 picked tool 'internal:merge' for t (binary False symlink False)
215 merging t
215 merging t
216 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
216 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
217 warning: conflicts during merge.
217 warning: conflicts during merge.
218 merging t failed!
218 merging t failed!
219 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
219 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
220 use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
220 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
221 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 (branch merge, don't forget to commit)
222 (branch merge, don't forget to commit)
223
223
224 should conflict
224 should conflict
225
225
226 $ cat t/t
226 $ cat t/t
227 <<<<<<< local
227 <<<<<<< local
228 conflict
228 conflict
229 =======
229 =======
230 t3
230 t3
231 >>>>>>> other
231 >>>>>>> other
232
232
233 clone
233 clone
234
234
235 $ cd ..
235 $ cd ..
236 $ hg clone t tc
236 $ hg clone t tc
237 updating to branch default
237 updating to branch default
238 pulling subrepo s from .*/sub/t/s
238 pulling subrepo s from .*/sub/t/s
239 requesting all changes
239 requesting all changes
240 adding changesets
240 adding changesets
241 adding manifests
241 adding manifests
242 adding file changes
242 adding file changes
243 added 4 changesets with 5 changes to 3 files
243 added 4 changesets with 5 changes to 3 files
244 pulling subrepo s/ss from .*/sub/t/s/ss
244 pulling subrepo s/ss from .*/sub/t/s/ss
245 requesting all changes
245 requesting all changes
246 adding changesets
246 adding changesets
247 adding manifests
247 adding manifests
248 adding file changes
248 adding file changes
249 added 1 changesets with 1 changes to 1 files
249 added 1 changesets with 1 changes to 1 files
250 pulling subrepo t from .*/sub/t/t
250 pulling subrepo t from .*/sub/t/t
251 requesting all changes
251 requesting all changes
252 adding changesets
252 adding changesets
253 adding manifests
253 adding manifests
254 adding file changes
254 adding file changes
255 added 4 changesets with 4 changes to 1 files (+1 heads)
255 added 4 changesets with 4 changes to 1 files (+1 heads)
256 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ cd tc
257 $ cd tc
258 $ hg debugsub
258 $ hg debugsub
259 path s
259 path s
260 source s
260 source s
261 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
261 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
262 path t
262 path t
263 source t
263 source t
264 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
264 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
265
265
266 push
266 push
267
267
268 $ echo bah > t/t
268 $ echo bah > t/t
269 $ hg ci -m11
269 $ hg ci -m11
270 committing subrepository t
270 committing subrepository t
271 $ hg push
271 $ hg push
272 pushing .*sub/t
272 pushing .*sub/t
273 pushing .*sub/t/s/ss
273 pushing .*sub/t/s/ss
274 searching for changes
274 searching for changes
275 no changes found
275 no changes found
276 pushing .*sub/t/s
276 pushing .*sub/t/s
277 searching for changes
277 searching for changes
278 no changes found
278 no changes found
279 pushing .*sub/t/t
279 pushing .*sub/t/t
280 searching for changes
280 searching for changes
281 adding changesets
281 adding changesets
282 adding manifests
282 adding manifests
283 adding file changes
283 adding file changes
284 added 1 changesets with 1 changes to 1 files
284 added 1 changesets with 1 changes to 1 files
285 searching for changes
285 searching for changes
286 adding changesets
286 adding changesets
287 adding manifests
287 adding manifests
288 adding file changes
288 adding file changes
289 added 1 changesets with 1 changes to 1 files
289 added 1 changesets with 1 changes to 1 files
290
290
291 push -f
291 push -f
292
292
293 $ echo bah > s/a
293 $ echo bah > s/a
294 $ hg ci -m12
294 $ hg ci -m12
295 committing subrepository s
295 committing subrepository s
296 $ hg push
296 $ hg push
297 pushing .*sub/t
297 pushing .*sub/t
298 pushing .*sub/t/s/ss
298 pushing .*sub/t/s/ss
299 searching for changes
299 searching for changes
300 no changes found
300 no changes found
301 pushing .*sub/t/s
301 pushing .*sub/t/s
302 searching for changes
302 searching for changes
303 abort: push creates new remote heads on branch 'default'!
303 abort: push creates new remote heads on branch 'default'!
304 (did you forget to merge? use push -f to force)
304 (did you forget to merge? use push -f to force)
305 $ hg push -f
305 $ hg push -f
306 pushing .*sub/t
306 pushing .*sub/t
307 pushing .*sub/t/s/ss
307 pushing .*sub/t/s/ss
308 searching for changes
308 searching for changes
309 no changes found
309 no changes found
310 pushing .*sub/t/s
310 pushing .*sub/t/s
311 searching for changes
311 searching for changes
312 adding changesets
312 adding changesets
313 adding manifests
313 adding manifests
314 adding file changes
314 adding file changes
315 added 1 changesets with 1 changes to 1 files (+1 heads)
315 added 1 changesets with 1 changes to 1 files (+1 heads)
316 pushing .*sub/t/t
316 pushing .*sub/t/t
317 searching for changes
317 searching for changes
318 no changes found
318 no changes found
319 searching for changes
319 searching for changes
320 adding changesets
320 adding changesets
321 adding manifests
321 adding manifests
322 adding file changes
322 adding file changes
323 added 1 changesets with 1 changes to 1 files
323 added 1 changesets with 1 changes to 1 files
324
324
325 update
325 update
326
326
327 $ cd ../t
327 $ cd ../t
328 $ hg up -C # discard our earlier merge
328 $ hg up -C # discard our earlier merge
329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 $ echo blah > t/t
330 $ echo blah > t/t
331 $ hg ci -m13
331 $ hg ci -m13
332 committing subrepository t
332 committing subrepository t
333
333
334 pull
334 pull
335
335
336 $ cd ../tc
336 $ cd ../tc
337 $ hg pull
337 $ hg pull
338 pulling .*sub/t
338 pulling .*sub/t
339 searching for changes
339 searching for changes
340 adding changesets
340 adding changesets
341 adding manifests
341 adding manifests
342 adding file changes
342 adding file changes
343 added 1 changesets with 1 changes to 1 files
343 added 1 changesets with 1 changes to 1 files
344 (run 'hg update' to get a working copy)
344 (run 'hg update' to get a working copy)
345
345
346 should pull t
346 should pull t
347
347
348 $ hg up
348 $ hg up
349 pulling subrepo t from .*/sub/t/t
349 pulling subrepo t from .*/sub/t/t
350 searching for changes
350 searching for changes
351 adding changesets
351 adding changesets
352 adding manifests
352 adding manifests
353 adding file changes
353 adding file changes
354 added 1 changesets with 1 changes to 1 files
354 added 1 changesets with 1 changes to 1 files
355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
355 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
356 $ cat t/t
356 $ cat t/t
357 blah
357 blah
358
358
359 bogus subrepo path aborts
359 bogus subrepo path aborts
360
360
361 $ echo 'bogus=[boguspath' >> .hgsub
361 $ echo 'bogus=[boguspath' >> .hgsub
362 $ hg ci -m 'bogus subrepo path'
362 $ hg ci -m 'bogus subrepo path'
363 abort: missing ] in subrepo source
363 abort: missing ] in subrepo source
364
364
365 issue 1986
365 issue 1986
366
366
367 # subrepo layout
367 # subrepo layout
368 #
368 #
369 # o 5 br
369 # o 5 br
370 # /|
370 # /|
371 # o | 4 default
371 # o | 4 default
372 # | |
372 # | |
373 # | o 3 br
373 # | o 3 br
374 # |/|
374 # |/|
375 # o | 2 default
375 # o | 2 default
376 # | |
376 # | |
377 # | o 1 br
377 # | o 1 br
378 # |/
378 # |/
379 # o 0 default
379 # o 0 default
380
380
381 $ cd ..
381 $ cd ..
382 $ rm -rf sub
382 $ rm -rf sub
383 $ hg init main
383 $ hg init main
384 $ cd main
384 $ cd main
385 $ hg init s
385 $ hg init s
386 $ cd s
386 $ cd s
387 $ echo a > a
387 $ echo a > a
388 $ hg ci -Am1
388 $ hg ci -Am1
389 adding a
389 adding a
390 $ hg branch br
390 $ hg branch br
391 marked working directory as branch br
391 marked working directory as branch br
392 $ echo a >> a
392 $ echo a >> a
393 $ hg ci -m1
393 $ hg ci -m1
394 $ hg up default
394 $ hg up default
395 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
395 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 $ echo b > b
396 $ echo b > b
397 $ hg ci -Am1
397 $ hg ci -Am1
398 adding b
398 adding b
399 $ hg up br
399 $ hg up br
400 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
400 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
401 $ hg merge tip
401 $ hg merge tip
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
403 (branch merge, don't forget to commit)
403 (branch merge, don't forget to commit)
404 $ hg ci -m1
404 $ hg ci -m1
405 $ hg up 2
405 $ hg up 2
406 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 $ echo c > c
407 $ echo c > c
408 $ hg ci -Am1
408 $ hg ci -Am1
409 adding c
409 adding c
410 $ hg up 3
410 $ hg up 3
411 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
411 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
412 $ hg merge 4
412 $ hg merge 4
413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 (branch merge, don't forget to commit)
414 (branch merge, don't forget to commit)
415 $ hg ci -m1
415 $ hg ci -m1
416
416
417 # main repo layout:
417 # main repo layout:
418 #
418 #
419 # * <-- try to merge default into br again
419 # * <-- try to merge default into br again
420 # .`|
420 # .`|
421 # . o 5 br --> substate = 5
421 # . o 5 br --> substate = 5
422 # . |
422 # . |
423 # o | 4 default --> substate = 4
423 # o | 4 default --> substate = 4
424 # | |
424 # | |
425 # | o 3 br --> substate = 2
425 # | o 3 br --> substate = 2
426 # |/|
426 # |/|
427 # o | 2 default --> substate = 2
427 # o | 2 default --> substate = 2
428 # | |
428 # | |
429 # | o 1 br --> substate = 3
429 # | o 1 br --> substate = 3
430 # |/
430 # |/
431 # o 0 default --> substate = 2
431 # o 0 default --> substate = 2
432
432
433 $ cd ..
433 $ cd ..
434 $ echo 's = s' > .hgsub
434 $ echo 's = s' > .hgsub
435 $ hg -R s up 2
435 $ hg -R s up 2
436 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
436 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
437 $ hg ci -Am1
437 $ hg ci -Am1
438 adding .hgsub
438 adding .hgsub
439 committing subrepository s
439 committing subrepository s
440 $ hg branch br
440 $ hg branch br
441 marked working directory as branch br
441 marked working directory as branch br
442 $ echo b > b
442 $ echo b > b
443 $ hg -R s up 3
443 $ hg -R s up 3
444 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
444 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 $ hg ci -Am1
445 $ hg ci -Am1
446 adding b
446 adding b
447 committing subrepository s
447 committing subrepository s
448 $ hg up default
448 $ hg up default
449 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
449 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
450 $ echo c > c
450 $ echo c > c
451 $ hg ci -Am1
451 $ hg ci -Am1
452 adding c
452 adding c
453 $ hg up 1
453 $ hg up 1
454 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
454 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
455 $ hg merge 2
455 $ hg merge 2
456 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
457 (branch merge, don't forget to commit)
457 (branch merge, don't forget to commit)
458 $ hg ci -m1
458 $ hg ci -m1
459 $ hg up 2
459 $ hg up 2
460 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
460 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
461 $ hg -R s up 4
461 $ hg -R s up 4
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 $ echo d > d
463 $ echo d > d
464 $ hg ci -Am1
464 $ hg ci -Am1
465 adding d
465 adding d
466 committing subrepository s
466 committing subrepository s
467 $ hg up 3
467 $ hg up 3
468 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
468 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
469 $ hg -R s up 5
469 $ hg -R s up 5
470 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
470 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
471 $ echo e > e
471 $ echo e > e
472 $ hg ci -Am1
472 $ hg ci -Am1
473 adding e
473 adding e
474 committing subrepository s
474 committing subrepository s
475
475
476 $ hg up 5
476 $ hg up 5
477 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
477 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 $ hg merge 4 # try to merge default into br again
478 $ hg merge 4 # try to merge default into br again
479 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
479 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 (branch merge, don't forget to commit)
480 (branch merge, don't forget to commit)
481 $ cd ..
481 $ cd ..
482
482
483 test subrepo delete from .hgsubstate
483 test subrepo delete from .hgsubstate
484
484
485 $ hg init testdelete
485 $ hg init testdelete
486 $ mkdir testdelete/nested testdelete/nested2
486 $ mkdir testdelete/nested testdelete/nested2
487 $ hg init testdelete/nested
487 $ hg init testdelete/nested
488 $ hg init testdelete/nested2
488 $ hg init testdelete/nested2
489 $ echo test > testdelete/nested/foo
489 $ echo test > testdelete/nested/foo
490 $ echo test > testdelete/nested2/foo
490 $ echo test > testdelete/nested2/foo
491 $ hg -R testdelete/nested add
491 $ hg -R testdelete/nested add
492 adding testdelete/nested/foo
492 adding testdelete/nested/foo
493 $ hg -R testdelete/nested2 add
493 $ hg -R testdelete/nested2 add
494 adding testdelete/nested2/foo
494 adding testdelete/nested2/foo
495 $ hg -R testdelete/nested ci -m test
495 $ hg -R testdelete/nested ci -m test
496 $ hg -R testdelete/nested2 ci -m test
496 $ hg -R testdelete/nested2 ci -m test
497 $ echo nested = nested > testdelete/.hgsub
497 $ echo nested = nested > testdelete/.hgsub
498 $ echo nested2 = nested2 >> testdelete/.hgsub
498 $ echo nested2 = nested2 >> testdelete/.hgsub
499 $ hg -R testdelete add
499 $ hg -R testdelete add
500 adding testdelete/.hgsub
500 adding testdelete/.hgsub
501 $ hg -R testdelete ci -m "nested 1 & 2 added"
501 $ hg -R testdelete ci -m "nested 1 & 2 added"
502 committing subrepository nested
502 committing subrepository nested
503 committing subrepository nested2
503 committing subrepository nested2
504 $ echo nested = nested > testdelete/.hgsub
504 $ echo nested = nested > testdelete/.hgsub
505 $ hg -R testdelete ci -m "nested 2 deleted"
505 $ hg -R testdelete ci -m "nested 2 deleted"
506 $ cat testdelete/.hgsubstate
506 $ cat testdelete/.hgsubstate
507 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
507 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
508 $ hg -R testdelete remove testdelete/.hgsub
508 $ hg -R testdelete remove testdelete/.hgsub
509 $ hg -R testdelete ci -m ".hgsub deleted"
509 $ hg -R testdelete ci -m ".hgsub deleted"
510 $ cat testdelete/.hgsubstate
510 $ cat testdelete/.hgsubstate
511
511
512 test repository cloning
512 test repository cloning
513
513
514 $ mkdir mercurial mercurial2
514 $ mkdir mercurial mercurial2
515 $ hg init nested_absolute
515 $ hg init nested_absolute
516 $ echo test > nested_absolute/foo
516 $ echo test > nested_absolute/foo
517 $ hg -R nested_absolute add
517 $ hg -R nested_absolute add
518 adding nested_absolute/foo
518 adding nested_absolute/foo
519 $ hg -R nested_absolute ci -mtest
519 $ hg -R nested_absolute ci -mtest
520 $ cd mercurial
520 $ cd mercurial
521 $ hg init nested_relative
521 $ hg init nested_relative
522 $ echo test2 > nested_relative/foo2
522 $ echo test2 > nested_relative/foo2
523 $ hg -R nested_relative add
523 $ hg -R nested_relative add
524 adding nested_relative/foo2
524 adding nested_relative/foo2
525 $ hg -R nested_relative ci -mtest2
525 $ hg -R nested_relative ci -mtest2
526 $ hg init main
526 $ hg init main
527 $ echo "nested_relative = ../nested_relative" > main/.hgsub
527 $ echo "nested_relative = ../nested_relative" > main/.hgsub
528 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
528 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
529 $ hg -R main add
529 $ hg -R main add
530 adding main/.hgsub
530 adding main/.hgsub
531 $ hg -R main ci -m "add subrepos"
531 $ hg -R main ci -m "add subrepos"
532 committing subrepository nested_absolute
532 committing subrepository nested_absolute
533 committing subrepository nested_relative
533 committing subrepository nested_relative
534 $ cd ..
534 $ cd ..
535 $ hg clone mercurial/main mercurial2/main
535 $ hg clone mercurial/main mercurial2/main
536 updating to branch default
536 updating to branch default
537 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
537 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
538 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
538 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
539 > mercurial2/main/nested_relative/.hg/hgrc
539 > mercurial2/main/nested_relative/.hg/hgrc
540 [paths]
540 [paths]
541 default = .*/test-subrepo.t/sub/mercurial/nested_absolute
541 default = .*/test-subrepo.t/sub/mercurial/nested_absolute
542 [paths]
542 [paths]
543 default = .*/test-subrepo.t/sub/mercurial/nested_relative
543 default = .*/test-subrepo.t/sub/mercurial/nested_relative
544 $ rm -rf mercurial mercurial2
544 $ rm -rf mercurial mercurial2
545
545
546 issue 1977
546 issue 1977
547
547
548 $ hg init repo
548 $ hg init repo
549 $ hg init repo/s
549 $ hg init repo/s
550 $ echo a > repo/s/a
550 $ echo a > repo/s/a
551 $ hg -R repo/s ci -Am0
551 $ hg -R repo/s ci -Am0
552 adding a
552 adding a
553 $ echo s = s > repo/.hgsub
553 $ echo s = s > repo/.hgsub
554 $ hg -R repo ci -Am1
554 $ hg -R repo ci -Am1
555 adding .hgsub
555 adding .hgsub
556 committing subrepository s
556 committing subrepository s
557 $ hg clone repo repo2
557 $ hg clone repo repo2
558 updating to branch default
558 updating to branch default
559 pulling subrepo s from .*/sub/repo/s
559 pulling subrepo s from .*/sub/repo/s
560 requesting all changes
560 requesting all changes
561 adding changesets
561 adding changesets
562 adding manifests
562 adding manifests
563 adding file changes
563 adding file changes
564 added 1 changesets with 1 changes to 1 files
564 added 1 changesets with 1 changes to 1 files
565 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
565 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 $ hg -q -R repo2 pull -u
566 $ hg -q -R repo2 pull -u
567 $ echo 1 > repo2/s/a
567 $ echo 1 > repo2/s/a
568 $ hg -R repo2/s ci -m2
568 $ hg -R repo2/s ci -m2
569 $ hg -q -R repo2/s push
569 $ hg -q -R repo2/s push
570 $ hg -R repo2/s up -C 0
570 $ hg -R repo2/s up -C 0
571 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
571 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
572 $ echo 2 > repo2/s/a
572 $ echo 2 > repo2/s/a
573 $ hg -R repo2/s ci -m3
573 $ hg -R repo2/s ci -m3
574 created new head
574 created new head
575 $ hg -R repo2 ci -m3
575 $ hg -R repo2 ci -m3
576 committing subrepository s
576 committing subrepository s
577 $ hg -q -R repo2 push
577 $ hg -q -R repo2 push
578 abort: push creates new remote heads on branch 'default'!
578 abort: push creates new remote heads on branch 'default'!
579 (did you forget to merge? use push -f to force)
579 (did you forget to merge? use push -f to force)
580 $ hg -R repo update
580 $ hg -R repo update
581 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
581 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
582 $ rm -rf repo2 repo
582 $ rm -rf repo2 repo
583
583
584 $ exit 0
584 $ exit 0
General Comments 0
You need to be logged in to leave comments. Login now