##// END OF EJS Templates
tests: make (glob) on windows accept \ instead of /...
Mads Kiilerich -
r15447:9910f60a default
parent child Browse files
Show More
@@ -1,1257 +1,1259 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 #
2 #
3 # run-tests.py - Run a set of tests on Mercurial
3 # run-tests.py - Run a set of tests on Mercurial
4 #
4 #
5 # Copyright 2006 Matt Mackall <mpm@selenic.com>
5 # Copyright 2006 Matt Mackall <mpm@selenic.com>
6 #
6 #
7 # This software may be used and distributed according to the terms of the
7 # This software may be used and distributed according to the terms of the
8 # GNU General Public License version 2 or any later version.
8 # GNU General Public License version 2 or any later version.
9
9
10 # Modifying this script is tricky because it has many modes:
10 # Modifying this script is tricky because it has many modes:
11 # - serial (default) vs parallel (-jN, N > 1)
11 # - serial (default) vs parallel (-jN, N > 1)
12 # - no coverage (default) vs coverage (-c, -C, -s)
12 # - no coverage (default) vs coverage (-c, -C, -s)
13 # - temp install (default) vs specific hg script (--with-hg, --local)
13 # - temp install (default) vs specific hg script (--with-hg, --local)
14 # - tests are a mix of shell scripts and Python scripts
14 # - tests are a mix of shell scripts and Python scripts
15 #
15 #
16 # If you change this script, it is recommended that you ensure you
16 # If you change this script, it is recommended that you ensure you
17 # haven't broken it by running it in various modes with a representative
17 # haven't broken it by running it in various modes with a representative
18 # sample of test scripts. For example:
18 # sample of test scripts. For example:
19 #
19 #
20 # 1) serial, no coverage, temp install:
20 # 1) serial, no coverage, temp install:
21 # ./run-tests.py test-s*
21 # ./run-tests.py test-s*
22 # 2) serial, no coverage, local hg:
22 # 2) serial, no coverage, local hg:
23 # ./run-tests.py --local test-s*
23 # ./run-tests.py --local test-s*
24 # 3) serial, coverage, temp install:
24 # 3) serial, coverage, temp install:
25 # ./run-tests.py -c test-s*
25 # ./run-tests.py -c test-s*
26 # 4) serial, coverage, local hg:
26 # 4) serial, coverage, local hg:
27 # ./run-tests.py -c --local test-s* # unsupported
27 # ./run-tests.py -c --local test-s* # unsupported
28 # 5) parallel, no coverage, temp install:
28 # 5) parallel, no coverage, temp install:
29 # ./run-tests.py -j2 test-s*
29 # ./run-tests.py -j2 test-s*
30 # 6) parallel, no coverage, local hg:
30 # 6) parallel, no coverage, local hg:
31 # ./run-tests.py -j2 --local test-s*
31 # ./run-tests.py -j2 --local test-s*
32 # 7) parallel, coverage, temp install:
32 # 7) parallel, coverage, temp install:
33 # ./run-tests.py -j2 -c test-s* # currently broken
33 # ./run-tests.py -j2 -c test-s* # currently broken
34 # 8) parallel, coverage, local install:
34 # 8) parallel, coverage, local install:
35 # ./run-tests.py -j2 -c --local test-s* # unsupported (and broken)
35 # ./run-tests.py -j2 -c --local test-s* # unsupported (and broken)
36 # 9) parallel, custom tmp dir:
36 # 9) parallel, custom tmp dir:
37 # ./run-tests.py -j2 --tmpdir /tmp/myhgtests
37 # ./run-tests.py -j2 --tmpdir /tmp/myhgtests
38 #
38 #
39 # (You could use any subset of the tests: test-s* happens to match
39 # (You could use any subset of the tests: test-s* happens to match
40 # enough that it's worth doing parallel runs, few enough that it
40 # enough that it's worth doing parallel runs, few enough that it
41 # completes fairly quickly, includes both shell and Python scripts, and
41 # completes fairly quickly, includes both shell and Python scripts, and
42 # includes some scripts that run daemon processes.)
42 # includes some scripts that run daemon processes.)
43
43
44 from distutils import version
44 from distutils import version
45 import difflib
45 import difflib
46 import errno
46 import errno
47 import optparse
47 import optparse
48 import os
48 import os
49 import shutil
49 import shutil
50 import subprocess
50 import subprocess
51 import signal
51 import signal
52 import sys
52 import sys
53 import tempfile
53 import tempfile
54 import time
54 import time
55 import re
55 import re
56 import threading
56 import threading
57
57
58 processlock = threading.Lock()
58 processlock = threading.Lock()
59
59
60 closefds = os.name == 'posix'
60 closefds = os.name == 'posix'
61 def Popen4(cmd, wd, timeout):
61 def Popen4(cmd, wd, timeout):
62 processlock.acquire()
62 processlock.acquire()
63 p = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=wd,
63 p = subprocess.Popen(cmd, shell=True, bufsize=-1, cwd=wd,
64 close_fds=closefds,
64 close_fds=closefds,
65 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
65 stdin=subprocess.PIPE, stdout=subprocess.PIPE,
66 stderr=subprocess.STDOUT)
66 stderr=subprocess.STDOUT)
67 processlock.release()
67 processlock.release()
68
68
69 p.fromchild = p.stdout
69 p.fromchild = p.stdout
70 p.tochild = p.stdin
70 p.tochild = p.stdin
71 p.childerr = p.stderr
71 p.childerr = p.stderr
72
72
73 p.timeout = False
73 p.timeout = False
74 if timeout:
74 if timeout:
75 def t():
75 def t():
76 start = time.time()
76 start = time.time()
77 while time.time() - start < timeout and p.returncode is None:
77 while time.time() - start < timeout and p.returncode is None:
78 time.sleep(1)
78 time.sleep(1)
79 p.timeout = True
79 p.timeout = True
80 if p.returncode is None:
80 if p.returncode is None:
81 terminate(p)
81 terminate(p)
82 threading.Thread(target=t).start()
82 threading.Thread(target=t).start()
83
83
84 return p
84 return p
85
85
86 # reserved exit code to skip test (used by hghave)
86 # reserved exit code to skip test (used by hghave)
87 SKIPPED_STATUS = 80
87 SKIPPED_STATUS = 80
88 SKIPPED_PREFIX = 'skipped: '
88 SKIPPED_PREFIX = 'skipped: '
89 FAILED_PREFIX = 'hghave check failed: '
89 FAILED_PREFIX = 'hghave check failed: '
90 PYTHON = sys.executable
90 PYTHON = sys.executable
91 IMPL_PATH = 'PYTHONPATH'
91 IMPL_PATH = 'PYTHONPATH'
92 if 'java' in sys.platform:
92 if 'java' in sys.platform:
93 IMPL_PATH = 'JYTHONPATH'
93 IMPL_PATH = 'JYTHONPATH'
94
94
95 requiredtools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"]
95 requiredtools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"]
96
96
97 defaults = {
97 defaults = {
98 'jobs': ('HGTEST_JOBS', 1),
98 'jobs': ('HGTEST_JOBS', 1),
99 'timeout': ('HGTEST_TIMEOUT', 180),
99 'timeout': ('HGTEST_TIMEOUT', 180),
100 'port': ('HGTEST_PORT', 20059),
100 'port': ('HGTEST_PORT', 20059),
101 'shell': ('HGTEST_SHELL', '/bin/sh'),
101 'shell': ('HGTEST_SHELL', '/bin/sh'),
102 }
102 }
103
103
104 def parselistfiles(files, listtype, warn=True):
104 def parselistfiles(files, listtype, warn=True):
105 entries = dict()
105 entries = dict()
106 for filename in files:
106 for filename in files:
107 try:
107 try:
108 path = os.path.expanduser(os.path.expandvars(filename))
108 path = os.path.expanduser(os.path.expandvars(filename))
109 f = open(path, "r")
109 f = open(path, "r")
110 except IOError, err:
110 except IOError, err:
111 if err.errno != errno.ENOENT:
111 if err.errno != errno.ENOENT:
112 raise
112 raise
113 if warn:
113 if warn:
114 print "warning: no such %s file: %s" % (listtype, filename)
114 print "warning: no such %s file: %s" % (listtype, filename)
115 continue
115 continue
116
116
117 for line in f.readlines():
117 for line in f.readlines():
118 line = line.split('#', 1)[0].strip()
118 line = line.split('#', 1)[0].strip()
119 if line:
119 if line:
120 entries[line] = filename
120 entries[line] = filename
121
121
122 f.close()
122 f.close()
123 return entries
123 return entries
124
124
125 def parseargs():
125 def parseargs():
126 parser = optparse.OptionParser("%prog [options] [tests]")
126 parser = optparse.OptionParser("%prog [options] [tests]")
127
127
128 # keep these sorted
128 # keep these sorted
129 parser.add_option("--blacklist", action="append",
129 parser.add_option("--blacklist", action="append",
130 help="skip tests listed in the specified blacklist file")
130 help="skip tests listed in the specified blacklist file")
131 parser.add_option("--whitelist", action="append",
131 parser.add_option("--whitelist", action="append",
132 help="always run tests listed in the specified whitelist file")
132 help="always run tests listed in the specified whitelist file")
133 parser.add_option("-C", "--annotate", action="store_true",
133 parser.add_option("-C", "--annotate", action="store_true",
134 help="output files annotated with coverage")
134 help="output files annotated with coverage")
135 parser.add_option("--child", type="int",
135 parser.add_option("--child", type="int",
136 help="run as child process, summary to given fd")
136 help="run as child process, summary to given fd")
137 parser.add_option("-c", "--cover", action="store_true",
137 parser.add_option("-c", "--cover", action="store_true",
138 help="print a test coverage report")
138 help="print a test coverage report")
139 parser.add_option("-d", "--debug", action="store_true",
139 parser.add_option("-d", "--debug", action="store_true",
140 help="debug mode: write output of test scripts to console"
140 help="debug mode: write output of test scripts to console"
141 " rather than capturing and diff'ing it (disables timeout)")
141 " rather than capturing and diff'ing it (disables timeout)")
142 parser.add_option("-f", "--first", action="store_true",
142 parser.add_option("-f", "--first", action="store_true",
143 help="exit on the first test failure")
143 help="exit on the first test failure")
144 parser.add_option("--inotify", action="store_true",
144 parser.add_option("--inotify", action="store_true",
145 help="enable inotify extension when running tests")
145 help="enable inotify extension when running tests")
146 parser.add_option("-i", "--interactive", action="store_true",
146 parser.add_option("-i", "--interactive", action="store_true",
147 help="prompt to accept changed output")
147 help="prompt to accept changed output")
148 parser.add_option("-j", "--jobs", type="int",
148 parser.add_option("-j", "--jobs", type="int",
149 help="number of jobs to run in parallel"
149 help="number of jobs to run in parallel"
150 " (default: $%s or %d)" % defaults['jobs'])
150 " (default: $%s or %d)" % defaults['jobs'])
151 parser.add_option("--keep-tmpdir", action="store_true",
151 parser.add_option("--keep-tmpdir", action="store_true",
152 help="keep temporary directory after running tests")
152 help="keep temporary directory after running tests")
153 parser.add_option("-k", "--keywords",
153 parser.add_option("-k", "--keywords",
154 help="run tests matching keywords")
154 help="run tests matching keywords")
155 parser.add_option("-l", "--local", action="store_true",
155 parser.add_option("-l", "--local", action="store_true",
156 help="shortcut for --with-hg=<testdir>/../hg")
156 help="shortcut for --with-hg=<testdir>/../hg")
157 parser.add_option("-n", "--nodiff", action="store_true",
157 parser.add_option("-n", "--nodiff", action="store_true",
158 help="skip showing test changes")
158 help="skip showing test changes")
159 parser.add_option("-p", "--port", type="int",
159 parser.add_option("-p", "--port", type="int",
160 help="port on which servers should listen"
160 help="port on which servers should listen"
161 " (default: $%s or %d)" % defaults['port'])
161 " (default: $%s or %d)" % defaults['port'])
162 parser.add_option("--pure", action="store_true",
162 parser.add_option("--pure", action="store_true",
163 help="use pure Python code instead of C extensions")
163 help="use pure Python code instead of C extensions")
164 parser.add_option("-R", "--restart", action="store_true",
164 parser.add_option("-R", "--restart", action="store_true",
165 help="restart at last error")
165 help="restart at last error")
166 parser.add_option("-r", "--retest", action="store_true",
166 parser.add_option("-r", "--retest", action="store_true",
167 help="retest failed tests")
167 help="retest failed tests")
168 parser.add_option("-S", "--noskips", action="store_true",
168 parser.add_option("-S", "--noskips", action="store_true",
169 help="don't report skip tests verbosely")
169 help="don't report skip tests verbosely")
170 parser.add_option("--shell", type="string",
170 parser.add_option("--shell", type="string",
171 help="shell to use (default: $%s or %s)" % defaults['shell'])
171 help="shell to use (default: $%s or %s)" % defaults['shell'])
172 parser.add_option("-t", "--timeout", type="int",
172 parser.add_option("-t", "--timeout", type="int",
173 help="kill errant tests after TIMEOUT seconds"
173 help="kill errant tests after TIMEOUT seconds"
174 " (default: $%s or %d)" % defaults['timeout'])
174 " (default: $%s or %d)" % defaults['timeout'])
175 parser.add_option("--tmpdir", type="string",
175 parser.add_option("--tmpdir", type="string",
176 help="run tests in the given temporary directory"
176 help="run tests in the given temporary directory"
177 " (implies --keep-tmpdir)")
177 " (implies --keep-tmpdir)")
178 parser.add_option("-v", "--verbose", action="store_true",
178 parser.add_option("-v", "--verbose", action="store_true",
179 help="output verbose messages")
179 help="output verbose messages")
180 parser.add_option("--view", type="string",
180 parser.add_option("--view", type="string",
181 help="external diff viewer")
181 help="external diff viewer")
182 parser.add_option("--with-hg", type="string",
182 parser.add_option("--with-hg", type="string",
183 metavar="HG",
183 metavar="HG",
184 help="test using specified hg script rather than a "
184 help="test using specified hg script rather than a "
185 "temporary installation")
185 "temporary installation")
186 parser.add_option("-3", "--py3k-warnings", action="store_true",
186 parser.add_option("-3", "--py3k-warnings", action="store_true",
187 help="enable Py3k warnings on Python 2.6+")
187 help="enable Py3k warnings on Python 2.6+")
188 parser.add_option('--extra-config-opt', action="append",
188 parser.add_option('--extra-config-opt', action="append",
189 help='set the given config opt in the test hgrc')
189 help='set the given config opt in the test hgrc')
190
190
191 for option, (envvar, default) in defaults.items():
191 for option, (envvar, default) in defaults.items():
192 defaults[option] = type(default)(os.environ.get(envvar, default))
192 defaults[option] = type(default)(os.environ.get(envvar, default))
193 parser.set_defaults(**defaults)
193 parser.set_defaults(**defaults)
194 (options, args) = parser.parse_args()
194 (options, args) = parser.parse_args()
195
195
196 # jython is always pure
196 # jython is always pure
197 if 'java' in sys.platform or '__pypy__' in sys.modules:
197 if 'java' in sys.platform or '__pypy__' in sys.modules:
198 options.pure = True
198 options.pure = True
199
199
200 if options.with_hg:
200 if options.with_hg:
201 if not (os.path.isfile(options.with_hg) and
201 if not (os.path.isfile(options.with_hg) and
202 os.access(options.with_hg, os.X_OK)):
202 os.access(options.with_hg, os.X_OK)):
203 parser.error('--with-hg must specify an executable hg script')
203 parser.error('--with-hg must specify an executable hg script')
204 if not os.path.basename(options.with_hg) == 'hg':
204 if not os.path.basename(options.with_hg) == 'hg':
205 sys.stderr.write('warning: --with-hg should specify an hg script\n')
205 sys.stderr.write('warning: --with-hg should specify an hg script\n')
206 if options.local:
206 if options.local:
207 testdir = os.path.dirname(os.path.realpath(sys.argv[0]))
207 testdir = os.path.dirname(os.path.realpath(sys.argv[0]))
208 hgbin = os.path.join(os.path.dirname(testdir), 'hg')
208 hgbin = os.path.join(os.path.dirname(testdir), 'hg')
209 if not os.access(hgbin, os.X_OK):
209 if not os.access(hgbin, os.X_OK):
210 parser.error('--local specified, but %r not found or not executable'
210 parser.error('--local specified, but %r not found or not executable'
211 % hgbin)
211 % hgbin)
212 options.with_hg = hgbin
212 options.with_hg = hgbin
213
213
214 options.anycoverage = options.cover or options.annotate
214 options.anycoverage = options.cover or options.annotate
215 if options.anycoverage:
215 if options.anycoverage:
216 try:
216 try:
217 import coverage
217 import coverage
218 covver = version.StrictVersion(coverage.__version__).version
218 covver = version.StrictVersion(coverage.__version__).version
219 if covver < (3, 3):
219 if covver < (3, 3):
220 parser.error('coverage options require coverage 3.3 or later')
220 parser.error('coverage options require coverage 3.3 or later')
221 except ImportError:
221 except ImportError:
222 parser.error('coverage options now require the coverage package')
222 parser.error('coverage options now require the coverage package')
223
223
224 if options.anycoverage and options.local:
224 if options.anycoverage and options.local:
225 # this needs some path mangling somewhere, I guess
225 # this needs some path mangling somewhere, I guess
226 parser.error("sorry, coverage options do not work when --local "
226 parser.error("sorry, coverage options do not work when --local "
227 "is specified")
227 "is specified")
228
228
229 global vlog
229 global vlog
230 if options.verbose:
230 if options.verbose:
231 if options.jobs > 1 or options.child is not None:
231 if options.jobs > 1 or options.child is not None:
232 pid = "[%d]" % os.getpid()
232 pid = "[%d]" % os.getpid()
233 else:
233 else:
234 pid = None
234 pid = None
235 def vlog(*msg):
235 def vlog(*msg):
236 iolock.acquire()
236 iolock.acquire()
237 if pid:
237 if pid:
238 print pid,
238 print pid,
239 for m in msg:
239 for m in msg:
240 print m,
240 print m,
241 print
241 print
242 sys.stdout.flush()
242 sys.stdout.flush()
243 iolock.release()
243 iolock.release()
244 else:
244 else:
245 vlog = lambda *msg: None
245 vlog = lambda *msg: None
246
246
247 if options.tmpdir:
247 if options.tmpdir:
248 options.tmpdir = os.path.expanduser(options.tmpdir)
248 options.tmpdir = os.path.expanduser(options.tmpdir)
249
249
250 if options.jobs < 1:
250 if options.jobs < 1:
251 parser.error('--jobs must be positive')
251 parser.error('--jobs must be positive')
252 if options.interactive and options.jobs > 1:
252 if options.interactive and options.jobs > 1:
253 print '(--interactive overrides --jobs)'
253 print '(--interactive overrides --jobs)'
254 options.jobs = 1
254 options.jobs = 1
255 if options.interactive and options.debug:
255 if options.interactive and options.debug:
256 parser.error("-i/--interactive and -d/--debug are incompatible")
256 parser.error("-i/--interactive and -d/--debug are incompatible")
257 if options.debug:
257 if options.debug:
258 if options.timeout != defaults['timeout']:
258 if options.timeout != defaults['timeout']:
259 sys.stderr.write(
259 sys.stderr.write(
260 'warning: --timeout option ignored with --debug\n')
260 'warning: --timeout option ignored with --debug\n')
261 options.timeout = 0
261 options.timeout = 0
262 if options.py3k_warnings:
262 if options.py3k_warnings:
263 if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
263 if sys.version_info[:2] < (2, 6) or sys.version_info[:2] >= (3, 0):
264 parser.error('--py3k-warnings can only be used on Python 2.6+')
264 parser.error('--py3k-warnings can only be used on Python 2.6+')
265 if options.blacklist:
265 if options.blacklist:
266 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
266 options.blacklist = parselistfiles(options.blacklist, 'blacklist')
267 if options.whitelist:
267 if options.whitelist:
268 options.whitelisted = parselistfiles(options.whitelist, 'whitelist',
268 options.whitelisted = parselistfiles(options.whitelist, 'whitelist',
269 warn=options.child is None)
269 warn=options.child is None)
270 else:
270 else:
271 options.whitelisted = {}
271 options.whitelisted = {}
272
272
273 return (options, args)
273 return (options, args)
274
274
275 def rename(src, dst):
275 def rename(src, dst):
276 """Like os.rename(), trade atomicity and opened files friendliness
276 """Like os.rename(), trade atomicity and opened files friendliness
277 for existing destination support.
277 for existing destination support.
278 """
278 """
279 shutil.copy(src, dst)
279 shutil.copy(src, dst)
280 os.remove(src)
280 os.remove(src)
281
281
282 def splitnewlines(text):
282 def splitnewlines(text):
283 '''like str.splitlines, but only split on newlines.
283 '''like str.splitlines, but only split on newlines.
284 keep line endings.'''
284 keep line endings.'''
285 i = 0
285 i = 0
286 lines = []
286 lines = []
287 while True:
287 while True:
288 n = text.find('\n', i)
288 n = text.find('\n', i)
289 if n == -1:
289 if n == -1:
290 last = text[i:]
290 last = text[i:]
291 if last:
291 if last:
292 lines.append(last)
292 lines.append(last)
293 return lines
293 return lines
294 lines.append(text[i:n + 1])
294 lines.append(text[i:n + 1])
295 i = n + 1
295 i = n + 1
296
296
297 def parsehghaveoutput(lines):
297 def parsehghaveoutput(lines):
298 '''Parse hghave log lines.
298 '''Parse hghave log lines.
299 Return tuple of lists (missing, failed):
299 Return tuple of lists (missing, failed):
300 * the missing/unknown features
300 * the missing/unknown features
301 * the features for which existence check failed'''
301 * the features for which existence check failed'''
302 missing = []
302 missing = []
303 failed = []
303 failed = []
304 for line in lines:
304 for line in lines:
305 if line.startswith(SKIPPED_PREFIX):
305 if line.startswith(SKIPPED_PREFIX):
306 line = line.splitlines()[0]
306 line = line.splitlines()[0]
307 missing.append(line[len(SKIPPED_PREFIX):])
307 missing.append(line[len(SKIPPED_PREFIX):])
308 elif line.startswith(FAILED_PREFIX):
308 elif line.startswith(FAILED_PREFIX):
309 line = line.splitlines()[0]
309 line = line.splitlines()[0]
310 failed.append(line[len(FAILED_PREFIX):])
310 failed.append(line[len(FAILED_PREFIX):])
311
311
312 return missing, failed
312 return missing, failed
313
313
314 def showdiff(expected, output, ref, err):
314 def showdiff(expected, output, ref, err):
315 print
315 print
316 for line in difflib.unified_diff(expected, output, ref, err):
316 for line in difflib.unified_diff(expected, output, ref, err):
317 sys.stdout.write(line)
317 sys.stdout.write(line)
318
318
319 def findprogram(program):
319 def findprogram(program):
320 """Search PATH for a executable program"""
320 """Search PATH for a executable program"""
321 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
321 for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
322 name = os.path.join(p, program)
322 name = os.path.join(p, program)
323 if os.name == 'nt' or os.access(name, os.X_OK):
323 if os.name == 'nt' or os.access(name, os.X_OK):
324 return name
324 return name
325 return None
325 return None
326
326
327 def checktools():
327 def checktools():
328 # Before we go any further, check for pre-requisite tools
328 # Before we go any further, check for pre-requisite tools
329 # stuff from coreutils (cat, rm, etc) are not tested
329 # stuff from coreutils (cat, rm, etc) are not tested
330 for p in requiredtools:
330 for p in requiredtools:
331 if os.name == 'nt':
331 if os.name == 'nt':
332 p += '.exe'
332 p += '.exe'
333 found = findprogram(p)
333 found = findprogram(p)
334 if found:
334 if found:
335 vlog("# Found prerequisite", p, "at", found)
335 vlog("# Found prerequisite", p, "at", found)
336 else:
336 else:
337 print "WARNING: Did not find prerequisite tool: "+p
337 print "WARNING: Did not find prerequisite tool: "+p
338
338
339 def terminate(proc):
339 def terminate(proc):
340 """Terminate subprocess (with fallback for Python versions < 2.6)"""
340 """Terminate subprocess (with fallback for Python versions < 2.6)"""
341 vlog('# Terminating process %d' % proc.pid)
341 vlog('# Terminating process %d' % proc.pid)
342 try:
342 try:
343 getattr(proc, 'terminate', lambda : os.kill(proc.pid, signal.SIGTERM))()
343 getattr(proc, 'terminate', lambda : os.kill(proc.pid, signal.SIGTERM))()
344 except OSError:
344 except OSError:
345 pass
345 pass
346
346
347 def killdaemons():
347 def killdaemons():
348 # Kill off any leftover daemon processes
348 # Kill off any leftover daemon processes
349 try:
349 try:
350 fp = open(DAEMON_PIDS)
350 fp = open(DAEMON_PIDS)
351 for line in fp:
351 for line in fp:
352 try:
352 try:
353 pid = int(line)
353 pid = int(line)
354 except ValueError:
354 except ValueError:
355 continue
355 continue
356 try:
356 try:
357 os.kill(pid, 0)
357 os.kill(pid, 0)
358 vlog('# Killing daemon process %d' % pid)
358 vlog('# Killing daemon process %d' % pid)
359 os.kill(pid, signal.SIGTERM)
359 os.kill(pid, signal.SIGTERM)
360 time.sleep(0.25)
360 time.sleep(0.25)
361 os.kill(pid, 0)
361 os.kill(pid, 0)
362 vlog('# Daemon process %d is stuck - really killing it' % pid)
362 vlog('# Daemon process %d is stuck - really killing it' % pid)
363 os.kill(pid, signal.SIGKILL)
363 os.kill(pid, signal.SIGKILL)
364 except OSError, err:
364 except OSError, err:
365 if err.errno != errno.ESRCH:
365 if err.errno != errno.ESRCH:
366 raise
366 raise
367 fp.close()
367 fp.close()
368 os.unlink(DAEMON_PIDS)
368 os.unlink(DAEMON_PIDS)
369 except IOError:
369 except IOError:
370 pass
370 pass
371
371
372 def cleanup(options):
372 def cleanup(options):
373 if not options.keep_tmpdir:
373 if not options.keep_tmpdir:
374 vlog("# Cleaning up HGTMP", HGTMP)
374 vlog("# Cleaning up HGTMP", HGTMP)
375 shutil.rmtree(HGTMP, True)
375 shutil.rmtree(HGTMP, True)
376
376
377 def usecorrectpython():
377 def usecorrectpython():
378 # some tests run python interpreter. they must use same
378 # some tests run python interpreter. they must use same
379 # interpreter we use or bad things will happen.
379 # interpreter we use or bad things will happen.
380 exedir, exename = os.path.split(sys.executable)
380 exedir, exename = os.path.split(sys.executable)
381 if exename in ('python', 'python.exe'):
381 if exename in ('python', 'python.exe'):
382 path = findprogram(exename)
382 path = findprogram(exename)
383 if os.path.dirname(path) == exedir:
383 if os.path.dirname(path) == exedir:
384 return
384 return
385 else:
385 else:
386 exename = 'python'
386 exename = 'python'
387 vlog('# Making python executable in test path use correct Python')
387 vlog('# Making python executable in test path use correct Python')
388 mypython = os.path.join(BINDIR, exename)
388 mypython = os.path.join(BINDIR, exename)
389 try:
389 try:
390 os.symlink(sys.executable, mypython)
390 os.symlink(sys.executable, mypython)
391 except AttributeError:
391 except AttributeError:
392 # windows fallback
392 # windows fallback
393 shutil.copyfile(sys.executable, mypython)
393 shutil.copyfile(sys.executable, mypython)
394 shutil.copymode(sys.executable, mypython)
394 shutil.copymode(sys.executable, mypython)
395
395
396 def installhg(options):
396 def installhg(options):
397 vlog("# Performing temporary installation of HG")
397 vlog("# Performing temporary installation of HG")
398 installerrs = os.path.join("tests", "install.err")
398 installerrs = os.path.join("tests", "install.err")
399 pure = options.pure and "--pure" or ""
399 pure = options.pure and "--pure" or ""
400
400
401 # Run installer in hg root
401 # Run installer in hg root
402 script = os.path.realpath(sys.argv[0])
402 script = os.path.realpath(sys.argv[0])
403 hgroot = os.path.dirname(os.path.dirname(script))
403 hgroot = os.path.dirname(os.path.dirname(script))
404 os.chdir(hgroot)
404 os.chdir(hgroot)
405 nohome = '--home=""'
405 nohome = '--home=""'
406 if os.name == 'nt':
406 if os.name == 'nt':
407 # The --home="" trick works only on OS where os.sep == '/'
407 # The --home="" trick works only on OS where os.sep == '/'
408 # because of a distutils convert_path() fast-path. Avoid it at
408 # because of a distutils convert_path() fast-path. Avoid it at
409 # least on Windows for now, deal with .pydistutils.cfg bugs
409 # least on Windows for now, deal with .pydistutils.cfg bugs
410 # when they happen.
410 # when they happen.
411 nohome = ''
411 nohome = ''
412 cmd = ('%s setup.py %s clean --all'
412 cmd = ('%s setup.py %s clean --all'
413 ' build --build-base="%s"'
413 ' build --build-base="%s"'
414 ' install --force --prefix="%s" --install-lib="%s"'
414 ' install --force --prefix="%s" --install-lib="%s"'
415 ' --install-scripts="%s" %s >%s 2>&1'
415 ' --install-scripts="%s" %s >%s 2>&1'
416 % (sys.executable, pure, os.path.join(HGTMP, "build"),
416 % (sys.executable, pure, os.path.join(HGTMP, "build"),
417 INST, PYTHONDIR, BINDIR, nohome, installerrs))
417 INST, PYTHONDIR, BINDIR, nohome, installerrs))
418 vlog("# Running", cmd)
418 vlog("# Running", cmd)
419 if os.system(cmd) == 0:
419 if os.system(cmd) == 0:
420 if not options.verbose:
420 if not options.verbose:
421 os.remove(installerrs)
421 os.remove(installerrs)
422 else:
422 else:
423 f = open(installerrs)
423 f = open(installerrs)
424 for line in f:
424 for line in f:
425 print line,
425 print line,
426 f.close()
426 f.close()
427 sys.exit(1)
427 sys.exit(1)
428 os.chdir(TESTDIR)
428 os.chdir(TESTDIR)
429
429
430 usecorrectpython()
430 usecorrectpython()
431
431
432 vlog("# Installing dummy diffstat")
432 vlog("# Installing dummy diffstat")
433 f = open(os.path.join(BINDIR, 'diffstat'), 'w')
433 f = open(os.path.join(BINDIR, 'diffstat'), 'w')
434 f.write('#!' + sys.executable + '\n'
434 f.write('#!' + sys.executable + '\n'
435 'import sys\n'
435 'import sys\n'
436 'files = 0\n'
436 'files = 0\n'
437 'for line in sys.stdin:\n'
437 'for line in sys.stdin:\n'
438 ' if line.startswith("diff "):\n'
438 ' if line.startswith("diff "):\n'
439 ' files += 1\n'
439 ' files += 1\n'
440 'sys.stdout.write("files patched: %d\\n" % files)\n')
440 'sys.stdout.write("files patched: %d\\n" % files)\n')
441 f.close()
441 f.close()
442 os.chmod(os.path.join(BINDIR, 'diffstat'), 0700)
442 os.chmod(os.path.join(BINDIR, 'diffstat'), 0700)
443
443
444 if options.py3k_warnings and not options.anycoverage:
444 if options.py3k_warnings and not options.anycoverage:
445 vlog("# Updating hg command to enable Py3k Warnings switch")
445 vlog("# Updating hg command to enable Py3k Warnings switch")
446 f = open(os.path.join(BINDIR, 'hg'), 'r')
446 f = open(os.path.join(BINDIR, 'hg'), 'r')
447 lines = [line.rstrip() for line in f]
447 lines = [line.rstrip() for line in f]
448 lines[0] += ' -3'
448 lines[0] += ' -3'
449 f.close()
449 f.close()
450 f = open(os.path.join(BINDIR, 'hg'), 'w')
450 f = open(os.path.join(BINDIR, 'hg'), 'w')
451 for line in lines:
451 for line in lines:
452 f.write(line + '\n')
452 f.write(line + '\n')
453 f.close()
453 f.close()
454
454
455 hgbat = os.path.join(BINDIR, 'hg.bat')
455 hgbat = os.path.join(BINDIR, 'hg.bat')
456 if os.path.isfile(hgbat):
456 if os.path.isfile(hgbat):
457 # hg.bat expects to be put in bin/scripts while run-tests.py
457 # hg.bat expects to be put in bin/scripts while run-tests.py
458 # installation layout put it in bin/ directly. Fix it
458 # installation layout put it in bin/ directly. Fix it
459 f = open(hgbat, 'rb')
459 f = open(hgbat, 'rb')
460 data = f.read()
460 data = f.read()
461 f.close()
461 f.close()
462 if '"%~dp0..\python" "%~dp0hg" %*' in data:
462 if '"%~dp0..\python" "%~dp0hg" %*' in data:
463 data = data.replace('"%~dp0..\python" "%~dp0hg" %*',
463 data = data.replace('"%~dp0..\python" "%~dp0hg" %*',
464 '"%~dp0python" "%~dp0hg" %*')
464 '"%~dp0python" "%~dp0hg" %*')
465 f = open(hgbat, 'wb')
465 f = open(hgbat, 'wb')
466 f.write(data)
466 f.write(data)
467 f.close()
467 f.close()
468 else:
468 else:
469 print 'WARNING: cannot fix hg.bat reference to python.exe'
469 print 'WARNING: cannot fix hg.bat reference to python.exe'
470
470
471 if options.anycoverage:
471 if options.anycoverage:
472 custom = os.path.join(TESTDIR, 'sitecustomize.py')
472 custom = os.path.join(TESTDIR, 'sitecustomize.py')
473 target = os.path.join(PYTHONDIR, 'sitecustomize.py')
473 target = os.path.join(PYTHONDIR, 'sitecustomize.py')
474 vlog('# Installing coverage trigger to %s' % target)
474 vlog('# Installing coverage trigger to %s' % target)
475 shutil.copyfile(custom, target)
475 shutil.copyfile(custom, target)
476 rc = os.path.join(TESTDIR, '.coveragerc')
476 rc = os.path.join(TESTDIR, '.coveragerc')
477 vlog('# Installing coverage rc to %s' % rc)
477 vlog('# Installing coverage rc to %s' % rc)
478 os.environ['COVERAGE_PROCESS_START'] = rc
478 os.environ['COVERAGE_PROCESS_START'] = rc
479 fn = os.path.join(INST, '..', '.coverage')
479 fn = os.path.join(INST, '..', '.coverage')
480 os.environ['COVERAGE_FILE'] = fn
480 os.environ['COVERAGE_FILE'] = fn
481
481
482 def outputcoverage(options):
482 def outputcoverage(options):
483
483
484 vlog('# Producing coverage report')
484 vlog('# Producing coverage report')
485 os.chdir(PYTHONDIR)
485 os.chdir(PYTHONDIR)
486
486
487 def covrun(*args):
487 def covrun(*args):
488 cmd = 'coverage %s' % ' '.join(args)
488 cmd = 'coverage %s' % ' '.join(args)
489 vlog('# Running: %s' % cmd)
489 vlog('# Running: %s' % cmd)
490 os.system(cmd)
490 os.system(cmd)
491
491
492 if options.child:
492 if options.child:
493 return
493 return
494
494
495 covrun('-c')
495 covrun('-c')
496 omit = ','.join([BINDIR, TESTDIR])
496 omit = ','.join([BINDIR, TESTDIR])
497 covrun('-i', '-r', '"--omit=%s"' % omit) # report
497 covrun('-i', '-r', '"--omit=%s"' % omit) # report
498 if options.annotate:
498 if options.annotate:
499 adir = os.path.join(TESTDIR, 'annotated')
499 adir = os.path.join(TESTDIR, 'annotated')
500 if not os.path.isdir(adir):
500 if not os.path.isdir(adir):
501 os.mkdir(adir)
501 os.mkdir(adir)
502 covrun('-i', '-a', '"--directory=%s"' % adir, '"--omit=%s"' % omit)
502 covrun('-i', '-a', '"--directory=%s"' % adir, '"--omit=%s"' % omit)
503
503
504 def pytest(test, wd, options, replacements):
504 def pytest(test, wd, options, replacements):
505 py3kswitch = options.py3k_warnings and ' -3' or ''
505 py3kswitch = options.py3k_warnings and ' -3' or ''
506 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
506 cmd = '%s%s "%s"' % (PYTHON, py3kswitch, test)
507 vlog("# Running", cmd)
507 vlog("# Running", cmd)
508 return run(cmd, wd, options, replacements)
508 return run(cmd, wd, options, replacements)
509
509
510 def shtest(test, wd, options, replacements):
510 def shtest(test, wd, options, replacements):
511 cmd = '"%s"' % test
511 cmd = '"%s"' % test
512 vlog("# Running", cmd)
512 vlog("# Running", cmd)
513 return run(cmd, wd, options, replacements)
513 return run(cmd, wd, options, replacements)
514
514
515 needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
515 needescape = re.compile(r'[\x00-\x08\x0b-\x1f\x7f-\xff]').search
516 escapesub = re.compile(r'[\x00-\x08\x0b-\x1f\\\x7f-\xff]').sub
516 escapesub = re.compile(r'[\x00-\x08\x0b-\x1f\\\x7f-\xff]').sub
517 escapemap = dict((chr(i), r'\x%02x' % i) for i in range(256))
517 escapemap = dict((chr(i), r'\x%02x' % i) for i in range(256))
518 escapemap.update({'\\': '\\\\', '\r': r'\r'})
518 escapemap.update({'\\': '\\\\', '\r': r'\r'})
519 def escapef(m):
519 def escapef(m):
520 return escapemap[m.group(0)]
520 return escapemap[m.group(0)]
521 def stringescape(s):
521 def stringescape(s):
522 return escapesub(escapef, s)
522 return escapesub(escapef, s)
523
523
524 def rematch(el, l):
524 def rematch(el, l):
525 try:
525 try:
526 # ensure that the regex matches to the end of the string
526 # ensure that the regex matches to the end of the string
527 return re.match(el + r'\Z', l)
527 return re.match(el + r'\Z', l)
528 except re.error:
528 except re.error:
529 # el is an invalid regex
529 # el is an invalid regex
530 return False
530 return False
531
531
532 def globmatch(el, l):
532 def globmatch(el, l):
533 # The only supported special characters are * and ?. Escaping is
533 # The only supported special characters are * and ? plus / which also
534 # supported.
534 # matches \ on windows. Escaping of these caracters is supported.
535 i, n = 0, len(el)
535 i, n = 0, len(el)
536 res = ''
536 res = ''
537 while i < n:
537 while i < n:
538 c = el[i]
538 c = el[i]
539 i += 1
539 i += 1
540 if c == '\\' and el[i] in '*?\\':
540 if c == '\\' and el[i] in '*?\\/':
541 res += el[i - 1:i + 1]
541 res += el[i - 1:i + 1]
542 i += 1
542 i += 1
543 elif c == '*':
543 elif c == '*':
544 res += '.*'
544 res += '.*'
545 elif c == '?':
545 elif c == '?':
546 res += '.'
546 res += '.'
547 elif c == '/' and os.name == 'nt':
548 res += '[/\\\\]'
547 else:
549 else:
548 res += re.escape(c)
550 res += re.escape(c)
549 return rematch(res, l)
551 return rematch(res, l)
550
552
551 def linematch(el, l):
553 def linematch(el, l):
552 if el == l: # perfect match (fast)
554 if el == l: # perfect match (fast)
553 return True
555 return True
554 if (el and
556 if (el and
555 (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
557 (el.endswith(" (re)\n") and rematch(el[:-6] + '\n', l) or
556 el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l) or
558 el.endswith(" (glob)\n") and globmatch(el[:-8] + '\n', l) or
557 el.endswith(" (esc)\n") and
559 el.endswith(" (esc)\n") and
558 el[:-7].decode('string-escape') + '\n' == l)):
560 el[:-7].decode('string-escape') + '\n' == l)):
559 return True
561 return True
560 return False
562 return False
561
563
562 def tsttest(test, wd, options, replacements):
564 def tsttest(test, wd, options, replacements):
563 # We generate a shell script which outputs unique markers to line
565 # We generate a shell script which outputs unique markers to line
564 # up script results with our source. These markers include input
566 # up script results with our source. These markers include input
565 # line number and the last return code
567 # line number and the last return code
566 salt = "SALT" + str(time.time())
568 salt = "SALT" + str(time.time())
567 def addsalt(line, inpython):
569 def addsalt(line, inpython):
568 if inpython:
570 if inpython:
569 script.append('%s %d 0\n' % (salt, line))
571 script.append('%s %d 0\n' % (salt, line))
570 else:
572 else:
571 script.append('echo %s %s $?\n' % (salt, line))
573 script.append('echo %s %s $?\n' % (salt, line))
572
574
573 # After we run the shell script, we re-unify the script output
575 # After we run the shell script, we re-unify the script output
574 # with non-active parts of the source, with synchronization by our
576 # with non-active parts of the source, with synchronization by our
575 # SALT line number markers. The after table contains the
577 # SALT line number markers. The after table contains the
576 # non-active components, ordered by line number
578 # non-active components, ordered by line number
577 after = {}
579 after = {}
578 pos = prepos = -1
580 pos = prepos = -1
579
581
580 # Expected shellscript output
582 # Expected shellscript output
581 expected = {}
583 expected = {}
582
584
583 # We keep track of whether or not we're in a Python block so we
585 # We keep track of whether or not we're in a Python block so we
584 # can generate the surrounding doctest magic
586 # can generate the surrounding doctest magic
585 inpython = False
587 inpython = False
586
588
587 f = open(test)
589 f = open(test)
588 t = f.readlines()
590 t = f.readlines()
589 f.close()
591 f.close()
590
592
591 script = []
593 script = []
592 for n, l in enumerate(t):
594 for n, l in enumerate(t):
593 if not l.endswith('\n'):
595 if not l.endswith('\n'):
594 l += '\n'
596 l += '\n'
595 if l.startswith(' >>> '): # python inlines
597 if l.startswith(' >>> '): # python inlines
596 after.setdefault(pos, []).append(l)
598 after.setdefault(pos, []).append(l)
597 prepos = pos
599 prepos = pos
598 pos = n
600 pos = n
599 if not inpython:
601 if not inpython:
600 # we've just entered a Python block, add the header
602 # we've just entered a Python block, add the header
601 inpython = True
603 inpython = True
602 addsalt(prepos, False) # make sure we report the exit code
604 addsalt(prepos, False) # make sure we report the exit code
603 script.append('%s -m heredoctest <<EOF\n' % PYTHON)
605 script.append('%s -m heredoctest <<EOF\n' % PYTHON)
604 addsalt(n, True)
606 addsalt(n, True)
605 script.append(l[2:])
607 script.append(l[2:])
606 if l.startswith(' ... '): # python inlines
608 if l.startswith(' ... '): # python inlines
607 after.setdefault(prepos, []).append(l)
609 after.setdefault(prepos, []).append(l)
608 script.append(l[2:])
610 script.append(l[2:])
609 elif l.startswith(' $ '): # commands
611 elif l.startswith(' $ '): # commands
610 if inpython:
612 if inpython:
611 script.append("EOF\n")
613 script.append("EOF\n")
612 inpython = False
614 inpython = False
613 after.setdefault(pos, []).append(l)
615 after.setdefault(pos, []).append(l)
614 prepos = pos
616 prepos = pos
615 pos = n
617 pos = n
616 addsalt(n, False)
618 addsalt(n, False)
617 script.append(l[4:])
619 script.append(l[4:])
618 elif l.startswith(' > '): # continuations
620 elif l.startswith(' > '): # continuations
619 after.setdefault(prepos, []).append(l)
621 after.setdefault(prepos, []).append(l)
620 script.append(l[4:])
622 script.append(l[4:])
621 elif l.startswith(' '): # results
623 elif l.startswith(' '): # results
622 # queue up a list of expected results
624 # queue up a list of expected results
623 expected.setdefault(pos, []).append(l[2:])
625 expected.setdefault(pos, []).append(l[2:])
624 else:
626 else:
625 if inpython:
627 if inpython:
626 script.append("EOF\n")
628 script.append("EOF\n")
627 inpython = False
629 inpython = False
628 # non-command/result - queue up for merged output
630 # non-command/result - queue up for merged output
629 after.setdefault(pos, []).append(l)
631 after.setdefault(pos, []).append(l)
630
632
631 if inpython:
633 if inpython:
632 script.append("EOF\n")
634 script.append("EOF\n")
633 addsalt(n + 1, False)
635 addsalt(n + 1, False)
634
636
635 # Write out the script and execute it
637 # Write out the script and execute it
636 fd, name = tempfile.mkstemp(suffix='hg-tst')
638 fd, name = tempfile.mkstemp(suffix='hg-tst')
637 try:
639 try:
638 for l in script:
640 for l in script:
639 os.write(fd, l)
641 os.write(fd, l)
640 os.close(fd)
642 os.close(fd)
641
643
642 cmd = '"%s" "%s"' % (options.shell, name)
644 cmd = '"%s" "%s"' % (options.shell, name)
643 vlog("# Running", cmd)
645 vlog("# Running", cmd)
644 exitcode, output = run(cmd, wd, options, replacements)
646 exitcode, output = run(cmd, wd, options, replacements)
645 # do not merge output if skipped, return hghave message instead
647 # do not merge output if skipped, return hghave message instead
646 # similarly, with --debug, output is None
648 # similarly, with --debug, output is None
647 if exitcode == SKIPPED_STATUS or output is None:
649 if exitcode == SKIPPED_STATUS or output is None:
648 return exitcode, output
650 return exitcode, output
649 finally:
651 finally:
650 os.remove(name)
652 os.remove(name)
651
653
652 # Merge the script output back into a unified test
654 # Merge the script output back into a unified test
653
655
654 pos = -1
656 pos = -1
655 postout = []
657 postout = []
656 ret = 0
658 ret = 0
657 for n, l in enumerate(output):
659 for n, l in enumerate(output):
658 lout, lcmd = l, None
660 lout, lcmd = l, None
659 if salt in l:
661 if salt in l:
660 lout, lcmd = l.split(salt, 1)
662 lout, lcmd = l.split(salt, 1)
661
663
662 if lout:
664 if lout:
663 if lcmd:
665 if lcmd:
664 # output block had no trailing newline, clean up
666 # output block had no trailing newline, clean up
665 lout += ' (no-eol)\n'
667 lout += ' (no-eol)\n'
666
668
667 # find the expected output at the current position
669 # find the expected output at the current position
668 el = None
670 el = None
669 if pos in expected and expected[pos]:
671 if pos in expected and expected[pos]:
670 el = expected[pos].pop(0)
672 el = expected[pos].pop(0)
671
673
672 if linematch(el, lout):
674 if linematch(el, lout):
673 postout.append(" " + el)
675 postout.append(" " + el)
674 else:
676 else:
675 if needescape(lout):
677 if needescape(lout):
676 lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
678 lout = stringescape(lout.rstrip('\n')) + " (esc)\n"
677 postout.append(" " + lout) # let diff deal with it
679 postout.append(" " + lout) # let diff deal with it
678
680
679 if lcmd:
681 if lcmd:
680 # add on last return code
682 # add on last return code
681 ret = int(lcmd.split()[1])
683 ret = int(lcmd.split()[1])
682 if ret != 0:
684 if ret != 0:
683 postout.append(" [%s]\n" % ret)
685 postout.append(" [%s]\n" % ret)
684 if pos in after:
686 if pos in after:
685 # merge in non-active test bits
687 # merge in non-active test bits
686 postout += after.pop(pos)
688 postout += after.pop(pos)
687 pos = int(lcmd.split()[0])
689 pos = int(lcmd.split()[0])
688
690
689 if pos in after:
691 if pos in after:
690 postout += after.pop(pos)
692 postout += after.pop(pos)
691
693
692 return exitcode, postout
694 return exitcode, postout
693
695
694 wifexited = getattr(os, "WIFEXITED", lambda x: False)
696 wifexited = getattr(os, "WIFEXITED", lambda x: False)
695 def run(cmd, wd, options, replacements):
697 def run(cmd, wd, options, replacements):
696 """Run command in a sub-process, capturing the output (stdout and stderr).
698 """Run command in a sub-process, capturing the output (stdout and stderr).
697 Return a tuple (exitcode, output). output is None in debug mode."""
699 Return a tuple (exitcode, output). output is None in debug mode."""
698 # TODO: Use subprocess.Popen if we're running on Python 2.4
700 # TODO: Use subprocess.Popen if we're running on Python 2.4
699 if options.debug:
701 if options.debug:
700 proc = subprocess.Popen(cmd, shell=True, cwd=wd)
702 proc = subprocess.Popen(cmd, shell=True, cwd=wd)
701 ret = proc.wait()
703 ret = proc.wait()
702 return (ret, None)
704 return (ret, None)
703
705
704 proc = Popen4(cmd, wd, options.timeout)
706 proc = Popen4(cmd, wd, options.timeout)
705 def cleanup():
707 def cleanup():
706 terminate(proc)
708 terminate(proc)
707 ret = proc.wait()
709 ret = proc.wait()
708 if ret == 0:
710 if ret == 0:
709 ret = signal.SIGTERM << 8
711 ret = signal.SIGTERM << 8
710 killdaemons()
712 killdaemons()
711 return ret
713 return ret
712
714
713 output = ''
715 output = ''
714 proc.tochild.close()
716 proc.tochild.close()
715
717
716 try:
718 try:
717 output = proc.fromchild.read()
719 output = proc.fromchild.read()
718 except KeyboardInterrupt:
720 except KeyboardInterrupt:
719 vlog('# Handling keyboard interrupt')
721 vlog('# Handling keyboard interrupt')
720 cleanup()
722 cleanup()
721 raise
723 raise
722
724
723 ret = proc.wait()
725 ret = proc.wait()
724 if wifexited(ret):
726 if wifexited(ret):
725 ret = os.WEXITSTATUS(ret)
727 ret = os.WEXITSTATUS(ret)
726
728
727 if proc.timeout:
729 if proc.timeout:
728 ret = 'timeout'
730 ret = 'timeout'
729
731
730 if ret:
732 if ret:
731 killdaemons()
733 killdaemons()
732
734
733 for s, r in replacements:
735 for s, r in replacements:
734 output = re.sub(s, r, output)
736 output = re.sub(s, r, output)
735 return ret, splitnewlines(output)
737 return ret, splitnewlines(output)
736
738
737 def runone(options, test):
739 def runone(options, test):
738 '''tristate output:
740 '''tristate output:
739 None -> skipped
741 None -> skipped
740 True -> passed
742 True -> passed
741 False -> failed'''
743 False -> failed'''
742
744
743 global results, resultslock, iolock
745 global results, resultslock, iolock
744
746
745 testpath = os.path.join(TESTDIR, test)
747 testpath = os.path.join(TESTDIR, test)
746
748
747 def result(l, e):
749 def result(l, e):
748 resultslock.acquire()
750 resultslock.acquire()
749 results[l].append(e)
751 results[l].append(e)
750 resultslock.release()
752 resultslock.release()
751
753
752 def skip(msg):
754 def skip(msg):
753 if not options.verbose:
755 if not options.verbose:
754 result('s', (test, msg))
756 result('s', (test, msg))
755 else:
757 else:
756 iolock.acquire()
758 iolock.acquire()
757 print "\nSkipping %s: %s" % (testpath, msg)
759 print "\nSkipping %s: %s" % (testpath, msg)
758 iolock.release()
760 iolock.release()
759 return None
761 return None
760
762
761 def fail(msg, ret):
763 def fail(msg, ret):
762 if not options.nodiff:
764 if not options.nodiff:
763 iolock.acquire()
765 iolock.acquire()
764 print "\nERROR: %s %s" % (testpath, msg)
766 print "\nERROR: %s %s" % (testpath, msg)
765 iolock.release()
767 iolock.release()
766 if (not ret and options.interactive
768 if (not ret and options.interactive
767 and os.path.exists(testpath + ".err")):
769 and os.path.exists(testpath + ".err")):
768 iolock.acquire()
770 iolock.acquire()
769 print "Accept this change? [n] ",
771 print "Accept this change? [n] ",
770 answer = sys.stdin.readline().strip()
772 answer = sys.stdin.readline().strip()
771 iolock.release()
773 iolock.release()
772 if answer.lower() in "y yes".split():
774 if answer.lower() in "y yes".split():
773 if test.endswith(".t"):
775 if test.endswith(".t"):
774 rename(testpath + ".err", testpath)
776 rename(testpath + ".err", testpath)
775 else:
777 else:
776 rename(testpath + ".err", testpath + ".out")
778 rename(testpath + ".err", testpath + ".out")
777 result('p', test)
779 result('p', test)
778 return
780 return
779 result('f', (test, msg))
781 result('f', (test, msg))
780
782
781 def success():
783 def success():
782 result('p', test)
784 result('p', test)
783
785
784 def ignore(msg):
786 def ignore(msg):
785 result('i', (test, msg))
787 result('i', (test, msg))
786
788
787 if (os.path.basename(test).startswith("test-") and '~' not in test and
789 if (os.path.basename(test).startswith("test-") and '~' not in test and
788 ('.' not in test or test.endswith('.py') or
790 ('.' not in test or test.endswith('.py') or
789 test.endswith('.bat') or test.endswith('.t'))):
791 test.endswith('.bat') or test.endswith('.t'))):
790 if not os.path.exists(test):
792 if not os.path.exists(test):
791 skip("doesn't exist")
793 skip("doesn't exist")
792 return None
794 return None
793 else:
795 else:
794 vlog('# Test file', test, 'not supported, ignoring')
796 vlog('# Test file', test, 'not supported, ignoring')
795 return None # not a supported test, don't record
797 return None # not a supported test, don't record
796
798
797 if not (options.whitelisted and test in options.whitelisted):
799 if not (options.whitelisted and test in options.whitelisted):
798 if options.blacklist and test in options.blacklist:
800 if options.blacklist and test in options.blacklist:
799 skip("blacklisted")
801 skip("blacklisted")
800 return None
802 return None
801
803
802 if options.retest and not os.path.exists(test + ".err"):
804 if options.retest and not os.path.exists(test + ".err"):
803 ignore("not retesting")
805 ignore("not retesting")
804 return None
806 return None
805
807
806 if options.keywords:
808 if options.keywords:
807 fp = open(test)
809 fp = open(test)
808 t = fp.read().lower() + test.lower()
810 t = fp.read().lower() + test.lower()
809 fp.close()
811 fp.close()
810 for k in options.keywords.lower().split():
812 for k in options.keywords.lower().split():
811 if k in t:
813 if k in t:
812 break
814 break
813 else:
815 else:
814 ignore("doesn't match keyword")
816 ignore("doesn't match keyword")
815 return None
817 return None
816
818
817 vlog("# Test", test)
819 vlog("# Test", test)
818
820
819 # create a fresh hgrc
821 # create a fresh hgrc
820 hgrc = open(HGRCPATH, 'w+')
822 hgrc = open(HGRCPATH, 'w+')
821 hgrc.write('[ui]\n')
823 hgrc.write('[ui]\n')
822 hgrc.write('slash = True\n')
824 hgrc.write('slash = True\n')
823 hgrc.write('[defaults]\n')
825 hgrc.write('[defaults]\n')
824 hgrc.write('backout = -d "0 0"\n')
826 hgrc.write('backout = -d "0 0"\n')
825 hgrc.write('commit = -d "0 0"\n')
827 hgrc.write('commit = -d "0 0"\n')
826 hgrc.write('tag = -d "0 0"\n')
828 hgrc.write('tag = -d "0 0"\n')
827 if options.inotify:
829 if options.inotify:
828 hgrc.write('[extensions]\n')
830 hgrc.write('[extensions]\n')
829 hgrc.write('inotify=\n')
831 hgrc.write('inotify=\n')
830 hgrc.write('[inotify]\n')
832 hgrc.write('[inotify]\n')
831 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
833 hgrc.write('pidfile=%s\n' % DAEMON_PIDS)
832 hgrc.write('appendpid=True\n')
834 hgrc.write('appendpid=True\n')
833 if options.extra_config_opt:
835 if options.extra_config_opt:
834 for opt in options.extra_config_opt:
836 for opt in options.extra_config_opt:
835 section, key = opt.split('.', 1)
837 section, key = opt.split('.', 1)
836 assert '=' in key, ('extra config opt %s must '
838 assert '=' in key, ('extra config opt %s must '
837 'have an = for assignment' % opt)
839 'have an = for assignment' % opt)
838 hgrc.write('[%s]\n%s\n' % (section, key))
840 hgrc.write('[%s]\n%s\n' % (section, key))
839 hgrc.close()
841 hgrc.close()
840
842
841 ref = os.path.join(TESTDIR, test+".out")
843 ref = os.path.join(TESTDIR, test+".out")
842 err = os.path.join(TESTDIR, test+".err")
844 err = os.path.join(TESTDIR, test+".err")
843 if os.path.exists(err):
845 if os.path.exists(err):
844 os.remove(err) # Remove any previous output files
846 os.remove(err) # Remove any previous output files
845 try:
847 try:
846 tf = open(testpath)
848 tf = open(testpath)
847 firstline = tf.readline().rstrip()
849 firstline = tf.readline().rstrip()
848 tf.close()
850 tf.close()
849 except:
851 except:
850 firstline = ''
852 firstline = ''
851 lctest = test.lower()
853 lctest = test.lower()
852
854
853 if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
855 if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
854 runner = pytest
856 runner = pytest
855 elif lctest.endswith('.t'):
857 elif lctest.endswith('.t'):
856 runner = tsttest
858 runner = tsttest
857 ref = testpath
859 ref = testpath
858 else:
860 else:
859 # do not try to run non-executable programs
861 # do not try to run non-executable programs
860 if not os.access(testpath, os.X_OK):
862 if not os.access(testpath, os.X_OK):
861 return skip("not executable")
863 return skip("not executable")
862 runner = shtest
864 runner = shtest
863
865
864 # Make a tmp subdirectory to work in
866 # Make a tmp subdirectory to work in
865 testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
867 testtmp = os.environ["TESTTMP"] = os.environ["HOME"] = \
866 os.path.join(HGTMP, os.path.basename(test))
868 os.path.join(HGTMP, os.path.basename(test))
867
869
868 os.mkdir(testtmp)
870 os.mkdir(testtmp)
869 ret, out = runner(testpath, testtmp, options, [
871 ret, out = runner(testpath, testtmp, options, [
870 (re.escape(testtmp), '$TESTTMP'),
872 (re.escape(testtmp), '$TESTTMP'),
871 (r':%s\b' % options.port, ':$HGPORT'),
873 (r':%s\b' % options.port, ':$HGPORT'),
872 (r':%s\b' % (options.port + 1), ':$HGPORT1'),
874 (r':%s\b' % (options.port + 1), ':$HGPORT1'),
873 (r':%s\b' % (options.port + 2), ':$HGPORT2'),
875 (r':%s\b' % (options.port + 2), ':$HGPORT2'),
874 ])
876 ])
875 vlog("# Ret was:", ret)
877 vlog("# Ret was:", ret)
876
878
877 mark = '.'
879 mark = '.'
878
880
879 skipped = (ret == SKIPPED_STATUS)
881 skipped = (ret == SKIPPED_STATUS)
880
882
881 # If we're not in --debug mode and reference output file exists,
883 # If we're not in --debug mode and reference output file exists,
882 # check test output against it.
884 # check test output against it.
883 if options.debug:
885 if options.debug:
884 refout = None # to match "out is None"
886 refout = None # to match "out is None"
885 elif os.path.exists(ref):
887 elif os.path.exists(ref):
886 f = open(ref, "r")
888 f = open(ref, "r")
887 refout = list(splitnewlines(f.read()))
889 refout = list(splitnewlines(f.read()))
888 f.close()
890 f.close()
889 else:
891 else:
890 refout = []
892 refout = []
891
893
892 if (ret != 0 or out != refout) and not skipped and not options.debug:
894 if (ret != 0 or out != refout) and not skipped and not options.debug:
893 # Save errors to a file for diagnosis
895 # Save errors to a file for diagnosis
894 f = open(err, "wb")
896 f = open(err, "wb")
895 for line in out:
897 for line in out:
896 f.write(line)
898 f.write(line)
897 f.close()
899 f.close()
898
900
899 if skipped:
901 if skipped:
900 mark = 's'
902 mark = 's'
901 if out is None: # debug mode: nothing to parse
903 if out is None: # debug mode: nothing to parse
902 missing = ['unknown']
904 missing = ['unknown']
903 failed = None
905 failed = None
904 else:
906 else:
905 missing, failed = parsehghaveoutput(out)
907 missing, failed = parsehghaveoutput(out)
906 if not missing:
908 if not missing:
907 missing = ['irrelevant']
909 missing = ['irrelevant']
908 if failed:
910 if failed:
909 fail("hghave failed checking for %s" % failed[-1], ret)
911 fail("hghave failed checking for %s" % failed[-1], ret)
910 skipped = False
912 skipped = False
911 else:
913 else:
912 skip(missing[-1])
914 skip(missing[-1])
913 elif ret == 'timeout':
915 elif ret == 'timeout':
914 mark = 't'
916 mark = 't'
915 fail("timed out", ret)
917 fail("timed out", ret)
916 elif out != refout:
918 elif out != refout:
917 mark = '!'
919 mark = '!'
918 if not options.nodiff:
920 if not options.nodiff:
919 iolock.acquire()
921 iolock.acquire()
920 if options.view:
922 if options.view:
921 os.system("%s %s %s" % (options.view, ref, err))
923 os.system("%s %s %s" % (options.view, ref, err))
922 else:
924 else:
923 showdiff(refout, out, ref, err)
925 showdiff(refout, out, ref, err)
924 iolock.release()
926 iolock.release()
925 if ret:
927 if ret:
926 fail("output changed and returned error code %d" % ret, ret)
928 fail("output changed and returned error code %d" % ret, ret)
927 else:
929 else:
928 fail("output changed", ret)
930 fail("output changed", ret)
929 ret = 1
931 ret = 1
930 elif ret:
932 elif ret:
931 mark = '!'
933 mark = '!'
932 fail("returned error code %d" % ret, ret)
934 fail("returned error code %d" % ret, ret)
933 else:
935 else:
934 success()
936 success()
935
937
936 if not options.verbose:
938 if not options.verbose:
937 iolock.acquire()
939 iolock.acquire()
938 sys.stdout.write(mark)
940 sys.stdout.write(mark)
939 sys.stdout.flush()
941 sys.stdout.flush()
940 iolock.release()
942 iolock.release()
941
943
942 killdaemons()
944 killdaemons()
943
945
944 if not options.keep_tmpdir:
946 if not options.keep_tmpdir:
945 shutil.rmtree(testtmp, True)
947 shutil.rmtree(testtmp, True)
946 if skipped:
948 if skipped:
947 return None
949 return None
948 return ret == 0
950 return ret == 0
949
951
950 _hgpath = None
952 _hgpath = None
951
953
952 def _gethgpath():
954 def _gethgpath():
953 """Return the path to the mercurial package that is actually found by
955 """Return the path to the mercurial package that is actually found by
954 the current Python interpreter."""
956 the current Python interpreter."""
955 global _hgpath
957 global _hgpath
956 if _hgpath is not None:
958 if _hgpath is not None:
957 return _hgpath
959 return _hgpath
958
960
959 cmd = '%s -c "import mercurial; print mercurial.__path__[0]"'
961 cmd = '%s -c "import mercurial; print mercurial.__path__[0]"'
960 pipe = os.popen(cmd % PYTHON)
962 pipe = os.popen(cmd % PYTHON)
961 try:
963 try:
962 _hgpath = pipe.read().strip()
964 _hgpath = pipe.read().strip()
963 finally:
965 finally:
964 pipe.close()
966 pipe.close()
965 return _hgpath
967 return _hgpath
966
968
967 def _checkhglib(verb):
969 def _checkhglib(verb):
968 """Ensure that the 'mercurial' package imported by python is
970 """Ensure that the 'mercurial' package imported by python is
969 the one we expect it to be. If not, print a warning to stderr."""
971 the one we expect it to be. If not, print a warning to stderr."""
970 expecthg = os.path.join(PYTHONDIR, 'mercurial')
972 expecthg = os.path.join(PYTHONDIR, 'mercurial')
971 actualhg = _gethgpath()
973 actualhg = _gethgpath()
972 if os.path.abspath(actualhg) != os.path.abspath(expecthg):
974 if os.path.abspath(actualhg) != os.path.abspath(expecthg):
973 sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
975 sys.stderr.write('warning: %s with unexpected mercurial lib: %s\n'
974 ' (expected %s)\n'
976 ' (expected %s)\n'
975 % (verb, actualhg, expecthg))
977 % (verb, actualhg, expecthg))
976
978
977 def runchildren(options, tests):
979 def runchildren(options, tests):
978 if INST:
980 if INST:
979 installhg(options)
981 installhg(options)
980 _checkhglib("Testing")
982 _checkhglib("Testing")
981
983
982 optcopy = dict(options.__dict__)
984 optcopy = dict(options.__dict__)
983 optcopy['jobs'] = 1
985 optcopy['jobs'] = 1
984
986
985 # Because whitelist has to override keyword matches, we have to
987 # Because whitelist has to override keyword matches, we have to
986 # actually load the whitelist in the children as well, so we allow
988 # actually load the whitelist in the children as well, so we allow
987 # the list of whitelist files to pass through and be parsed in the
989 # the list of whitelist files to pass through and be parsed in the
988 # children, but not the dict of whitelisted tests resulting from
990 # children, but not the dict of whitelisted tests resulting from
989 # the parse, used here to override blacklisted tests.
991 # the parse, used here to override blacklisted tests.
990 whitelist = optcopy['whitelisted'] or []
992 whitelist = optcopy['whitelisted'] or []
991 del optcopy['whitelisted']
993 del optcopy['whitelisted']
992
994
993 blacklist = optcopy['blacklist'] or []
995 blacklist = optcopy['blacklist'] or []
994 del optcopy['blacklist']
996 del optcopy['blacklist']
995 blacklisted = []
997 blacklisted = []
996
998
997 if optcopy['with_hg'] is None:
999 if optcopy['with_hg'] is None:
998 optcopy['with_hg'] = os.path.join(BINDIR, "hg")
1000 optcopy['with_hg'] = os.path.join(BINDIR, "hg")
999 optcopy.pop('anycoverage', None)
1001 optcopy.pop('anycoverage', None)
1000
1002
1001 opts = []
1003 opts = []
1002 for opt, value in optcopy.iteritems():
1004 for opt, value in optcopy.iteritems():
1003 name = '--' + opt.replace('_', '-')
1005 name = '--' + opt.replace('_', '-')
1004 if value is True:
1006 if value is True:
1005 opts.append(name)
1007 opts.append(name)
1006 elif isinstance(value, list):
1008 elif isinstance(value, list):
1007 for v in value:
1009 for v in value:
1008 opts.append(name + '=' + str(v))
1010 opts.append(name + '=' + str(v))
1009 elif value is not None:
1011 elif value is not None:
1010 opts.append(name + '=' + str(value))
1012 opts.append(name + '=' + str(value))
1011
1013
1012 tests.reverse()
1014 tests.reverse()
1013 jobs = [[] for j in xrange(options.jobs)]
1015 jobs = [[] for j in xrange(options.jobs)]
1014 while tests:
1016 while tests:
1015 for job in jobs:
1017 for job in jobs:
1016 if not tests:
1018 if not tests:
1017 break
1019 break
1018 test = tests.pop()
1020 test = tests.pop()
1019 if test not in whitelist and test in blacklist:
1021 if test not in whitelist and test in blacklist:
1020 blacklisted.append(test)
1022 blacklisted.append(test)
1021 else:
1023 else:
1022 job.append(test)
1024 job.append(test)
1023 fps = {}
1025 fps = {}
1024
1026
1025 for j, job in enumerate(jobs):
1027 for j, job in enumerate(jobs):
1026 if not job:
1028 if not job:
1027 continue
1029 continue
1028 rfd, wfd = os.pipe()
1030 rfd, wfd = os.pipe()
1029 childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
1031 childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
1030 childtmp = os.path.join(HGTMP, 'child%d' % j)
1032 childtmp = os.path.join(HGTMP, 'child%d' % j)
1031 childopts += ['--tmpdir', childtmp]
1033 childopts += ['--tmpdir', childtmp]
1032 cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
1034 cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
1033 vlog(' '.join(cmdline))
1035 vlog(' '.join(cmdline))
1034 fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r')
1036 fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r')
1035 os.close(wfd)
1037 os.close(wfd)
1036 signal.signal(signal.SIGINT, signal.SIG_IGN)
1038 signal.signal(signal.SIGINT, signal.SIG_IGN)
1037 failures = 0
1039 failures = 0
1038 tested, skipped, failed = 0, 0, 0
1040 tested, skipped, failed = 0, 0, 0
1039 skips = []
1041 skips = []
1040 fails = []
1042 fails = []
1041 while fps:
1043 while fps:
1042 pid, status = os.wait()
1044 pid, status = os.wait()
1043 fp = fps.pop(pid)
1045 fp = fps.pop(pid)
1044 l = fp.read().splitlines()
1046 l = fp.read().splitlines()
1045 try:
1047 try:
1046 test, skip, fail = map(int, l[:3])
1048 test, skip, fail = map(int, l[:3])
1047 except ValueError:
1049 except ValueError:
1048 test, skip, fail = 0, 0, 0
1050 test, skip, fail = 0, 0, 0
1049 split = -fail or len(l)
1051 split = -fail or len(l)
1050 for s in l[3:split]:
1052 for s in l[3:split]:
1051 skips.append(s.split(" ", 1))
1053 skips.append(s.split(" ", 1))
1052 for s in l[split:]:
1054 for s in l[split:]:
1053 fails.append(s.split(" ", 1))
1055 fails.append(s.split(" ", 1))
1054 tested += test
1056 tested += test
1055 skipped += skip
1057 skipped += skip
1056 failed += fail
1058 failed += fail
1057 vlog('pid %d exited, status %d' % (pid, status))
1059 vlog('pid %d exited, status %d' % (pid, status))
1058 failures |= status
1060 failures |= status
1059 print
1061 print
1060 skipped += len(blacklisted)
1062 skipped += len(blacklisted)
1061 if not options.noskips:
1063 if not options.noskips:
1062 for s in skips:
1064 for s in skips:
1063 print "Skipped %s: %s" % (s[0], s[1])
1065 print "Skipped %s: %s" % (s[0], s[1])
1064 for s in blacklisted:
1066 for s in blacklisted:
1065 print "Skipped %s: blacklisted" % s
1067 print "Skipped %s: blacklisted" % s
1066 for s in fails:
1068 for s in fails:
1067 print "Failed %s: %s" % (s[0], s[1])
1069 print "Failed %s: %s" % (s[0], s[1])
1068
1070
1069 _checkhglib("Tested")
1071 _checkhglib("Tested")
1070 print "# Ran %d tests, %d skipped, %d failed." % (
1072 print "# Ran %d tests, %d skipped, %d failed." % (
1071 tested, skipped, failed)
1073 tested, skipped, failed)
1072
1074
1073 if options.anycoverage:
1075 if options.anycoverage:
1074 outputcoverage(options)
1076 outputcoverage(options)
1075 sys.exit(failures != 0)
1077 sys.exit(failures != 0)
1076
1078
1077 results = dict(p=[], f=[], s=[], i=[])
1079 results = dict(p=[], f=[], s=[], i=[])
1078 resultslock = threading.Lock()
1080 resultslock = threading.Lock()
1079 iolock = threading.Lock()
1081 iolock = threading.Lock()
1080
1082
1081 def runqueue(options, tests, results):
1083 def runqueue(options, tests, results):
1082 for test in tests:
1084 for test in tests:
1083 ret = runone(options, test)
1085 ret = runone(options, test)
1084 if options.first and ret is not None and not ret:
1086 if options.first and ret is not None and not ret:
1085 break
1087 break
1086
1088
1087 def runtests(options, tests):
1089 def runtests(options, tests):
1088 global DAEMON_PIDS, HGRCPATH
1090 global DAEMON_PIDS, HGRCPATH
1089 DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
1091 DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
1090 HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
1092 HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
1091
1093
1092 try:
1094 try:
1093 if INST:
1095 if INST:
1094 installhg(options)
1096 installhg(options)
1095 _checkhglib("Testing")
1097 _checkhglib("Testing")
1096
1098
1097 if options.restart:
1099 if options.restart:
1098 orig = list(tests)
1100 orig = list(tests)
1099 while tests:
1101 while tests:
1100 if os.path.exists(tests[0] + ".err"):
1102 if os.path.exists(tests[0] + ".err"):
1101 break
1103 break
1102 tests.pop(0)
1104 tests.pop(0)
1103 if not tests:
1105 if not tests:
1104 print "running all tests"
1106 print "running all tests"
1105 tests = orig
1107 tests = orig
1106
1108
1107 runqueue(options, tests, results)
1109 runqueue(options, tests, results)
1108
1110
1109 failed = len(results['f'])
1111 failed = len(results['f'])
1110 tested = len(results['p']) + failed
1112 tested = len(results['p']) + failed
1111 skipped = len(results['s'])
1113 skipped = len(results['s'])
1112 ignored = len(results['i'])
1114 ignored = len(results['i'])
1113
1115
1114 if options.child:
1116 if options.child:
1115 fp = os.fdopen(options.child, 'w')
1117 fp = os.fdopen(options.child, 'w')
1116 fp.write('%d\n%d\n%d\n' % (tested, skipped, failed))
1118 fp.write('%d\n%d\n%d\n' % (tested, skipped, failed))
1117 for s in results['s']:
1119 for s in results['s']:
1118 fp.write("%s %s\n" % s)
1120 fp.write("%s %s\n" % s)
1119 for s in results['f']:
1121 for s in results['f']:
1120 fp.write("%s %s\n" % s)
1122 fp.write("%s %s\n" % s)
1121 fp.close()
1123 fp.close()
1122 else:
1124 else:
1123 print
1125 print
1124 for s in results['s']:
1126 for s in results['s']:
1125 print "Skipped %s: %s" % s
1127 print "Skipped %s: %s" % s
1126 for s in results['f']:
1128 for s in results['f']:
1127 print "Failed %s: %s" % s
1129 print "Failed %s: %s" % s
1128 _checkhglib("Tested")
1130 _checkhglib("Tested")
1129 print "# Ran %d tests, %d skipped, %d failed." % (
1131 print "# Ran %d tests, %d skipped, %d failed." % (
1130 tested, skipped + ignored, failed)
1132 tested, skipped + ignored, failed)
1131
1133
1132 if options.anycoverage:
1134 if options.anycoverage:
1133 outputcoverage(options)
1135 outputcoverage(options)
1134 except KeyboardInterrupt:
1136 except KeyboardInterrupt:
1135 failed = True
1137 failed = True
1136 print "\ninterrupted!"
1138 print "\ninterrupted!"
1137
1139
1138 if failed:
1140 if failed:
1139 sys.exit(1)
1141 sys.exit(1)
1140
1142
1141 def main():
1143 def main():
1142 (options, args) = parseargs()
1144 (options, args) = parseargs()
1143 if not options.child:
1145 if not options.child:
1144 os.umask(022)
1146 os.umask(022)
1145
1147
1146 checktools()
1148 checktools()
1147
1149
1148 if len(args) == 0:
1150 if len(args) == 0:
1149 args = os.listdir(".")
1151 args = os.listdir(".")
1150 args.sort()
1152 args.sort()
1151
1153
1152 tests = args
1154 tests = args
1153
1155
1154 # Reset some environment variables to well-known values so that
1156 # Reset some environment variables to well-known values so that
1155 # the tests produce repeatable output.
1157 # the tests produce repeatable output.
1156 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
1158 os.environ['LANG'] = os.environ['LC_ALL'] = os.environ['LANGUAGE'] = 'C'
1157 os.environ['TZ'] = 'GMT'
1159 os.environ['TZ'] = 'GMT'
1158 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
1160 os.environ["EMAIL"] = "Foo Bar <foo.bar@example.com>"
1159 os.environ['CDPATH'] = ''
1161 os.environ['CDPATH'] = ''
1160 os.environ['COLUMNS'] = '80'
1162 os.environ['COLUMNS'] = '80'
1161 os.environ['GREP_OPTIONS'] = ''
1163 os.environ['GREP_OPTIONS'] = ''
1162 os.environ['http_proxy'] = ''
1164 os.environ['http_proxy'] = ''
1163 os.environ['no_proxy'] = ''
1165 os.environ['no_proxy'] = ''
1164 os.environ['NO_PROXY'] = ''
1166 os.environ['NO_PROXY'] = ''
1165
1167
1166 # unset env related to hooks
1168 # unset env related to hooks
1167 for k in os.environ.keys():
1169 for k in os.environ.keys():
1168 if k.startswith('HG_'):
1170 if k.startswith('HG_'):
1169 # can't remove on solaris
1171 # can't remove on solaris
1170 os.environ[k] = ''
1172 os.environ[k] = ''
1171 del os.environ[k]
1173 del os.environ[k]
1172
1174
1173 global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
1175 global TESTDIR, HGTMP, INST, BINDIR, PYTHONDIR, COVERAGE_FILE
1174 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
1176 TESTDIR = os.environ["TESTDIR"] = os.getcwd()
1175 if options.tmpdir:
1177 if options.tmpdir:
1176 options.keep_tmpdir = True
1178 options.keep_tmpdir = True
1177 tmpdir = options.tmpdir
1179 tmpdir = options.tmpdir
1178 if os.path.exists(tmpdir):
1180 if os.path.exists(tmpdir):
1179 # Meaning of tmpdir has changed since 1.3: we used to create
1181 # Meaning of tmpdir has changed since 1.3: we used to create
1180 # HGTMP inside tmpdir; now HGTMP is tmpdir. So fail if
1182 # HGTMP inside tmpdir; now HGTMP is tmpdir. So fail if
1181 # tmpdir already exists.
1183 # tmpdir already exists.
1182 sys.exit("error: temp dir %r already exists" % tmpdir)
1184 sys.exit("error: temp dir %r already exists" % tmpdir)
1183
1185
1184 # Automatically removing tmpdir sounds convenient, but could
1186 # Automatically removing tmpdir sounds convenient, but could
1185 # really annoy anyone in the habit of using "--tmpdir=/tmp"
1187 # really annoy anyone in the habit of using "--tmpdir=/tmp"
1186 # or "--tmpdir=$HOME".
1188 # or "--tmpdir=$HOME".
1187 #vlog("# Removing temp dir", tmpdir)
1189 #vlog("# Removing temp dir", tmpdir)
1188 #shutil.rmtree(tmpdir)
1190 #shutil.rmtree(tmpdir)
1189 os.makedirs(tmpdir)
1191 os.makedirs(tmpdir)
1190 else:
1192 else:
1191 tmpdir = tempfile.mkdtemp('', 'hgtests.')
1193 tmpdir = tempfile.mkdtemp('', 'hgtests.')
1192 HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
1194 HGTMP = os.environ['HGTMP'] = os.path.realpath(tmpdir)
1193 DAEMON_PIDS = None
1195 DAEMON_PIDS = None
1194 HGRCPATH = None
1196 HGRCPATH = None
1195
1197
1196 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
1198 os.environ["HGEDITOR"] = sys.executable + ' -c "import sys; sys.exit(0)"'
1197 os.environ["HGMERGE"] = "internal:merge"
1199 os.environ["HGMERGE"] = "internal:merge"
1198 os.environ["HGUSER"] = "test"
1200 os.environ["HGUSER"] = "test"
1199 os.environ["HGENCODING"] = "ascii"
1201 os.environ["HGENCODING"] = "ascii"
1200 os.environ["HGENCODINGMODE"] = "strict"
1202 os.environ["HGENCODINGMODE"] = "strict"
1201 os.environ["HGPORT"] = str(options.port)
1203 os.environ["HGPORT"] = str(options.port)
1202 os.environ["HGPORT1"] = str(options.port + 1)
1204 os.environ["HGPORT1"] = str(options.port + 1)
1203 os.environ["HGPORT2"] = str(options.port + 2)
1205 os.environ["HGPORT2"] = str(options.port + 2)
1204
1206
1205 if options.with_hg:
1207 if options.with_hg:
1206 INST = None
1208 INST = None
1207 BINDIR = os.path.dirname(os.path.realpath(options.with_hg))
1209 BINDIR = os.path.dirname(os.path.realpath(options.with_hg))
1208
1210
1209 # This looks redundant with how Python initializes sys.path from
1211 # This looks redundant with how Python initializes sys.path from
1210 # the location of the script being executed. Needed because the
1212 # the location of the script being executed. Needed because the
1211 # "hg" specified by --with-hg is not the only Python script
1213 # "hg" specified by --with-hg is not the only Python script
1212 # executed in the test suite that needs to import 'mercurial'
1214 # executed in the test suite that needs to import 'mercurial'
1213 # ... which means it's not really redundant at all.
1215 # ... which means it's not really redundant at all.
1214 PYTHONDIR = BINDIR
1216 PYTHONDIR = BINDIR
1215 else:
1217 else:
1216 INST = os.path.join(HGTMP, "install")
1218 INST = os.path.join(HGTMP, "install")
1217 BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
1219 BINDIR = os.environ["BINDIR"] = os.path.join(INST, "bin")
1218 PYTHONDIR = os.path.join(INST, "lib", "python")
1220 PYTHONDIR = os.path.join(INST, "lib", "python")
1219
1221
1220 os.environ["BINDIR"] = BINDIR
1222 os.environ["BINDIR"] = BINDIR
1221 os.environ["PYTHON"] = PYTHON
1223 os.environ["PYTHON"] = PYTHON
1222
1224
1223 if not options.child:
1225 if not options.child:
1224 path = [BINDIR] + os.environ["PATH"].split(os.pathsep)
1226 path = [BINDIR] + os.environ["PATH"].split(os.pathsep)
1225 os.environ["PATH"] = os.pathsep.join(path)
1227 os.environ["PATH"] = os.pathsep.join(path)
1226
1228
1227 # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
1229 # Include TESTDIR in PYTHONPATH so that out-of-tree extensions
1228 # can run .../tests/run-tests.py test-foo where test-foo
1230 # can run .../tests/run-tests.py test-foo where test-foo
1229 # adds an extension to HGRC
1231 # adds an extension to HGRC
1230 pypath = [PYTHONDIR, TESTDIR]
1232 pypath = [PYTHONDIR, TESTDIR]
1231 # We have to augment PYTHONPATH, rather than simply replacing
1233 # We have to augment PYTHONPATH, rather than simply replacing
1232 # it, in case external libraries are only available via current
1234 # it, in case external libraries are only available via current
1233 # PYTHONPATH. (In particular, the Subversion bindings on OS X
1235 # PYTHONPATH. (In particular, the Subversion bindings on OS X
1234 # are in /opt/subversion.)
1236 # are in /opt/subversion.)
1235 oldpypath = os.environ.get(IMPL_PATH)
1237 oldpypath = os.environ.get(IMPL_PATH)
1236 if oldpypath:
1238 if oldpypath:
1237 pypath.append(oldpypath)
1239 pypath.append(oldpypath)
1238 os.environ[IMPL_PATH] = os.pathsep.join(pypath)
1240 os.environ[IMPL_PATH] = os.pathsep.join(pypath)
1239
1241
1240 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
1242 COVERAGE_FILE = os.path.join(TESTDIR, ".coverage")
1241
1243
1242 vlog("# Using TESTDIR", TESTDIR)
1244 vlog("# Using TESTDIR", TESTDIR)
1243 vlog("# Using HGTMP", HGTMP)
1245 vlog("# Using HGTMP", HGTMP)
1244 vlog("# Using PATH", os.environ["PATH"])
1246 vlog("# Using PATH", os.environ["PATH"])
1245 vlog("# Using", IMPL_PATH, os.environ[IMPL_PATH])
1247 vlog("# Using", IMPL_PATH, os.environ[IMPL_PATH])
1246
1248
1247 try:
1249 try:
1248 if len(tests) > 1 and options.jobs > 1:
1250 if len(tests) > 1 and options.jobs > 1:
1249 runchildren(options, tests)
1251 runchildren(options, tests)
1250 else:
1252 else:
1251 runtests(options, tests)
1253 runtests(options, tests)
1252 finally:
1254 finally:
1253 time.sleep(1)
1255 time.sleep(1)
1254 cleanup(options)
1256 cleanup(options)
1255
1257
1256 if __name__ == '__main__':
1258 if __name__ == '__main__':
1257 main()
1259 main()
@@ -1,100 +1,100 b''
1 $ hg init rep; cd rep
1 $ hg init rep; cd rep
2
2
3 $ touch empty-file
3 $ touch empty-file
4 $ python -c 'for x in range(10000): print x' > large-file
4 $ python -c 'for x in range(10000): print x' > large-file
5
5
6 $ hg addremove
6 $ hg addremove
7 adding empty-file
7 adding empty-file
8 adding large-file
8 adding large-file
9
9
10 $ hg commit -m A
10 $ hg commit -m A
11
11
12 $ rm large-file empty-file
12 $ rm large-file empty-file
13 $ python -c 'for x in range(10,10000): print x' > another-file
13 $ python -c 'for x in range(10,10000): print x' > another-file
14
14
15 $ hg addremove -s50
15 $ hg addremove -s50
16 adding another-file
16 adding another-file
17 removing empty-file
17 removing empty-file
18 removing large-file
18 removing large-file
19 recording removal of large-file as rename to another-file (99% similar)
19 recording removal of large-file as rename to another-file (99% similar)
20
20
21 $ hg commit -m B
21 $ hg commit -m B
22
22
23 comparing two empty files caused ZeroDivisionError in the past
23 comparing two empty files caused ZeroDivisionError in the past
24
24
25 $ hg update -C 0
25 $ hg update -C 0
26 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
26 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
27 $ rm empty-file
27 $ rm empty-file
28 $ touch another-empty-file
28 $ touch another-empty-file
29 $ hg addremove -s50
29 $ hg addremove -s50
30 adding another-empty-file
30 adding another-empty-file
31 removing empty-file
31 removing empty-file
32
32
33 $ cd ..
33 $ cd ..
34
34
35 $ hg init rep2; cd rep2
35 $ hg init rep2; cd rep2
36
36
37 $ python -c 'for x in range(10000): print x' > large-file
37 $ python -c 'for x in range(10000): print x' > large-file
38 $ python -c 'for x in range(50): print x' > tiny-file
38 $ python -c 'for x in range(50): print x' > tiny-file
39
39
40 $ hg addremove
40 $ hg addremove
41 adding large-file
41 adding large-file
42 adding tiny-file
42 adding tiny-file
43
43
44 $ hg commit -m A
44 $ hg commit -m A
45
45
46 $ python -c 'for x in range(70): print x' > small-file
46 $ python -c 'for x in range(70): print x' > small-file
47 $ rm tiny-file
47 $ rm tiny-file
48 $ rm large-file
48 $ rm large-file
49
49
50 $ hg addremove -s50
50 $ hg addremove -s50
51 removing large-file
51 removing large-file
52 adding small-file
52 adding small-file
53 removing tiny-file
53 removing tiny-file
54 recording removal of tiny-file as rename to small-file (82% similar)
54 recording removal of tiny-file as rename to small-file (82% similar)
55
55
56 $ hg commit -m B
56 $ hg commit -m B
57
57
58 should all fail
58 should all fail
59
59
60 $ hg addremove -s foo
60 $ hg addremove -s foo
61 abort: similarity must be a number
61 abort: similarity must be a number
62 [255]
62 [255]
63 $ hg addremove -s -1
63 $ hg addremove -s -1
64 abort: similarity must be between 0 and 100
64 abort: similarity must be between 0 and 100
65 [255]
65 [255]
66 $ hg addremove -s 1e6
66 $ hg addremove -s 1e6
67 abort: similarity must be between 0 and 100
67 abort: similarity must be between 0 and 100
68 [255]
68 [255]
69
69
70 $ cd ..
70 $ cd ..
71
71
72 Issue1527: repeated addremove causes util.Abort
72 Issue1527: repeated addremove causes util.Abort
73
73
74 $ hg init rep3; cd rep3
74 $ hg init rep3; cd rep3
75 $ mkdir d
75 $ mkdir d
76 $ echo a > d/a
76 $ echo a > d/a
77 $ hg add d/a
77 $ hg add d/a
78 $ hg commit -m 1
78 $ hg commit -m 1
79
79
80 $ mv d/a d/b
80 $ mv d/a d/b
81 $ hg addremove -s80
81 $ hg addremove -s80
82 removing d/a
82 removing d/a
83 adding d/b
83 adding d/b
84 recording removal of d/a as rename to d/b (100% similar)
84 recording removal of d/a as rename to d/b (100% similar) (glob)
85 $ hg debugstate
85 $ hg debugstate
86 r 0 0 1970-01-01 00:00:00 d/a
86 r 0 0 1970-01-01 00:00:00 d/a
87 a 0 -1 unset d/b
87 a 0 -1 unset d/b
88 copy: d/a -> d/b
88 copy: d/a -> d/b
89 $ mv d/b c
89 $ mv d/b c
90
90
91 no copies found here (since the target isn't in d
91 no copies found here (since the target isn't in d
92
92
93 $ hg addremove -s80 d
93 $ hg addremove -s80 d
94 removing d/b
94 removing d/b (glob)
95
95
96 copies here
96 copies here
97
97
98 $ hg addremove -s80
98 $ hg addremove -s80
99 adding c
99 adding c
100 recording removal of d/a as rename to c (100% similar)
100 recording removal of d/a as rename to c (100% similar) (glob)
@@ -1,84 +1,84 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink || exit 80
2
2
3 $ hg init
3 $ hg init
4
4
5 should fail
5 should fail
6
6
7 $ hg add .hg/00changelog.i
7 $ hg add .hg/00changelog.i
8 abort: path contains illegal component: .hg/00changelog.i
8 abort: path contains illegal component: .hg/00changelog.i (glob)
9 [255]
9 [255]
10
10
11 $ mkdir a
11 $ mkdir a
12 $ echo a > a/a
12 $ echo a > a/a
13 $ hg ci -Ama
13 $ hg ci -Ama
14 adding a/a
14 adding a/a
15 $ ln -s a b
15 $ ln -s a b
16 $ echo b > a/b
16 $ echo b > a/b
17
17
18 should fail
18 should fail
19
19
20 $ hg add b/b
20 $ hg add b/b
21 abort: path 'b/b' traverses symbolic link 'b'
21 abort: path 'b/b' traverses symbolic link 'b' (glob)
22 [255]
22 [255]
23
23
24 should succeed
24 should succeed
25
25
26 $ hg add b
26 $ hg add b
27
27
28 should still fail - maybe
28 should still fail - maybe
29
29
30 $ hg add b/b
30 $ hg add b/b
31 abort: path 'b/b' traverses symbolic link 'b'
31 abort: path 'b/b' traverses symbolic link 'b' (glob)
32 [255]
32 [255]
33
33
34 unbundle tampered bundle
34 unbundle tampered bundle
35
35
36 $ hg init target
36 $ hg init target
37 $ cd target
37 $ cd target
38 $ hg unbundle $TESTDIR/bundles/tampered.hg
38 $ hg unbundle $TESTDIR/bundles/tampered.hg
39 adding changesets
39 adding changesets
40 adding manifests
40 adding manifests
41 adding file changes
41 adding file changes
42 added 5 changesets with 6 changes to 6 files (+4 heads)
42 added 5 changesets with 6 changes to 6 files (+4 heads)
43 (run 'hg heads' to see heads, 'hg merge' to merge)
43 (run 'hg heads' to see heads, 'hg merge' to merge)
44
44
45 attack .hg/test
45 attack .hg/test
46
46
47 $ hg manifest -r0
47 $ hg manifest -r0
48 .hg/test
48 .hg/test
49 $ hg update -Cr0
49 $ hg update -Cr0
50 abort: path contains illegal component: .hg/test
50 abort: path contains illegal component: .hg/test
51 [255]
51 [255]
52
52
53 attack foo/.hg/test
53 attack foo/.hg/test
54
54
55 $ hg manifest -r1
55 $ hg manifest -r1
56 foo/.hg/test
56 foo/.hg/test
57 $ hg update -Cr1
57 $ hg update -Cr1
58 abort: path 'foo/.hg/test' is inside nested repo 'foo'
58 abort: path 'foo/.hg/test' is inside nested repo 'foo'
59 [255]
59 [255]
60
60
61 attack back/test where back symlinks to ..
61 attack back/test where back symlinks to ..
62
62
63 $ hg manifest -r2
63 $ hg manifest -r2
64 back
64 back
65 back/test
65 back/test
66 $ hg update -Cr2
66 $ hg update -Cr2
67 abort: path 'back/test' traverses symbolic link 'back'
67 abort: path 'back/test' traverses symbolic link 'back'
68 [255]
68 [255]
69
69
70 attack ../test
70 attack ../test
71
71
72 $ hg manifest -r3
72 $ hg manifest -r3
73 ../test
73 ../test
74 $ hg update -Cr3
74 $ hg update -Cr3
75 abort: path contains illegal component: ../test
75 abort: path contains illegal component: ../test
76 [255]
76 [255]
77
77
78 attack /tmp/test
78 attack /tmp/test
79
79
80 $ hg manifest -r4
80 $ hg manifest -r4
81 /tmp/test
81 /tmp/test
82 $ hg update -Cr4
82 $ hg update -Cr4
83 abort: No such file or directory: $TESTTMP/target//tmp/test
83 abort: No such file or directory: $TESTTMP/target//tmp/test
84 [255]
84 [255]
@@ -1,283 +1,283 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink || exit 80
2
2
3 commit date test
3 commit date test
4
4
5 $ hg init test
5 $ hg init test
6 $ cd test
6 $ cd test
7 $ echo foo > foo
7 $ echo foo > foo
8 $ hg add foo
8 $ hg add foo
9 $ HGEDITOR=true hg commit -m ""
9 $ HGEDITOR=true hg commit -m ""
10 abort: empty commit message
10 abort: empty commit message
11 [255]
11 [255]
12 $ hg commit -d '0 0' -m commit-1
12 $ hg commit -d '0 0' -m commit-1
13 $ echo foo >> foo
13 $ echo foo >> foo
14 $ hg commit -d '1 4444444' -m commit-3
14 $ hg commit -d '1 4444444' -m commit-3
15 abort: impossible time zone offset: 4444444
15 abort: impossible time zone offset: 4444444
16 [255]
16 [255]
17 $ hg commit -d '1 15.1' -m commit-4
17 $ hg commit -d '1 15.1' -m commit-4
18 abort: invalid date: '1\t15.1'
18 abort: invalid date: '1\t15.1'
19 [255]
19 [255]
20 $ hg commit -d 'foo bar' -m commit-5
20 $ hg commit -d 'foo bar' -m commit-5
21 abort: invalid date: 'foo bar'
21 abort: invalid date: 'foo bar'
22 [255]
22 [255]
23 $ hg commit -d ' 1 4444' -m commit-6
23 $ hg commit -d ' 1 4444' -m commit-6
24 $ hg commit -d '111111111111 0' -m commit-7
24 $ hg commit -d '111111111111 0' -m commit-7
25 abort: date exceeds 32 bits: 111111111111
25 abort: date exceeds 32 bits: 111111111111
26 [255]
26 [255]
27 $ hg commit -d '-7654321 3600' -m commit-7
27 $ hg commit -d '-7654321 3600' -m commit-7
28 abort: negative date value: -7654321
28 abort: negative date value: -7654321
29 [255]
29 [255]
30
30
31 commit added file that has been deleted
31 commit added file that has been deleted
32
32
33 $ echo bar > bar
33 $ echo bar > bar
34 $ hg add bar
34 $ hg add bar
35 $ rm bar
35 $ rm bar
36 $ hg commit -m commit-8
36 $ hg commit -m commit-8
37 nothing changed (1 missing files, see 'hg status')
37 nothing changed (1 missing files, see 'hg status')
38 [1]
38 [1]
39 $ hg commit -m commit-8-2 bar
39 $ hg commit -m commit-8-2 bar
40 abort: bar: file not found!
40 abort: bar: file not found!
41 [255]
41 [255]
42
42
43 $ hg -q revert -a --no-backup
43 $ hg -q revert -a --no-backup
44
44
45 $ mkdir dir
45 $ mkdir dir
46 $ echo boo > dir/file
46 $ echo boo > dir/file
47 $ hg add
47 $ hg add
48 adding dir/file
48 adding dir/file (glob)
49 $ hg -v commit -m commit-9 dir
49 $ hg -v commit -m commit-9 dir
50 dir/file
50 dir/file
51 committed changeset 2:d2a76177cb42
51 committed changeset 2:d2a76177cb42
52
52
53 $ echo > dir.file
53 $ echo > dir.file
54 $ hg add
54 $ hg add
55 adding dir.file
55 adding dir.file
56 $ hg commit -m commit-10 dir dir.file
56 $ hg commit -m commit-10 dir dir.file
57 abort: dir: no match under directory!
57 abort: dir: no match under directory!
58 [255]
58 [255]
59
59
60 $ echo >> dir/file
60 $ echo >> dir/file
61 $ mkdir bleh
61 $ mkdir bleh
62 $ mkdir dir2
62 $ mkdir dir2
63 $ cd bleh
63 $ cd bleh
64 $ hg commit -m commit-11 .
64 $ hg commit -m commit-11 .
65 abort: bleh: no match under directory!
65 abort: bleh: no match under directory!
66 [255]
66 [255]
67 $ hg commit -m commit-12 ../dir ../dir2
67 $ hg commit -m commit-12 ../dir ../dir2
68 abort: dir2: no match under directory!
68 abort: dir2: no match under directory!
69 [255]
69 [255]
70 $ hg -v commit -m commit-13 ../dir
70 $ hg -v commit -m commit-13 ../dir
71 dir/file
71 dir/file
72 committed changeset 3:1cd62a2d8db5
72 committed changeset 3:1cd62a2d8db5
73 $ cd ..
73 $ cd ..
74
74
75 $ hg commit -m commit-14 does-not-exist
75 $ hg commit -m commit-14 does-not-exist
76 abort: does-not-exist: No such file or directory
76 abort: does-not-exist: No such file or directory
77 [255]
77 [255]
78 $ ln -s foo baz
78 $ ln -s foo baz
79 $ hg commit -m commit-15 baz
79 $ hg commit -m commit-15 baz
80 abort: baz: file not tracked!
80 abort: baz: file not tracked!
81 [255]
81 [255]
82 $ touch quux
82 $ touch quux
83 $ hg commit -m commit-16 quux
83 $ hg commit -m commit-16 quux
84 abort: quux: file not tracked!
84 abort: quux: file not tracked!
85 [255]
85 [255]
86 $ echo >> dir/file
86 $ echo >> dir/file
87 $ hg -v commit -m commit-17 dir/file
87 $ hg -v commit -m commit-17 dir/file
88 dir/file
88 dir/file
89 committed changeset 4:49176991390e
89 committed changeset 4:49176991390e
90
90
91 An empty date was interpreted as epoch origin
91 An empty date was interpreted as epoch origin
92
92
93 $ echo foo >> foo
93 $ echo foo >> foo
94 $ hg commit -d '' -m commit-no-date
94 $ hg commit -d '' -m commit-no-date
95 $ hg tip --template '{date|isodate}\n' | grep '1970'
95 $ hg tip --template '{date|isodate}\n' | grep '1970'
96 [1]
96 [1]
97
97
98 Make sure we do not obscure unknown requires file entries (issue2649)
98 Make sure we do not obscure unknown requires file entries (issue2649)
99
99
100 $ echo foo >> foo
100 $ echo foo >> foo
101 $ echo fake >> .hg/requires
101 $ echo fake >> .hg/requires
102 $ hg commit -m bla
102 $ hg commit -m bla
103 abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
103 abort: unknown repository format: requires features 'fake' (upgrade Mercurial)!
104 [255]
104 [255]
105
105
106 $ cd ..
106 $ cd ..
107
107
108
108
109 partial subdir commit test
109 partial subdir commit test
110
110
111 $ hg init test2
111 $ hg init test2
112 $ cd test2
112 $ cd test2
113 $ mkdir foo
113 $ mkdir foo
114 $ echo foo > foo/foo
114 $ echo foo > foo/foo
115 $ mkdir bar
115 $ mkdir bar
116 $ echo bar > bar/bar
116 $ echo bar > bar/bar
117 $ hg add
117 $ hg add
118 adding bar/bar
118 adding bar/bar (glob)
119 adding foo/foo
119 adding foo/foo (glob)
120 $ hg ci -m commit-subdir-1 foo
120 $ hg ci -m commit-subdir-1 foo
121 $ hg ci -m commit-subdir-2 bar
121 $ hg ci -m commit-subdir-2 bar
122
122
123 subdir log 1
123 subdir log 1
124
124
125 $ hg log -v foo
125 $ hg log -v foo
126 changeset: 0:f97e73a25882
126 changeset: 0:f97e73a25882
127 user: test
127 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
128 date: Thu Jan 01 00:00:00 1970 +0000
129 files: foo/foo
129 files: foo/foo
130 description:
130 description:
131 commit-subdir-1
131 commit-subdir-1
132
132
133
133
134
134
135 subdir log 2
135 subdir log 2
136
136
137 $ hg log -v bar
137 $ hg log -v bar
138 changeset: 1:aa809156d50d
138 changeset: 1:aa809156d50d
139 tag: tip
139 tag: tip
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 files: bar/bar
142 files: bar/bar
143 description:
143 description:
144 commit-subdir-2
144 commit-subdir-2
145
145
146
146
147
147
148 full log
148 full log
149
149
150 $ hg log -v
150 $ hg log -v
151 changeset: 1:aa809156d50d
151 changeset: 1:aa809156d50d
152 tag: tip
152 tag: tip
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:00 1970 +0000
154 date: Thu Jan 01 00:00:00 1970 +0000
155 files: bar/bar
155 files: bar/bar
156 description:
156 description:
157 commit-subdir-2
157 commit-subdir-2
158
158
159
159
160 changeset: 0:f97e73a25882
160 changeset: 0:f97e73a25882
161 user: test
161 user: test
162 date: Thu Jan 01 00:00:00 1970 +0000
162 date: Thu Jan 01 00:00:00 1970 +0000
163 files: foo/foo
163 files: foo/foo
164 description:
164 description:
165 commit-subdir-1
165 commit-subdir-1
166
166
167
167
168 $ cd ..
168 $ cd ..
169
169
170
170
171 dot and subdir commit test
171 dot and subdir commit test
172
172
173 $ hg init test3
173 $ hg init test3
174 $ cd test3
174 $ cd test3
175 $ mkdir foo
175 $ mkdir foo
176 $ echo foo content > foo/plain-file
176 $ echo foo content > foo/plain-file
177 $ hg add foo/plain-file
177 $ hg add foo/plain-file
178 $ hg ci -m commit-foo-subdir foo
178 $ hg ci -m commit-foo-subdir foo
179 $ echo modified foo content > foo/plain-file
179 $ echo modified foo content > foo/plain-file
180 $ hg ci -m commit-foo-dot .
180 $ hg ci -m commit-foo-dot .
181
181
182 full log
182 full log
183
183
184 $ hg log -v
184 $ hg log -v
185 changeset: 1:95b38e3a5b2e
185 changeset: 1:95b38e3a5b2e
186 tag: tip
186 tag: tip
187 user: test
187 user: test
188 date: Thu Jan 01 00:00:00 1970 +0000
188 date: Thu Jan 01 00:00:00 1970 +0000
189 files: foo/plain-file
189 files: foo/plain-file
190 description:
190 description:
191 commit-foo-dot
191 commit-foo-dot
192
192
193
193
194 changeset: 0:65d4e9386227
194 changeset: 0:65d4e9386227
195 user: test
195 user: test
196 date: Thu Jan 01 00:00:00 1970 +0000
196 date: Thu Jan 01 00:00:00 1970 +0000
197 files: foo/plain-file
197 files: foo/plain-file
198 description:
198 description:
199 commit-foo-subdir
199 commit-foo-subdir
200
200
201
201
202
202
203 subdir log
203 subdir log
204
204
205 $ cd foo
205 $ cd foo
206 $ hg log .
206 $ hg log .
207 changeset: 1:95b38e3a5b2e
207 changeset: 1:95b38e3a5b2e
208 tag: tip
208 tag: tip
209 user: test
209 user: test
210 date: Thu Jan 01 00:00:00 1970 +0000
210 date: Thu Jan 01 00:00:00 1970 +0000
211 summary: commit-foo-dot
211 summary: commit-foo-dot
212
212
213 changeset: 0:65d4e9386227
213 changeset: 0:65d4e9386227
214 user: test
214 user: test
215 date: Thu Jan 01 00:00:00 1970 +0000
215 date: Thu Jan 01 00:00:00 1970 +0000
216 summary: commit-foo-subdir
216 summary: commit-foo-subdir
217
217
218 $ cd ..
218 $ cd ..
219 $ cd ..
219 $ cd ..
220
220
221 Issue1049: Hg permits partial commit of merge without warning
221 Issue1049: Hg permits partial commit of merge without warning
222
222
223 $ cd ..
223 $ cd ..
224 $ hg init issue1049
224 $ hg init issue1049
225 $ cd issue1049
225 $ cd issue1049
226 $ echo a > a
226 $ echo a > a
227 $ hg ci -Ama
227 $ hg ci -Ama
228 adding a
228 adding a
229 $ echo a >> a
229 $ echo a >> a
230 $ hg ci -mb
230 $ hg ci -mb
231 $ hg up 0
231 $ hg up 0
232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 $ echo b >> a
233 $ echo b >> a
234 $ hg ci -mc
234 $ hg ci -mc
235 created new head
235 created new head
236 $ HGMERGE=true hg merge
236 $ HGMERGE=true hg merge
237 merging a
237 merging a
238 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
238 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
239 (branch merge, don't forget to commit)
239 (branch merge, don't forget to commit)
240
240
241 should fail because we are specifying a file name
241 should fail because we are specifying a file name
242
242
243 $ hg ci -mmerge a
243 $ hg ci -mmerge a
244 abort: cannot partially commit a merge (do not specify files or patterns)
244 abort: cannot partially commit a merge (do not specify files or patterns)
245 [255]
245 [255]
246
246
247 should fail because we are specifying a pattern
247 should fail because we are specifying a pattern
248
248
249 $ hg ci -mmerge -I a
249 $ hg ci -mmerge -I a
250 abort: cannot partially commit a merge (do not specify files or patterns)
250 abort: cannot partially commit a merge (do not specify files or patterns)
251 [255]
251 [255]
252
252
253 should succeed
253 should succeed
254
254
255 $ hg ci -mmerge
255 $ hg ci -mmerge
256 $ cd ..
256 $ cd ..
257
257
258
258
259 test commit message content
259 test commit message content
260
260
261 $ hg init commitmsg
261 $ hg init commitmsg
262 $ cd commitmsg
262 $ cd commitmsg
263 $ echo changed > changed
263 $ echo changed > changed
264 $ echo removed > removed
264 $ echo removed > removed
265 $ hg ci -qAm init
265 $ hg ci -qAm init
266
266
267 $ hg rm removed
267 $ hg rm removed
268 $ echo changed >> changed
268 $ echo changed >> changed
269 $ echo added > added
269 $ echo added > added
270 $ hg add added
270 $ hg add added
271 $ HGEDITOR=cat hg ci -A
271 $ HGEDITOR=cat hg ci -A
272
272
273
273
274 HG: Enter commit message. Lines beginning with 'HG:' are removed.
274 HG: Enter commit message. Lines beginning with 'HG:' are removed.
275 HG: Leave message empty to abort commit.
275 HG: Leave message empty to abort commit.
276 HG: --
276 HG: --
277 HG: user: test
277 HG: user: test
278 HG: branch 'default'
278 HG: branch 'default'
279 HG: added added
279 HG: added added
280 HG: changed changed
280 HG: changed changed
281 HG: removed removed
281 HG: removed removed
282 abort: empty commit message
282 abort: empty commit message
283 [255]
283 [255]
@@ -1,302 +1,302 b''
1 Set vars:
1 Set vars:
2
2
3 $ CONTRIBDIR=$TESTDIR/../contrib
3 $ CONTRIBDIR=$TESTDIR/../contrib
4
4
5 Prepare repo-a:
5 Prepare repo-a:
6
6
7 $ hg init repo-a
7 $ hg init repo-a
8 $ cd repo-a
8 $ cd repo-a
9
9
10 $ echo this is file a > a
10 $ echo this is file a > a
11 $ hg add a
11 $ hg add a
12 $ hg commit -m first
12 $ hg commit -m first
13
13
14 $ echo adding to file a >> a
14 $ echo adding to file a >> a
15 $ hg commit -m second
15 $ hg commit -m second
16
16
17 $ echo adding more to file a >> a
17 $ echo adding more to file a >> a
18 $ hg commit -m third
18 $ hg commit -m third
19
19
20 $ hg verify
20 $ hg verify
21 checking changesets
21 checking changesets
22 checking manifests
22 checking manifests
23 crosschecking files in changesets and manifests
23 crosschecking files in changesets and manifests
24 checking files
24 checking files
25 1 files, 3 changesets, 3 total revisions
25 1 files, 3 changesets, 3 total revisions
26
26
27 Dumping revlog of file a to stdout:
27 Dumping revlog of file a to stdout:
28
28
29 $ python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
29 $ python $CONTRIBDIR/dumprevlog .hg/store/data/a.i
30 file: .hg/store/data/a.i
30 file: .hg/store/data/a.i
31 node: 183d2312b35066fb6b3b449b84efc370d50993d0
31 node: 183d2312b35066fb6b3b449b84efc370d50993d0
32 linkrev: 0
32 linkrev: 0
33 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
33 parents: 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
34 length: 15
34 length: 15
35 -start-
35 -start-
36 this is file a
36 this is file a
37
37
38 -end-
38 -end-
39 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
39 node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b
40 linkrev: 1
40 linkrev: 1
41 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
41 parents: 183d2312b35066fb6b3b449b84efc370d50993d0 0000000000000000000000000000000000000000
42 length: 32
42 length: 32
43 -start-
43 -start-
44 this is file a
44 this is file a
45 adding to file a
45 adding to file a
46
46
47 -end-
47 -end-
48 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
48 node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1
49 linkrev: 2
49 linkrev: 2
50 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
50 parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b 0000000000000000000000000000000000000000
51 length: 54
51 length: 54
52 -start-
52 -start-
53 this is file a
53 this is file a
54 adding to file a
54 adding to file a
55 adding more to file a
55 adding more to file a
56
56
57 -end-
57 -end-
58
58
59 Dump all revlogs to file repo.dump:
59 Dump all revlogs to file repo.dump:
60
60
61 $ find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
61 $ find .hg/store -name "*.i" | sort | xargs python $CONTRIBDIR/dumprevlog > ../repo.dump
62 $ cd ..
62 $ cd ..
63
63
64 Undumping into repo-b:
64 Undumping into repo-b:
65
65
66 $ hg init repo-b
66 $ hg init repo-b
67 $ cd repo-b
67 $ cd repo-b
68 $ python $CONTRIBDIR/undumprevlog < ../repo.dump
68 $ python $CONTRIBDIR/undumprevlog < ../repo.dump
69 .hg/store/00changelog.i
69 .hg/store/00changelog.i
70 .hg/store/00manifest.i
70 .hg/store/00manifest.i
71 .hg/store/data/a.i
71 .hg/store/data/a.i
72 $ cd ..
72 $ cd ..
73
73
74 Rebuild fncache with clone --pull:
74 Rebuild fncache with clone --pull:
75
75
76 $ hg clone --pull -U repo-b repo-c
76 $ hg clone --pull -U repo-b repo-c
77 requesting all changes
77 requesting all changes
78 adding changesets
78 adding changesets
79 adding manifests
79 adding manifests
80 adding file changes
80 adding file changes
81 added 3 changesets with 3 changes to 1 files
81 added 3 changesets with 3 changes to 1 files
82
82
83 Verify:
83 Verify:
84
84
85 $ hg -R repo-c verify
85 $ hg -R repo-c verify
86 checking changesets
86 checking changesets
87 checking manifests
87 checking manifests
88 crosschecking files in changesets and manifests
88 crosschecking files in changesets and manifests
89 checking files
89 checking files
90 1 files, 3 changesets, 3 total revisions
90 1 files, 3 changesets, 3 total revisions
91
91
92 Compare repos:
92 Compare repos:
93
93
94 $ hg -R repo-c incoming repo-a
94 $ hg -R repo-c incoming repo-a
95 comparing with repo-a
95 comparing with repo-a
96 searching for changes
96 searching for changes
97 no changes found
97 no changes found
98 [1]
98 [1]
99
99
100 $ hg -R repo-a incoming repo-c
100 $ hg -R repo-a incoming repo-c
101 comparing with repo-c
101 comparing with repo-c
102 searching for changes
102 searching for changes
103 no changes found
103 no changes found
104 [1]
104 [1]
105
105
106
106
107 Test shrink-revlog:
107 Test shrink-revlog:
108 $ cd repo-a
108 $ cd repo-a
109 $ hg --config extensions.shrink=$CONTRIBDIR/shrink-revlog.py shrink
109 $ hg --config extensions.shrink=$CONTRIBDIR/shrink-revlog.py shrink
110 shrinking $TESTTMP/repo-a/.hg/store/00manifest.i
110 shrinking $TESTTMP/repo-a/.hg/store/00manifest.i (glob)
111 reading revs
111 reading revs
112 sorting revs
112 sorting revs
113 writing revs
113 writing revs
114 old file size: 324 bytes ( 0.0 MiB)
114 old file size: 324 bytes ( 0.0 MiB)
115 new file size: 324 bytes ( 0.0 MiB)
115 new file size: 324 bytes ( 0.0 MiB)
116 shrinkage: 0.0% (1.0x)
116 shrinkage: 0.0% (1.0x)
117 note: old revlog saved in:
117 note: old revlog saved in:
118 $TESTTMP/repo-a/.hg/store/00manifest.i.old
118 $TESTTMP/repo-a/.hg/store/00manifest.i.old (glob)
119 $TESTTMP/repo-a/.hg/store/00manifest.d.old
119 $TESTTMP/repo-a/.hg/store/00manifest.d.old (glob)
120 (You can delete those files when you are satisfied that your
120 (You can delete those files when you are satisfied that your
121 repository is still sane. Running 'hg verify' is strongly recommended.)
121 repository is still sane. Running 'hg verify' is strongly recommended.)
122 $ hg verify
122 $ hg verify
123 checking changesets
123 checking changesets
124 checking manifests
124 checking manifests
125 crosschecking files in changesets and manifests
125 crosschecking files in changesets and manifests
126 checking files
126 checking files
127 1 files, 3 changesets, 3 total revisions
127 1 files, 3 changesets, 3 total revisions
128 $ cd ..
128 $ cd ..
129
129
130 Test simplemerge command:
130 Test simplemerge command:
131
131
132 $ cp "$CONTRIBDIR/simplemerge" .
132 $ cp "$CONTRIBDIR/simplemerge" .
133 $ echo base > base
133 $ echo base > base
134 $ echo local > local
134 $ echo local > local
135 $ cat base >> local
135 $ cat base >> local
136 $ cp local orig
136 $ cp local orig
137 $ cat base > other
137 $ cat base > other
138 $ echo other >> other
138 $ echo other >> other
139
139
140 changing local directly
140 changing local directly
141
141
142 $ python simplemerge local base other && echo "merge succeeded"
142 $ python simplemerge local base other && echo "merge succeeded"
143 merge succeeded
143 merge succeeded
144 $ cat local
144 $ cat local
145 local
145 local
146 base
146 base
147 other
147 other
148 $ cp orig local
148 $ cp orig local
149
149
150 printing to stdout
150 printing to stdout
151
151
152 $ python simplemerge -p local base other
152 $ python simplemerge -p local base other
153 local
153 local
154 base
154 base
155 other
155 other
156
156
157 local:
157 local:
158
158
159 $ cat local
159 $ cat local
160 local
160 local
161 base
161 base
162
162
163 conflicts
163 conflicts
164
164
165 $ cp base conflict-local
165 $ cp base conflict-local
166 $ cp other conflict-other
166 $ cp other conflict-other
167 $ echo not other >> conflict-local
167 $ echo not other >> conflict-local
168 $ echo end >> conflict-local
168 $ echo end >> conflict-local
169 $ echo end >> conflict-other
169 $ echo end >> conflict-other
170 $ python simplemerge -p conflict-local base conflict-other
170 $ python simplemerge -p conflict-local base conflict-other
171 base
171 base
172 <<<<<<< conflict-local
172 <<<<<<< conflict-local
173 not other
173 not other
174 =======
174 =======
175 other
175 other
176 >>>>>>> conflict-other
176 >>>>>>> conflict-other
177 end
177 end
178 warning: conflicts during merge.
178 warning: conflicts during merge.
179 [1]
179 [1]
180
180
181 --no-minimal
181 --no-minimal
182
182
183 $ python simplemerge -p --no-minimal conflict-local base conflict-other
183 $ python simplemerge -p --no-minimal conflict-local base conflict-other
184 base
184 base
185 <<<<<<< conflict-local
185 <<<<<<< conflict-local
186 not other
186 not other
187 end
187 end
188 =======
188 =======
189 other
189 other
190 end
190 end
191 >>>>>>> conflict-other
191 >>>>>>> conflict-other
192 warning: conflicts during merge.
192 warning: conflicts during merge.
193 [1]
193 [1]
194
194
195 1 label
195 1 label
196
196
197 $ python simplemerge -p -L foo conflict-local base conflict-other
197 $ python simplemerge -p -L foo conflict-local base conflict-other
198 base
198 base
199 <<<<<<< foo
199 <<<<<<< foo
200 not other
200 not other
201 =======
201 =======
202 other
202 other
203 >>>>>>> conflict-other
203 >>>>>>> conflict-other
204 end
204 end
205 warning: conflicts during merge.
205 warning: conflicts during merge.
206 [1]
206 [1]
207
207
208 2 labels
208 2 labels
209
209
210 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
210 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
211 base
211 base
212 <<<<<<< foo
212 <<<<<<< foo
213 not other
213 not other
214 =======
214 =======
215 other
215 other
216 >>>>>>> bar
216 >>>>>>> bar
217 end
217 end
218 warning: conflicts during merge.
218 warning: conflicts during merge.
219 [1]
219 [1]
220
220
221 too many labels
221 too many labels
222
222
223 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
223 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
224 abort: can only specify two labels.
224 abort: can only specify two labels.
225 [255]
225 [255]
226
226
227 binary file
227 binary file
228
228
229 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
229 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
230 $ cat orig >> binary-local
230 $ cat orig >> binary-local
231 $ python simplemerge -p binary-local base other
231 $ python simplemerge -p binary-local base other
232 warning: binary-local looks like a binary file.
232 warning: binary-local looks like a binary file.
233 [1]
233 [1]
234
234
235 binary file --text
235 binary file --text
236
236
237 $ python simplemerge -a -p binary-local base other 2>&1
237 $ python simplemerge -a -p binary-local base other 2>&1
238 warning: binary-local looks like a binary file.
238 warning: binary-local looks like a binary file.
239 \x00local (esc)
239 \x00local (esc)
240 base
240 base
241 other
241 other
242
242
243 help
243 help
244
244
245 $ python simplemerge --help
245 $ python simplemerge --help
246 simplemerge [OPTS] LOCAL BASE OTHER
246 simplemerge [OPTS] LOCAL BASE OTHER
247
247
248 Simple three-way file merge utility with a minimal feature set.
248 Simple three-way file merge utility with a minimal feature set.
249
249
250 Apply to LOCAL the changes necessary to go from BASE to OTHER.
250 Apply to LOCAL the changes necessary to go from BASE to OTHER.
251
251
252 By default, LOCAL is overwritten with the results of this operation.
252 By default, LOCAL is overwritten with the results of this operation.
253
253
254 options:
254 options:
255 -L --label labels to use on conflict markers
255 -L --label labels to use on conflict markers
256 -a --text treat all files as text
256 -a --text treat all files as text
257 -p --print print results instead of overwriting LOCAL
257 -p --print print results instead of overwriting LOCAL
258 --no-minimal do not try to minimize conflict regions
258 --no-minimal do not try to minimize conflict regions
259 -h --help display help and exit
259 -h --help display help and exit
260 -q --quiet suppress output
260 -q --quiet suppress output
261
261
262 wrong number of arguments
262 wrong number of arguments
263
263
264 $ python simplemerge
264 $ python simplemerge
265 simplemerge: wrong number of arguments
265 simplemerge: wrong number of arguments
266 simplemerge [OPTS] LOCAL BASE OTHER
266 simplemerge [OPTS] LOCAL BASE OTHER
267
267
268 Simple three-way file merge utility with a minimal feature set.
268 Simple three-way file merge utility with a minimal feature set.
269
269
270 Apply to LOCAL the changes necessary to go from BASE to OTHER.
270 Apply to LOCAL the changes necessary to go from BASE to OTHER.
271
271
272 By default, LOCAL is overwritten with the results of this operation.
272 By default, LOCAL is overwritten with the results of this operation.
273
273
274 options:
274 options:
275 -L --label labels to use on conflict markers
275 -L --label labels to use on conflict markers
276 -a --text treat all files as text
276 -a --text treat all files as text
277 -p --print print results instead of overwriting LOCAL
277 -p --print print results instead of overwriting LOCAL
278 --no-minimal do not try to minimize conflict regions
278 --no-minimal do not try to minimize conflict regions
279 -h --help display help and exit
279 -h --help display help and exit
280 -q --quiet suppress output
280 -q --quiet suppress output
281 [1]
281 [1]
282
282
283 bad option
283 bad option
284
284
285 $ python simplemerge --foo -p local base other
285 $ python simplemerge --foo -p local base other
286 simplemerge: option --foo not recognized
286 simplemerge: option --foo not recognized
287 simplemerge [OPTS] LOCAL BASE OTHER
287 simplemerge [OPTS] LOCAL BASE OTHER
288
288
289 Simple three-way file merge utility with a minimal feature set.
289 Simple three-way file merge utility with a minimal feature set.
290
290
291 Apply to LOCAL the changes necessary to go from BASE to OTHER.
291 Apply to LOCAL the changes necessary to go from BASE to OTHER.
292
292
293 By default, LOCAL is overwritten with the results of this operation.
293 By default, LOCAL is overwritten with the results of this operation.
294
294
295 options:
295 options:
296 -L --label labels to use on conflict markers
296 -L --label labels to use on conflict markers
297 -a --text treat all files as text
297 -a --text treat all files as text
298 -p --print print results instead of overwriting LOCAL
298 -p --print print results instead of overwriting LOCAL
299 --no-minimal do not try to minimize conflict regions
299 --no-minimal do not try to minimize conflict regions
300 -h --help display help and exit
300 -h --help display help and exit
301 -q --quiet suppress output
301 -q --quiet suppress output
302 [1]
302 [1]
@@ -1,58 +1,58 b''
1
1
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [extensions]
3 > [extensions]
4 > convert=
4 > convert=
5 > EOF
5 > EOF
6
6
7 Prepare orig repo
7 Prepare orig repo
8
8
9 $ hg init orig
9 $ hg init orig
10 $ cd orig
10 $ cd orig
11 $ echo foo > foo
11 $ echo foo > foo
12 $ HGUSER='user name' hg ci -qAm 'foo'
12 $ HGUSER='user name' hg ci -qAm 'foo'
13 $ cd ..
13 $ cd ..
14
14
15 Explicit --authors
15 Explicit --authors
16
16
17 $ cat > authormap.txt <<EOF
17 $ cat > authormap.txt <<EOF
18 > user name = Long User Name
18 > user name = Long User Name
19 >
19 >
20 > # comment
20 > # comment
21 > this line is ignored
21 > this line is ignored
22 > EOF
22 > EOF
23 $ hg convert --authors authormap.txt orig new
23 $ hg convert --authors authormap.txt orig new
24 initializing destination new repository
24 initializing destination new repository
25 Ignoring bad line in author map file authormap.txt: this line is ignored
25 Ignoring bad line in author map file authormap.txt: this line is ignored
26 scanning source...
26 scanning source...
27 sorting...
27 sorting...
28 converting...
28 converting...
29 0 foo
29 0 foo
30 Writing author map file $TESTTMP/new/.hg/authormap
30 Writing author map file $TESTTMP/new/.hg/authormap (glob)
31 $ cat new/.hg/authormap
31 $ cat new/.hg/authormap
32 user name=Long User Name
32 user name=Long User Name
33 $ hg -Rnew log
33 $ hg -Rnew log
34 changeset: 0:d89716e88087
34 changeset: 0:d89716e88087
35 tag: tip
35 tag: tip
36 user: Long User Name
36 user: Long User Name
37 date: Thu Jan 01 00:00:00 1970 +0000
37 date: Thu Jan 01 00:00:00 1970 +0000
38 summary: foo
38 summary: foo
39
39
40 $ rm -rf new
40 $ rm -rf new
41
41
42 Implicit .hg/authormap
42 Implicit .hg/authormap
43
43
44 $ hg init new
44 $ hg init new
45 $ mv authormap.txt new/.hg/authormap
45 $ mv authormap.txt new/.hg/authormap
46 $ hg convert orig new
46 $ hg convert orig new
47 Ignoring bad line in author map file $TESTTMP/new/.hg/authormap: this line is ignored
47 Ignoring bad line in author map file $TESTTMP/new/.hg/authormap: this line is ignored (glob)
48 scanning source...
48 scanning source...
49 sorting...
49 sorting...
50 converting...
50 converting...
51 0 foo
51 0 foo
52 $ hg -Rnew log
52 $ hg -Rnew log
53 changeset: 0:d89716e88087
53 changeset: 0:d89716e88087
54 tag: tip
54 tag: tip
55 user: Long User Name
55 user: Long User Name
56 date: Thu Jan 01 00:00:00 1970 +0000
56 date: Thu Jan 01 00:00:00 1970 +0000
57 summary: foo
57 summary: foo
58
58
@@ -1,38 +1,38 b''
1 $ hg init a
1 $ hg init a
2
2
3 $ echo a > a/a
3 $ echo a > a/a
4 $ hg --cwd a ci -Ama
4 $ hg --cwd a ci -Ama
5 adding a
5 adding a
6
6
7 $ hg clone a c
7 $ hg clone a c
8 updating to branch default
8 updating to branch default
9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
9 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
10
10
11 $ hg clone a b
11 $ hg clone a b
12 updating to branch default
12 updating to branch default
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
14
14
15 $ echo b >> b/a
15 $ echo b >> b/a
16 $ hg --cwd b ci -mb
16 $ hg --cwd b ci -mb
17
17
18 Push should push to 'default' when 'default-push' not set:
18 Push should push to 'default' when 'default-push' not set:
19
19
20 $ hg --cwd b push
20 $ hg --cwd b push
21 pushing to $TESTTMP/a
21 pushing to $TESTTMP/a (glob)
22 searching for changes
22 searching for changes
23 adding changesets
23 adding changesets
24 adding manifests
24 adding manifests
25 adding file changes
25 adding file changes
26 added 1 changesets with 1 changes to 1 files
26 added 1 changesets with 1 changes to 1 files
27
27
28 Push should push to 'default-push' when set:
28 Push should push to 'default-push' when set:
29
29
30 $ echo 'default-push = ../c' >> b/.hg/hgrc
30 $ echo 'default-push = ../c' >> b/.hg/hgrc
31 $ hg --cwd b push
31 $ hg --cwd b push
32 pushing to $TESTTMP/c
32 pushing to $TESTTMP/c (glob)
33 searching for changes
33 searching for changes
34 adding changesets
34 adding changesets
35 adding manifests
35 adding manifests
36 adding file changes
36 adding file changes
37 added 1 changesets with 1 changes to 1 files
37 added 1 changesets with 1 changes to 1 files
38
38
@@ -1,41 +1,41 b''
1 ------ Test dirstate._dirs refcounting
1 ------ Test dirstate._dirs refcounting
2
2
3 $ hg init t
3 $ hg init t
4 $ cd t
4 $ cd t
5 $ mkdir -p a/b/c/d
5 $ mkdir -p a/b/c/d
6 $ touch a/b/c/d/x
6 $ touch a/b/c/d/x
7 $ touch a/b/c/d/y
7 $ touch a/b/c/d/y
8 $ touch a/b/c/d/z
8 $ touch a/b/c/d/z
9 $ hg ci -Am m
9 $ hg ci -Am m
10 adding a/b/c/d/x
10 adding a/b/c/d/x
11 adding a/b/c/d/y
11 adding a/b/c/d/y
12 adding a/b/c/d/z
12 adding a/b/c/d/z
13 $ hg mv a z
13 $ hg mv a z
14 moving a/b/c/d/x to z/b/c/d/x
14 moving a/b/c/d/x to z/b/c/d/x (glob)
15 moving a/b/c/d/y to z/b/c/d/y
15 moving a/b/c/d/y to z/b/c/d/y (glob)
16 moving a/b/c/d/z to z/b/c/d/z
16 moving a/b/c/d/z to z/b/c/d/z (glob)
17 $ cd ..
17 $ cd ..
18
18
19 Issue1790: dirstate entry locked into unset if file mtime is set into
19 Issue1790: dirstate entry locked into unset if file mtime is set into
20 the future
20 the future
21
21
22 Prepare test repo:
22 Prepare test repo:
23
23
24 $ hg init u
24 $ hg init u
25 $ cd u
25 $ cd u
26 $ echo a > a
26 $ echo a > a
27 $ hg add
27 $ hg add
28 adding a
28 adding a
29 $ hg ci -m1
29 $ hg ci -m1
30
30
31 Set mtime of a into the future:
31 Set mtime of a into the future:
32
32
33 $ touch -t 202101011200 a
33 $ touch -t 202101011200 a
34
34
35 Status must not set a's entry to unset (issue1790):
35 Status must not set a's entry to unset (issue1790):
36
36
37 $ hg status
37 $ hg status
38 $ hg debugstate
38 $ hg debugstate
39 n 644 2 2021-01-01 12:00:00 a
39 n 644 2 2021-01-01 12:00:00 a
40 $ cd ..
40 $ cd ..
41
41
@@ -1,479 +1,479 b''
1 Test basic extension support
1 Test basic extension support
2
2
3 $ "$TESTDIR/hghave" no-outer-repo || exit 80
3 $ "$TESTDIR/hghave" no-outer-repo || exit 80
4
4
5 $ cat > foobar.py <<EOF
5 $ cat > foobar.py <<EOF
6 > import os
6 > import os
7 > from mercurial import commands
7 > from mercurial import commands
8 >
8 >
9 > def uisetup(ui):
9 > def uisetup(ui):
10 > ui.write("uisetup called\\n")
10 > ui.write("uisetup called\\n")
11 >
11 >
12 > def reposetup(ui, repo):
12 > def reposetup(ui, repo):
13 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
13 > ui.write("reposetup called for %s\\n" % os.path.basename(repo.root))
14 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
14 > ui.write("ui %s= repo.ui\\n" % (ui == repo.ui and "=" or "!"))
15 >
15 >
16 > def foo(ui, *args, **kwargs):
16 > def foo(ui, *args, **kwargs):
17 > ui.write("Foo\\n")
17 > ui.write("Foo\\n")
18 >
18 >
19 > def bar(ui, *args, **kwargs):
19 > def bar(ui, *args, **kwargs):
20 > ui.write("Bar\\n")
20 > ui.write("Bar\\n")
21 >
21 >
22 > cmdtable = {
22 > cmdtable = {
23 > "foo": (foo, [], "hg foo"),
23 > "foo": (foo, [], "hg foo"),
24 > "bar": (bar, [], "hg bar"),
24 > "bar": (bar, [], "hg bar"),
25 > }
25 > }
26 >
26 >
27 > commands.norepo += ' bar'
27 > commands.norepo += ' bar'
28 > EOF
28 > EOF
29 $ abspath=`pwd`/foobar.py
29 $ abspath=`pwd`/foobar.py
30
30
31 $ mkdir barfoo
31 $ mkdir barfoo
32 $ cp foobar.py barfoo/__init__.py
32 $ cp foobar.py barfoo/__init__.py
33 $ barfoopath=`pwd`/barfoo
33 $ barfoopath=`pwd`/barfoo
34
34
35 $ hg init a
35 $ hg init a
36 $ cd a
36 $ cd a
37 $ echo foo > file
37 $ echo foo > file
38 $ hg add file
38 $ hg add file
39 $ hg commit -m 'add file'
39 $ hg commit -m 'add file'
40
40
41 $ echo '[extensions]' >> $HGRCPATH
41 $ echo '[extensions]' >> $HGRCPATH
42 $ echo "foobar = $abspath" >> $HGRCPATH
42 $ echo "foobar = $abspath" >> $HGRCPATH
43 $ hg foo
43 $ hg foo
44 uisetup called
44 uisetup called
45 reposetup called for a
45 reposetup called for a
46 ui == repo.ui
46 ui == repo.ui
47 Foo
47 Foo
48
48
49 $ cd ..
49 $ cd ..
50 $ hg clone a b
50 $ hg clone a b
51 uisetup called
51 uisetup called
52 reposetup called for a
52 reposetup called for a
53 ui == repo.ui
53 ui == repo.ui
54 reposetup called for b
54 reposetup called for b
55 ui == repo.ui
55 ui == repo.ui
56 updating to branch default
56 updating to branch default
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58
58
59 $ hg bar
59 $ hg bar
60 uisetup called
60 uisetup called
61 Bar
61 Bar
62 $ echo 'foobar = !' >> $HGRCPATH
62 $ echo 'foobar = !' >> $HGRCPATH
63
63
64 module/__init__.py-style
64 module/__init__.py-style
65
65
66 $ echo "barfoo = $barfoopath" >> $HGRCPATH
66 $ echo "barfoo = $barfoopath" >> $HGRCPATH
67 $ cd a
67 $ cd a
68 $ hg foo
68 $ hg foo
69 uisetup called
69 uisetup called
70 reposetup called for a
70 reposetup called for a
71 ui == repo.ui
71 ui == repo.ui
72 Foo
72 Foo
73 $ echo 'barfoo = !' >> $HGRCPATH
73 $ echo 'barfoo = !' >> $HGRCPATH
74
74
75 Check that extensions are loaded in phases:
75 Check that extensions are loaded in phases:
76
76
77 $ cat > foo.py <<EOF
77 $ cat > foo.py <<EOF
78 > import os
78 > import os
79 > name = os.path.basename(__file__).rsplit('.', 1)[0]
79 > name = os.path.basename(__file__).rsplit('.', 1)[0]
80 > print "1) %s imported" % name
80 > print "1) %s imported" % name
81 > def uisetup(ui):
81 > def uisetup(ui):
82 > print "2) %s uisetup" % name
82 > print "2) %s uisetup" % name
83 > def extsetup():
83 > def extsetup():
84 > print "3) %s extsetup" % name
84 > print "3) %s extsetup" % name
85 > def reposetup(ui, repo):
85 > def reposetup(ui, repo):
86 > print "4) %s reposetup" % name
86 > print "4) %s reposetup" % name
87 > EOF
87 > EOF
88
88
89 $ cp foo.py bar.py
89 $ cp foo.py bar.py
90 $ echo 'foo = foo.py' >> $HGRCPATH
90 $ echo 'foo = foo.py' >> $HGRCPATH
91 $ echo 'bar = bar.py' >> $HGRCPATH
91 $ echo 'bar = bar.py' >> $HGRCPATH
92
92
93 Command with no output, we just want to see the extensions loaded:
93 Command with no output, we just want to see the extensions loaded:
94
94
95 $ hg paths
95 $ hg paths
96 1) foo imported
96 1) foo imported
97 1) bar imported
97 1) bar imported
98 2) foo uisetup
98 2) foo uisetup
99 2) bar uisetup
99 2) bar uisetup
100 3) foo extsetup
100 3) foo extsetup
101 3) bar extsetup
101 3) bar extsetup
102 4) foo reposetup
102 4) foo reposetup
103 4) bar reposetup
103 4) bar reposetup
104
104
105 Check hgweb's load order:
105 Check hgweb's load order:
106
106
107 $ cat > hgweb.cgi <<EOF
107 $ cat > hgweb.cgi <<EOF
108 > #!/usr/bin/env python
108 > #!/usr/bin/env python
109 > from mercurial import demandimport; demandimport.enable()
109 > from mercurial import demandimport; demandimport.enable()
110 > from mercurial.hgweb import hgweb
110 > from mercurial.hgweb import hgweb
111 > from mercurial.hgweb import wsgicgi
111 > from mercurial.hgweb import wsgicgi
112 >
112 >
113 > application = hgweb('.', 'test repo')
113 > application = hgweb('.', 'test repo')
114 > wsgicgi.launch(application)
114 > wsgicgi.launch(application)
115 > EOF
115 > EOF
116
116
117 $ SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
117 $ SCRIPT_NAME='/' SERVER_PORT='80' SERVER_NAME='localhost' python hgweb.cgi \
118 > | grep '^[0-9]) ' # ignores HTML output
118 > | grep '^[0-9]) ' # ignores HTML output
119 1) foo imported
119 1) foo imported
120 1) bar imported
120 1) bar imported
121 2) foo uisetup
121 2) foo uisetup
122 2) bar uisetup
122 2) bar uisetup
123 3) foo extsetup
123 3) foo extsetup
124 3) bar extsetup
124 3) bar extsetup
125 4) foo reposetup
125 4) foo reposetup
126 4) bar reposetup
126 4) bar reposetup
127 4) foo reposetup
127 4) foo reposetup
128 4) bar reposetup
128 4) bar reposetup
129
129
130 $ echo 'foo = !' >> $HGRCPATH
130 $ echo 'foo = !' >> $HGRCPATH
131 $ echo 'bar = !' >> $HGRCPATH
131 $ echo 'bar = !' >> $HGRCPATH
132
132
133 $ cd ..
133 $ cd ..
134
134
135 $ cat > empty.py <<EOF
135 $ cat > empty.py <<EOF
136 > '''empty cmdtable
136 > '''empty cmdtable
137 > '''
137 > '''
138 > cmdtable = {}
138 > cmdtable = {}
139 > EOF
139 > EOF
140 $ emptypath=`pwd`/empty.py
140 $ emptypath=`pwd`/empty.py
141 $ echo "empty = $emptypath" >> $HGRCPATH
141 $ echo "empty = $emptypath" >> $HGRCPATH
142 $ hg help empty
142 $ hg help empty
143 empty extension - empty cmdtable
143 empty extension - empty cmdtable
144
144
145 no commands defined
145 no commands defined
146
146
147 $ echo 'empty = !' >> $HGRCPATH
147 $ echo 'empty = !' >> $HGRCPATH
148
148
149 $ cat > debugextension.py <<EOF
149 $ cat > debugextension.py <<EOF
150 > '''only debugcommands
150 > '''only debugcommands
151 > '''
151 > '''
152 > def debugfoobar(ui, repo, *args, **opts):
152 > def debugfoobar(ui, repo, *args, **opts):
153 > "yet another debug command"
153 > "yet another debug command"
154 > pass
154 > pass
155 >
155 >
156 > def foo(ui, repo, *args, **opts):
156 > def foo(ui, repo, *args, **opts):
157 > """yet another foo command
157 > """yet another foo command
158 >
158 >
159 > This command has been DEPRECATED since forever.
159 > This command has been DEPRECATED since forever.
160 > """
160 > """
161 > pass
161 > pass
162 >
162 >
163 > cmdtable = {
163 > cmdtable = {
164 > "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
164 > "debugfoobar": (debugfoobar, (), "hg debugfoobar"),
165 > "foo": (foo, (), "hg foo")
165 > "foo": (foo, (), "hg foo")
166 > }
166 > }
167 > EOF
167 > EOF
168 $ debugpath=`pwd`/debugextension.py
168 $ debugpath=`pwd`/debugextension.py
169 $ echo "debugextension = $debugpath" >> $HGRCPATH
169 $ echo "debugextension = $debugpath" >> $HGRCPATH
170
170
171 $ hg help debugextension
171 $ hg help debugextension
172 debugextension extension - only debugcommands
172 debugextension extension - only debugcommands
173
173
174 no commands defined
174 no commands defined
175
175
176 $ hg --verbose help debugextension
176 $ hg --verbose help debugextension
177 debugextension extension - only debugcommands
177 debugextension extension - only debugcommands
178
178
179 list of commands:
179 list of commands:
180
180
181 foo:
181 foo:
182 yet another foo command
182 yet another foo command
183
183
184 global options:
184 global options:
185
185
186 -R --repository REPO repository root directory or name of overlay bundle
186 -R --repository REPO repository root directory or name of overlay bundle
187 file
187 file
188 --cwd DIR change working directory
188 --cwd DIR change working directory
189 -y --noninteractive do not prompt, automatically pick the first choice for
189 -y --noninteractive do not prompt, automatically pick the first choice for
190 all prompts
190 all prompts
191 -q --quiet suppress output
191 -q --quiet suppress output
192 -v --verbose enable additional output
192 -v --verbose enable additional output
193 --config CONFIG [+] set/override config option (use 'section.name=value')
193 --config CONFIG [+] set/override config option (use 'section.name=value')
194 --debug enable debugging output
194 --debug enable debugging output
195 --debugger start debugger
195 --debugger start debugger
196 --encoding ENCODE set the charset encoding (default: ascii)
196 --encoding ENCODE set the charset encoding (default: ascii)
197 --encodingmode MODE set the charset encoding mode (default: strict)
197 --encodingmode MODE set the charset encoding mode (default: strict)
198 --traceback always print a traceback on exception
198 --traceback always print a traceback on exception
199 --time time how long the command takes
199 --time time how long the command takes
200 --profile print command execution profile
200 --profile print command execution profile
201 --version output version information and exit
201 --version output version information and exit
202 -h --help display help and exit
202 -h --help display help and exit
203
203
204 [+] marked option can be specified multiple times
204 [+] marked option can be specified multiple times
205
205
206 $ hg --debug help debugextension
206 $ hg --debug help debugextension
207 debugextension extension - only debugcommands
207 debugextension extension - only debugcommands
208
208
209 list of commands:
209 list of commands:
210
210
211 debugfoobar:
211 debugfoobar:
212 yet another debug command
212 yet another debug command
213 foo:
213 foo:
214 yet another foo command
214 yet another foo command
215
215
216 global options:
216 global options:
217
217
218 -R --repository REPO repository root directory or name of overlay bundle
218 -R --repository REPO repository root directory or name of overlay bundle
219 file
219 file
220 --cwd DIR change working directory
220 --cwd DIR change working directory
221 -y --noninteractive do not prompt, automatically pick the first choice for
221 -y --noninteractive do not prompt, automatically pick the first choice for
222 all prompts
222 all prompts
223 -q --quiet suppress output
223 -q --quiet suppress output
224 -v --verbose enable additional output
224 -v --verbose enable additional output
225 --config CONFIG [+] set/override config option (use 'section.name=value')
225 --config CONFIG [+] set/override config option (use 'section.name=value')
226 --debug enable debugging output
226 --debug enable debugging output
227 --debugger start debugger
227 --debugger start debugger
228 --encoding ENCODE set the charset encoding (default: ascii)
228 --encoding ENCODE set the charset encoding (default: ascii)
229 --encodingmode MODE set the charset encoding mode (default: strict)
229 --encodingmode MODE set the charset encoding mode (default: strict)
230 --traceback always print a traceback on exception
230 --traceback always print a traceback on exception
231 --time time how long the command takes
231 --time time how long the command takes
232 --profile print command execution profile
232 --profile print command execution profile
233 --version output version information and exit
233 --version output version information and exit
234 -h --help display help and exit
234 -h --help display help and exit
235
235
236 [+] marked option can be specified multiple times
236 [+] marked option can be specified multiple times
237 $ echo 'debugextension = !' >> $HGRCPATH
237 $ echo 'debugextension = !' >> $HGRCPATH
238
238
239 Extension module help vs command help:
239 Extension module help vs command help:
240
240
241 $ echo 'extdiff =' >> $HGRCPATH
241 $ echo 'extdiff =' >> $HGRCPATH
242 $ hg help extdiff
242 $ hg help extdiff
243 hg extdiff [OPT]... [FILE]...
243 hg extdiff [OPT]... [FILE]...
244
244
245 use external program to diff repository (or selected files)
245 use external program to diff repository (or selected files)
246
246
247 Show differences between revisions for the specified files, using an
247 Show differences between revisions for the specified files, using an
248 external program. The default program used is diff, with default options
248 external program. The default program used is diff, with default options
249 "-Npru".
249 "-Npru".
250
250
251 To select a different program, use the -p/--program option. The program
251 To select a different program, use the -p/--program option. The program
252 will be passed the names of two directories to compare. To pass additional
252 will be passed the names of two directories to compare. To pass additional
253 options to the program, use -o/--option. These will be passed before the
253 options to the program, use -o/--option. These will be passed before the
254 names of the directories to compare.
254 names of the directories to compare.
255
255
256 When two revision arguments are given, then changes are shown between
256 When two revision arguments are given, then changes are shown between
257 those revisions. If only one revision is specified then that revision is
257 those revisions. If only one revision is specified then that revision is
258 compared to the working directory, and, when no revisions are specified,
258 compared to the working directory, and, when no revisions are specified,
259 the working directory files are compared to its parent.
259 the working directory files are compared to its parent.
260
260
261 use "hg help -e extdiff" to show help for the extdiff extension
261 use "hg help -e extdiff" to show help for the extdiff extension
262
262
263 options:
263 options:
264
264
265 -p --program CMD comparison program to run
265 -p --program CMD comparison program to run
266 -o --option OPT [+] pass option to comparison program
266 -o --option OPT [+] pass option to comparison program
267 -r --rev REV [+] revision
267 -r --rev REV [+] revision
268 -c --change REV change made by revision
268 -c --change REV change made by revision
269 -I --include PATTERN [+] include names matching the given patterns
269 -I --include PATTERN [+] include names matching the given patterns
270 -X --exclude PATTERN [+] exclude names matching the given patterns
270 -X --exclude PATTERN [+] exclude names matching the given patterns
271
271
272 [+] marked option can be specified multiple times
272 [+] marked option can be specified multiple times
273
273
274 use "hg -v help extdiff" to show more info
274 use "hg -v help extdiff" to show more info
275
275
276 $ hg help --extension extdiff
276 $ hg help --extension extdiff
277 extdiff extension - command to allow external programs to compare revisions
277 extdiff extension - command to allow external programs to compare revisions
278
278
279 The extdiff Mercurial extension allows you to use external programs to compare
279 The extdiff Mercurial extension allows you to use external programs to compare
280 revisions, or revision with working directory. The external diff programs are
280 revisions, or revision with working directory. The external diff programs are
281 called with a configurable set of options and two non-option arguments: paths
281 called with a configurable set of options and two non-option arguments: paths
282 to directories containing snapshots of files to compare.
282 to directories containing snapshots of files to compare.
283
283
284 The extdiff extension also allows you to configure new diff commands, so you
284 The extdiff extension also allows you to configure new diff commands, so you
285 do not need to type "hg extdiff -p kdiff3" always.
285 do not need to type "hg extdiff -p kdiff3" always.
286
286
287 [extdiff]
287 [extdiff]
288 # add new command that runs GNU diff(1) in 'context diff' mode
288 # add new command that runs GNU diff(1) in 'context diff' mode
289 cdiff = gdiff -Nprc5
289 cdiff = gdiff -Nprc5
290 ## or the old way:
290 ## or the old way:
291 #cmd.cdiff = gdiff
291 #cmd.cdiff = gdiff
292 #opts.cdiff = -Nprc5
292 #opts.cdiff = -Nprc5
293
293
294 # add new command called vdiff, runs kdiff3
294 # add new command called vdiff, runs kdiff3
295 vdiff = kdiff3
295 vdiff = kdiff3
296
296
297 # add new command called meld, runs meld (no need to name twice)
297 # add new command called meld, runs meld (no need to name twice)
298 meld =
298 meld =
299
299
300 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
300 # add new command called vimdiff, runs gvimdiff with DirDiff plugin
301 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
301 # (see http://www.vim.org/scripts/script.php?script_id=102) Non
302 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
302 # English user, be sure to put "let g:DirDiffDynamicDiffText = 1" in
303 # your .vimrc
303 # your .vimrc
304 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
304 vimdiff = gvim -f '+next' '+execute "DirDiff" argv(0) argv(1)'
305
305
306 Tool arguments can include variables that are expanded at runtime:
306 Tool arguments can include variables that are expanded at runtime:
307
307
308 $parent1, $plabel1 - filename, descriptive label of first parent
308 $parent1, $plabel1 - filename, descriptive label of first parent
309 $child, $clabel - filename, descriptive label of child revision
309 $child, $clabel - filename, descriptive label of child revision
310 $parent2, $plabel2 - filename, descriptive label of second parent
310 $parent2, $plabel2 - filename, descriptive label of second parent
311 $root - repository root
311 $root - repository root
312 $parent is an alias for $parent1.
312 $parent is an alias for $parent1.
313
313
314 The extdiff extension will look in your [diff-tools] and [merge-tools]
314 The extdiff extension will look in your [diff-tools] and [merge-tools]
315 sections for diff tool arguments, when none are specified in [extdiff].
315 sections for diff tool arguments, when none are specified in [extdiff].
316
316
317 [extdiff]
317 [extdiff]
318 kdiff3 =
318 kdiff3 =
319
319
320 [diff-tools]
320 [diff-tools]
321 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
321 kdiff3.diffargs=--L1 '$plabel1' --L2 '$clabel' $parent $child
322
322
323 You can use -I/-X and list of file or directory names like normal "hg diff"
323 You can use -I/-X and list of file or directory names like normal "hg diff"
324 command. The extdiff extension makes snapshots of only needed files, so
324 command. The extdiff extension makes snapshots of only needed files, so
325 running the external diff program will actually be pretty fast (at least
325 running the external diff program will actually be pretty fast (at least
326 faster than having to compare the entire tree).
326 faster than having to compare the entire tree).
327
327
328 list of commands:
328 list of commands:
329
329
330 extdiff use external program to diff repository (or selected files)
330 extdiff use external program to diff repository (or selected files)
331
331
332 use "hg -v help extdiff" to show builtin aliases and global options
332 use "hg -v help extdiff" to show builtin aliases and global options
333
333
334 $ echo 'extdiff = !' >> $HGRCPATH
334 $ echo 'extdiff = !' >> $HGRCPATH
335
335
336 Test help topic with same name as extension
336 Test help topic with same name as extension
337
337
338 $ cat > multirevs.py <<EOF
338 $ cat > multirevs.py <<EOF
339 > from mercurial import commands
339 > from mercurial import commands
340 > """multirevs extension
340 > """multirevs extension
341 > Big multi-line module docstring."""
341 > Big multi-line module docstring."""
342 > def multirevs(ui, repo, arg, *args, **opts):
342 > def multirevs(ui, repo, arg, *args, **opts):
343 > """multirevs command"""
343 > """multirevs command"""
344 > pass
344 > pass
345 > cmdtable = {
345 > cmdtable = {
346 > "multirevs": (multirevs, [], 'ARG')
346 > "multirevs": (multirevs, [], 'ARG')
347 > }
347 > }
348 > commands.norepo += ' multirevs'
348 > commands.norepo += ' multirevs'
349 > EOF
349 > EOF
350 $ echo "multirevs = multirevs.py" >> $HGRCPATH
350 $ echo "multirevs = multirevs.py" >> $HGRCPATH
351
351
352 $ hg help multirevs
352 $ hg help multirevs
353 Specifying Multiple Revisions
353 Specifying Multiple Revisions
354
354
355 When Mercurial accepts more than one revision, they may be specified
355 When Mercurial accepts more than one revision, they may be specified
356 individually, or provided as a topologically continuous range, separated
356 individually, or provided as a topologically continuous range, separated
357 by the ":" character.
357 by the ":" character.
358
358
359 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
359 The syntax of range notation is [BEGIN]:[END], where BEGIN and END are
360 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
360 revision identifiers. Both BEGIN and END are optional. If BEGIN is not
361 specified, it defaults to revision number 0. If END is not specified, it
361 specified, it defaults to revision number 0. If END is not specified, it
362 defaults to the tip. The range ":" thus means "all revisions".
362 defaults to the tip. The range ":" thus means "all revisions".
363
363
364 If BEGIN is greater than END, revisions are treated in reverse order.
364 If BEGIN is greater than END, revisions are treated in reverse order.
365
365
366 A range acts as a closed interval. This means that a range of 3:5 gives 3,
366 A range acts as a closed interval. This means that a range of 3:5 gives 3,
367 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
367 4 and 5. Similarly, a range of 9:6 gives 9, 8, 7, and 6.
368
368
369 use "hg help -c multirevs" to see help for the multirevs command
369 use "hg help -c multirevs" to see help for the multirevs command
370
370
371 $ hg help -c multirevs
371 $ hg help -c multirevs
372 hg multirevs ARG
372 hg multirevs ARG
373
373
374 multirevs command
374 multirevs command
375
375
376 use "hg -v help multirevs" to show more info
376 use "hg -v help multirevs" to show more info
377
377
378 $ hg multirevs
378 $ hg multirevs
379 hg multirevs: invalid arguments
379 hg multirevs: invalid arguments
380 hg multirevs ARG
380 hg multirevs ARG
381
381
382 multirevs command
382 multirevs command
383
383
384 use "hg help multirevs" to show the full help text
384 use "hg help multirevs" to show the full help text
385 [255]
385 [255]
386
386
387 $ echo "multirevs = !" >> $HGRCPATH
387 $ echo "multirevs = !" >> $HGRCPATH
388
388
389 Issue811: Problem loading extensions twice (by site and by user)
389 Issue811: Problem loading extensions twice (by site and by user)
390
390
391 $ debugpath=`pwd`/debugissue811.py
391 $ debugpath=`pwd`/debugissue811.py
392 $ cat > debugissue811.py <<EOF
392 $ cat > debugissue811.py <<EOF
393 > '''show all loaded extensions
393 > '''show all loaded extensions
394 > '''
394 > '''
395 > from mercurial import extensions, commands
395 > from mercurial import extensions, commands
396 >
396 >
397 > def debugextensions(ui):
397 > def debugextensions(ui):
398 > "yet another debug command"
398 > "yet another debug command"
399 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
399 > ui.write("%s\n" % '\n'.join([x for x, y in extensions.extensions()]))
400 >
400 >
401 > cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
401 > cmdtable = {"debugextensions": (debugextensions, (), "hg debugextensions")}
402 > commands.norepo += " debugextensions"
402 > commands.norepo += " debugextensions"
403 > EOF
403 > EOF
404 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
404 $ echo "debugissue811 = $debugpath" >> $HGRCPATH
405 $ echo "mq=" >> $HGRCPATH
405 $ echo "mq=" >> $HGRCPATH
406 $ echo "hgext.mq=" >> $HGRCPATH
406 $ echo "hgext.mq=" >> $HGRCPATH
407 $ echo "hgext/mq=" >> $HGRCPATH
407 $ echo "hgext/mq=" >> $HGRCPATH
408
408
409 Show extensions:
409 Show extensions:
410
410
411 $ hg debugextensions
411 $ hg debugextensions
412 debugissue811
412 debugissue811
413 mq
413 mq
414
414
415 Disabled extension commands:
415 Disabled extension commands:
416
416
417 $ HGRCPATH=
417 $ HGRCPATH=
418 $ export HGRCPATH
418 $ export HGRCPATH
419 $ hg help email
419 $ hg help email
420 'email' is provided by the following extension:
420 'email' is provided by the following extension:
421
421
422 patchbomb command to send changesets as (a series of) patch emails
422 patchbomb command to send changesets as (a series of) patch emails
423
423
424 use "hg help extensions" for information on enabling extensions
424 use "hg help extensions" for information on enabling extensions
425 $ hg qdel
425 $ hg qdel
426 hg: unknown command 'qdel'
426 hg: unknown command 'qdel'
427 'qdelete' is provided by the following extension:
427 'qdelete' is provided by the following extension:
428
428
429 mq manage a stack of patches
429 mq manage a stack of patches
430
430
431 use "hg help extensions" for information on enabling extensions
431 use "hg help extensions" for information on enabling extensions
432 [255]
432 [255]
433 $ hg churn
433 $ hg churn
434 hg: unknown command 'churn'
434 hg: unknown command 'churn'
435 'churn' is provided by the following extension:
435 'churn' is provided by the following extension:
436
436
437 churn command to display statistics about repository history
437 churn command to display statistics about repository history
438
438
439 use "hg help extensions" for information on enabling extensions
439 use "hg help extensions" for information on enabling extensions
440 [255]
440 [255]
441
441
442 Disabled extensions:
442 Disabled extensions:
443
443
444 $ hg help churn
444 $ hg help churn
445 churn extension - command to display statistics about repository history
445 churn extension - command to display statistics about repository history
446
446
447 use "hg help extensions" for information on enabling extensions
447 use "hg help extensions" for information on enabling extensions
448 $ hg help patchbomb
448 $ hg help patchbomb
449 patchbomb extension - command to send changesets as (a series of) patch emails
449 patchbomb extension - command to send changesets as (a series of) patch emails
450
450
451 use "hg help extensions" for information on enabling extensions
451 use "hg help extensions" for information on enabling extensions
452
452
453 Broken disabled extension and command:
453 Broken disabled extension and command:
454
454
455 $ mkdir hgext
455 $ mkdir hgext
456 $ echo > hgext/__init__.py
456 $ echo > hgext/__init__.py
457 $ cat > hgext/broken.py <<EOF
457 $ cat > hgext/broken.py <<EOF
458 > "broken extension'
458 > "broken extension'
459 > EOF
459 > EOF
460 $ cat > path.py <<EOF
460 $ cat > path.py <<EOF
461 > import os, sys
461 > import os, sys
462 > sys.path.insert(0, os.environ['HGEXTPATH'])
462 > sys.path.insert(0, os.environ['HGEXTPATH'])
463 > EOF
463 > EOF
464 $ HGEXTPATH=`pwd`
464 $ HGEXTPATH=`pwd`
465 $ export HGEXTPATH
465 $ export HGEXTPATH
466
466
467 $ hg --config extensions.path=./path.py help broken
467 $ hg --config extensions.path=./path.py help broken
468 broken extension - (no help text available)
468 broken extension - (no help text available)
469
469
470 use "hg help extensions" for information on enabling extensions
470 use "hg help extensions" for information on enabling extensions
471
471
472 $ cat > hgext/forest.py <<EOF
472 $ cat > hgext/forest.py <<EOF
473 > cmdtable = None
473 > cmdtable = None
474 > EOF
474 > EOF
475 $ hg --config extensions.path=./path.py help foo > /dev/null
475 $ hg --config extensions.path=./path.py help foo > /dev/null
476 warning: error finding commands in $TESTTMP/hgext/forest.py
476 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
477 hg: unknown command 'foo'
477 hg: unknown command 'foo'
478 warning: error finding commands in $TESTTMP/hgext/forest.py
478 warning: error finding commands in $TESTTMP/hgext/forest.py (glob)
479 [255]
479 [255]
@@ -1,111 +1,111 b''
1 Init repo1:
1 Init repo1:
2
2
3 $ hg init repo1
3 $ hg init repo1
4 $ cd repo1
4 $ cd repo1
5 $ echo "some text" > a
5 $ echo "some text" > a
6 $ hg add
6 $ hg add
7 adding a
7 adding a
8 $ hg ci -m first
8 $ hg ci -m first
9 $ cat .hg/store/fncache | sort
9 $ cat .hg/store/fncache | sort
10 data/a.i
10 data/a.i
11
11
12 Testing a.i/b:
12 Testing a.i/b:
13
13
14 $ mkdir a.i
14 $ mkdir a.i
15 $ echo "some other text" > a.i/b
15 $ echo "some other text" > a.i/b
16 $ hg add
16 $ hg add
17 adding a.i/b
17 adding a.i/b (glob)
18 $ hg ci -m second
18 $ hg ci -m second
19 $ cat .hg/store/fncache | sort
19 $ cat .hg/store/fncache | sort
20 data/a.i
20 data/a.i
21 data/a.i.hg/b.i
21 data/a.i.hg/b.i
22
22
23 Testing a.i.hg/c:
23 Testing a.i.hg/c:
24
24
25 $ mkdir a.i.hg
25 $ mkdir a.i.hg
26 $ echo "yet another text" > a.i.hg/c
26 $ echo "yet another text" > a.i.hg/c
27 $ hg add
27 $ hg add
28 adding a.i.hg/c
28 adding a.i.hg/c (glob)
29 $ hg ci -m third
29 $ hg ci -m third
30 $ cat .hg/store/fncache | sort
30 $ cat .hg/store/fncache | sort
31 data/a.i
31 data/a.i
32 data/a.i.hg.hg/c.i
32 data/a.i.hg.hg/c.i
33 data/a.i.hg/b.i
33 data/a.i.hg/b.i
34
34
35 Testing verify:
35 Testing verify:
36
36
37 $ hg verify
37 $ hg verify
38 checking changesets
38 checking changesets
39 checking manifests
39 checking manifests
40 crosschecking files in changesets and manifests
40 crosschecking files in changesets and manifests
41 checking files
41 checking files
42 3 files, 3 changesets, 3 total revisions
42 3 files, 3 changesets, 3 total revisions
43
43
44 $ rm .hg/store/fncache
44 $ rm .hg/store/fncache
45
45
46 $ hg verify
46 $ hg verify
47 checking changesets
47 checking changesets
48 checking manifests
48 checking manifests
49 crosschecking files in changesets and manifests
49 crosschecking files in changesets and manifests
50 checking files
50 checking files
51 data/a.i@0: missing revlog!
51 data/a.i@0: missing revlog!
52 data/a.i.hg/c.i@2: missing revlog!
52 data/a.i.hg/c.i@2: missing revlog!
53 data/a.i/b.i@1: missing revlog!
53 data/a.i/b.i@1: missing revlog!
54 3 files, 3 changesets, 3 total revisions
54 3 files, 3 changesets, 3 total revisions
55 3 integrity errors encountered!
55 3 integrity errors encountered!
56 (first damaged changeset appears to be 0)
56 (first damaged changeset appears to be 0)
57 [1]
57 [1]
58 $ cd ..
58 $ cd ..
59
59
60 Non store repo:
60 Non store repo:
61
61
62 $ hg --config format.usestore=False init foo
62 $ hg --config format.usestore=False init foo
63 $ cd foo
63 $ cd foo
64 $ mkdir tst.d
64 $ mkdir tst.d
65 $ echo foo > tst.d/foo
65 $ echo foo > tst.d/foo
66 $ hg ci -Amfoo
66 $ hg ci -Amfoo
67 adding tst.d/foo
67 adding tst.d/foo
68 $ find .hg | sort
68 $ find .hg | sort
69 .hg
69 .hg
70 .hg/00changelog.i
70 .hg/00changelog.i
71 .hg/00manifest.i
71 .hg/00manifest.i
72 .hg/data
72 .hg/data
73 .hg/data/tst.d.hg
73 .hg/data/tst.d.hg
74 .hg/data/tst.d.hg/foo.i
74 .hg/data/tst.d.hg/foo.i
75 .hg/dirstate
75 .hg/dirstate
76 .hg/last-message.txt
76 .hg/last-message.txt
77 .hg/requires
77 .hg/requires
78 .hg/undo
78 .hg/undo
79 .hg/undo.bookmarks
79 .hg/undo.bookmarks
80 .hg/undo.branch
80 .hg/undo.branch
81 .hg/undo.desc
81 .hg/undo.desc
82 .hg/undo.dirstate
82 .hg/undo.dirstate
83 $ cd ..
83 $ cd ..
84
84
85 Non fncache repo:
85 Non fncache repo:
86
86
87 $ hg --config format.usefncache=False init bar
87 $ hg --config format.usefncache=False init bar
88 $ cd bar
88 $ cd bar
89 $ mkdir tst.d
89 $ mkdir tst.d
90 $ echo foo > tst.d/Foo
90 $ echo foo > tst.d/Foo
91 $ hg ci -Amfoo
91 $ hg ci -Amfoo
92 adding tst.d/Foo
92 adding tst.d/Foo
93 $ find .hg | sort
93 $ find .hg | sort
94 .hg
94 .hg
95 .hg/00changelog.i
95 .hg/00changelog.i
96 .hg/dirstate
96 .hg/dirstate
97 .hg/last-message.txt
97 .hg/last-message.txt
98 .hg/requires
98 .hg/requires
99 .hg/store
99 .hg/store
100 .hg/store/00changelog.i
100 .hg/store/00changelog.i
101 .hg/store/00manifest.i
101 .hg/store/00manifest.i
102 .hg/store/data
102 .hg/store/data
103 .hg/store/data/tst.d.hg
103 .hg/store/data/tst.d.hg
104 .hg/store/data/tst.d.hg/_foo.i
104 .hg/store/data/tst.d.hg/_foo.i
105 .hg/store/undo
105 .hg/store/undo
106 .hg/undo.bookmarks
106 .hg/undo.bookmarks
107 .hg/undo.branch
107 .hg/undo.branch
108 .hg/undo.desc
108 .hg/undo.desc
109 .hg/undo.dirstate
109 .hg/undo.dirstate
110 $ cd ..
110 $ cd ..
111
111
@@ -1,124 +1,124 b''
1 $ hg init
1 $ hg init
2
2
3 Issue562: .hgignore requires newline at end:
3 Issue562: .hgignore requires newline at end:
4
4
5 $ touch foo
5 $ touch foo
6 $ touch bar
6 $ touch bar
7 $ touch baz
7 $ touch baz
8 $ cat > makeignore.py <<EOF
8 $ cat > makeignore.py <<EOF
9 > f = open(".hgignore", "w")
9 > f = open(".hgignore", "w")
10 > f.write("ignore\n")
10 > f.write("ignore\n")
11 > f.write("foo\n")
11 > f.write("foo\n")
12 > # No EOL here
12 > # No EOL here
13 > f.write("bar")
13 > f.write("bar")
14 > f.close()
14 > f.close()
15 > EOF
15 > EOF
16
16
17 $ python makeignore.py
17 $ python makeignore.py
18
18
19 Should display baz only:
19 Should display baz only:
20
20
21 $ hg status
21 $ hg status
22 ? baz
22 ? baz
23
23
24 $ rm foo bar baz .hgignore makeignore.py
24 $ rm foo bar baz .hgignore makeignore.py
25
25
26 $ touch a.o
26 $ touch a.o
27 $ touch a.c
27 $ touch a.c
28 $ touch syntax
28 $ touch syntax
29 $ mkdir dir
29 $ mkdir dir
30 $ touch dir/a.o
30 $ touch dir/a.o
31 $ touch dir/b.o
31 $ touch dir/b.o
32 $ touch dir/c.o
32 $ touch dir/c.o
33
33
34 $ hg add dir/a.o
34 $ hg add dir/a.o
35 $ hg commit -m 0
35 $ hg commit -m 0
36 $ hg add dir/b.o
36 $ hg add dir/b.o
37
37
38 $ hg status
38 $ hg status
39 A dir/b.o
39 A dir/b.o
40 ? a.c
40 ? a.c
41 ? a.o
41 ? a.o
42 ? dir/c.o
42 ? dir/c.o
43 ? syntax
43 ? syntax
44
44
45 $ echo "*.o" > .hgignore
45 $ echo "*.o" > .hgignore
46 $ hg status
46 $ hg status
47 abort: $TESTTMP/.hgignore: invalid pattern (relre): *.o
47 abort: $TESTTMP/.hgignore: invalid pattern (relre): *.o (glob)
48 [255]
48 [255]
49
49
50 $ echo ".*\.o" > .hgignore
50 $ echo ".*\.o" > .hgignore
51 $ hg status
51 $ hg status
52 A dir/b.o
52 A dir/b.o
53 ? .hgignore
53 ? .hgignore
54 ? a.c
54 ? a.c
55 ? syntax
55 ? syntax
56
56
57 Check it does not ignore the current directory '.':
57 Check it does not ignore the current directory '.':
58
58
59 $ echo "^\." > .hgignore
59 $ echo "^\." > .hgignore
60 $ hg status
60 $ hg status
61 A dir/b.o
61 A dir/b.o
62 ? a.c
62 ? a.c
63 ? a.o
63 ? a.o
64 ? dir/c.o
64 ? dir/c.o
65 ? syntax
65 ? syntax
66
66
67 $ echo "glob:**.o" > .hgignore
67 $ echo "glob:**.o" > .hgignore
68 $ hg status
68 $ hg status
69 A dir/b.o
69 A dir/b.o
70 ? .hgignore
70 ? .hgignore
71 ? a.c
71 ? a.c
72 ? syntax
72 ? syntax
73
73
74 $ echo "glob:*.o" > .hgignore
74 $ echo "glob:*.o" > .hgignore
75 $ hg status
75 $ hg status
76 A dir/b.o
76 A dir/b.o
77 ? .hgignore
77 ? .hgignore
78 ? a.c
78 ? a.c
79 ? syntax
79 ? syntax
80
80
81 $ echo "syntax: glob" > .hgignore
81 $ echo "syntax: glob" > .hgignore
82 $ echo "re:.*\.o" >> .hgignore
82 $ echo "re:.*\.o" >> .hgignore
83 $ hg status
83 $ hg status
84 A dir/b.o
84 A dir/b.o
85 ? .hgignore
85 ? .hgignore
86 ? a.c
86 ? a.c
87 ? syntax
87 ? syntax
88
88
89 $ echo "syntax: invalid" > .hgignore
89 $ echo "syntax: invalid" > .hgignore
90 $ hg status
90 $ hg status
91 $TESTTMP/.hgignore: ignoring invalid syntax 'invalid'
91 $TESTTMP/.hgignore: ignoring invalid syntax 'invalid' (glob)
92 A dir/b.o
92 A dir/b.o
93 ? .hgignore
93 ? .hgignore
94 ? a.c
94 ? a.c
95 ? a.o
95 ? a.o
96 ? dir/c.o
96 ? dir/c.o
97 ? syntax
97 ? syntax
98
98
99 $ echo "syntax: glob" > .hgignore
99 $ echo "syntax: glob" > .hgignore
100 $ echo "*.o" >> .hgignore
100 $ echo "*.o" >> .hgignore
101 $ hg status
101 $ hg status
102 A dir/b.o
102 A dir/b.o
103 ? .hgignore
103 ? .hgignore
104 ? a.c
104 ? a.c
105 ? syntax
105 ? syntax
106
106
107 $ echo "relglob:syntax*" > .hgignore
107 $ echo "relglob:syntax*" > .hgignore
108 $ hg status
108 $ hg status
109 A dir/b.o
109 A dir/b.o
110 ? .hgignore
110 ? .hgignore
111 ? a.c
111 ? a.c
112 ? a.o
112 ? a.o
113 ? dir/c.o
113 ? dir/c.o
114
114
115 $ echo "relglob:*" > .hgignore
115 $ echo "relglob:*" > .hgignore
116 $ hg status
116 $ hg status
117 A dir/b.o
117 A dir/b.o
118
118
119 $ cd dir
119 $ cd dir
120 $ hg status .
120 $ hg status .
121 A b.o
121 A b.o
122
122
123 $ hg debugignore
123 $ hg debugignore
124 (?:(?:|.*/)[^/]*(?:/|$))
124 (?:(?:|.*/)[^/]*(?:/|$))
@@ -1,195 +1,195 b''
1 Use hgrc within $TESTTMP
1 Use hgrc within $TESTTMP
2
2
3 $ HGRCPATH=`pwd`/hgrc
3 $ HGRCPATH=`pwd`/hgrc
4 $ export HGRCPATH
4 $ export HGRCPATH
5
5
6 Use an alternate var for scribbling on hgrc to keep check-code from
6 Use an alternate var for scribbling on hgrc to keep check-code from
7 complaining about the important settings we may be overwriting:
7 complaining about the important settings we may be overwriting:
8
8
9 $ HGRC=`pwd`/hgrc
9 $ HGRC=`pwd`/hgrc
10 $ export HGRC
10 $ export HGRC
11
11
12 Basic syntax error
12 Basic syntax error
13
13
14 $ echo "invalid" > $HGRC
14 $ echo "invalid" > $HGRC
15 $ hg version
15 $ hg version
16 hg: parse error at $TESTTMP/hgrc:1: invalid
16 hg: parse error at $TESTTMP/hgrc:1: invalid
17 [255]
17 [255]
18 $ echo "" > $HGRC
18 $ echo "" > $HGRC
19
19
20 Issue1199: Can't use '%' in hgrc (eg url encoded username)
20 Issue1199: Can't use '%' in hgrc (eg url encoded username)
21
21
22 $ hg init "foo%bar"
22 $ hg init "foo%bar"
23 $ hg clone "foo%bar" foobar
23 $ hg clone "foo%bar" foobar
24 updating to branch default
24 updating to branch default
25 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
25 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 $ cd foobar
26 $ cd foobar
27 $ cat .hg/hgrc
27 $ cat .hg/hgrc
28 [paths]
28 [paths]
29 default = $TESTTMP/foo%bar
29 default = $TESTTMP/foo%bar (glob)
30 $ hg paths
30 $ hg paths
31 default = $TESTTMP/foo%bar
31 default = $TESTTMP/foo%bar (glob)
32 $ hg showconfig
32 $ hg showconfig
33 bundle.mainreporoot=$TESTTMP/foobar
33 bundle.mainreporoot=$TESTTMP/foobar (glob)
34 paths.default=$TESTTMP/foo%bar
34 paths.default=$TESTTMP/foo%bar (glob)
35 $ cd ..
35 $ cd ..
36
36
37 issue1829: wrong indentation
37 issue1829: wrong indentation
38
38
39 $ echo '[foo]' > $HGRC
39 $ echo '[foo]' > $HGRC
40 $ echo ' x = y' >> $HGRC
40 $ echo ' x = y' >> $HGRC
41 $ hg version
41 $ hg version
42 hg: parse error at $TESTTMP/hgrc:2: x = y
42 hg: parse error at $TESTTMP/hgrc:2: x = y
43 [255]
43 [255]
44
44
45 $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \
45 $ python -c "print '[foo]\nbar = a\n b\n c \n de\n fg \nbaz = bif cb \n'" \
46 > > $HGRC
46 > > $HGRC
47 $ hg showconfig foo
47 $ hg showconfig foo
48 foo.bar=a\nb\nc\nde\nfg
48 foo.bar=a\nb\nc\nde\nfg
49 foo.baz=bif cb
49 foo.baz=bif cb
50
50
51 $ FAKEPATH=/path/to/nowhere
51 $ FAKEPATH=/path/to/nowhere
52 $ export FAKEPATH
52 $ export FAKEPATH
53 $ echo '%include $FAKEPATH/no-such-file' > $HGRC
53 $ echo '%include $FAKEPATH/no-such-file' > $HGRC
54 $ hg version
54 $ hg version
55 Mercurial Distributed SCM (version *) (glob)
55 Mercurial Distributed SCM (version *) (glob)
56 (see http://mercurial.selenic.com for more information)
56 (see http://mercurial.selenic.com for more information)
57
57
58 Copyright (C) 2005-2011 Matt Mackall and others
58 Copyright (C) 2005-2011 Matt Mackall and others
59 This is free software; see the source for copying conditions. There is NO
59 This is free software; see the source for copying conditions. There is NO
60 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
60 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
61 $ unset FAKEPATH
61 $ unset FAKEPATH
62
62
63 make sure global options given on the cmdline take precedence
63 make sure global options given on the cmdline take precedence
64
64
65 $ hg showconfig --config ui.verbose=True --quiet
65 $ hg showconfig --config ui.verbose=True --quiet
66 ui.verbose=False
66 ui.verbose=False
67 ui.debug=False
67 ui.debug=False
68 ui.quiet=True
68 ui.quiet=True
69
69
70 $ touch foobar/untracked
70 $ touch foobar/untracked
71 $ cat >> foobar/.hg/hgrc <<EOF
71 $ cat >> foobar/.hg/hgrc <<EOF
72 > [ui]
72 > [ui]
73 > verbose=True
73 > verbose=True
74 > EOF
74 > EOF
75 $ hg -R foobar st -q
75 $ hg -R foobar st -q
76
76
77 username expansion
77 username expansion
78
78
79 $ olduser=$HGUSER
79 $ olduser=$HGUSER
80 $ unset HGUSER
80 $ unset HGUSER
81
81
82 $ FAKEUSER='John Doe'
82 $ FAKEUSER='John Doe'
83 $ export FAKEUSER
83 $ export FAKEUSER
84 $ echo '[ui]' > $HGRC
84 $ echo '[ui]' > $HGRC
85 $ echo 'username = $FAKEUSER' >> $HGRC
85 $ echo 'username = $FAKEUSER' >> $HGRC
86
86
87 $ hg init usertest
87 $ hg init usertest
88 $ cd usertest
88 $ cd usertest
89 $ touch bar
89 $ touch bar
90 $ hg commit --addremove --quiet -m "added bar"
90 $ hg commit --addremove --quiet -m "added bar"
91 $ hg log --template "{author}\n"
91 $ hg log --template "{author}\n"
92 John Doe
92 John Doe
93 $ cd ..
93 $ cd ..
94
94
95 $ hg showconfig
95 $ hg showconfig
96 ui.username=$FAKEUSER
96 ui.username=$FAKEUSER
97
97
98 $ unset FAKEUSER
98 $ unset FAKEUSER
99 $ HGUSER=$olduser
99 $ HGUSER=$olduser
100 $ export HGUSER
100 $ export HGUSER
101
101
102 showconfig with multiple arguments
102 showconfig with multiple arguments
103
103
104 $ echo "[alias]" > $HGRC
104 $ echo "[alias]" > $HGRC
105 $ echo "log = log -g" >> $HGRC
105 $ echo "log = log -g" >> $HGRC
106 $ echo "[defaults]" >> $HGRC
106 $ echo "[defaults]" >> $HGRC
107 $ echo "identify = -n" >> $HGRC
107 $ echo "identify = -n" >> $HGRC
108 $ hg showconfig alias defaults
108 $ hg showconfig alias defaults
109 alias.log=log -g
109 alias.log=log -g
110 defaults.identify=-n
110 defaults.identify=-n
111 $ hg showconfig alias defaults.identify
111 $ hg showconfig alias defaults.identify
112 abort: only one config item permitted
112 abort: only one config item permitted
113 [255]
113 [255]
114 $ hg showconfig alias.log defaults.identify
114 $ hg showconfig alias.log defaults.identify
115 abort: only one config item permitted
115 abort: only one config item permitted
116 [255]
116 [255]
117
117
118 HGPLAIN
118 HGPLAIN
119
119
120 $ cd ..
120 $ cd ..
121 $ p=`pwd`
121 $ p=`pwd`
122 $ echo "[ui]" > $HGRC
122 $ echo "[ui]" > $HGRC
123 $ echo "debug=true" >> $HGRC
123 $ echo "debug=true" >> $HGRC
124 $ echo "fallbackencoding=ASCII" >> $HGRC
124 $ echo "fallbackencoding=ASCII" >> $HGRC
125 $ echo "quiet=true" >> $HGRC
125 $ echo "quiet=true" >> $HGRC
126 $ echo "slash=true" >> $HGRC
126 $ echo "slash=true" >> $HGRC
127 $ echo "traceback=true" >> $HGRC
127 $ echo "traceback=true" >> $HGRC
128 $ echo "verbose=true" >> $HGRC
128 $ echo "verbose=true" >> $HGRC
129 $ echo "style=~/.hgstyle" >> $HGRC
129 $ echo "style=~/.hgstyle" >> $HGRC
130 $ echo "logtemplate={node}" >> $HGRC
130 $ echo "logtemplate={node}" >> $HGRC
131 $ echo "[defaults]" >> $HGRC
131 $ echo "[defaults]" >> $HGRC
132 $ echo "identify=-n" >> $HGRC
132 $ echo "identify=-n" >> $HGRC
133 $ echo "[alias]" >> $HGRC
133 $ echo "[alias]" >> $HGRC
134 $ echo "log=log -g" >> $HGRC
134 $ echo "log=log -g" >> $HGRC
135
135
136 customized hgrc
136 customized hgrc
137
137
138 $ hg showconfig
138 $ hg showconfig
139 read config from: $TESTTMP/hgrc
139 read config from: $TESTTMP/hgrc
140 $TESTTMP/hgrc:13: alias.log=log -g
140 $TESTTMP/hgrc:13: alias.log=log -g
141 $TESTTMP/hgrc:11: defaults.identify=-n
141 $TESTTMP/hgrc:11: defaults.identify=-n
142 $TESTTMP/hgrc:2: ui.debug=true
142 $TESTTMP/hgrc:2: ui.debug=true
143 $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII
143 $TESTTMP/hgrc:3: ui.fallbackencoding=ASCII
144 $TESTTMP/hgrc:4: ui.quiet=true
144 $TESTTMP/hgrc:4: ui.quiet=true
145 $TESTTMP/hgrc:5: ui.slash=true
145 $TESTTMP/hgrc:5: ui.slash=true
146 $TESTTMP/hgrc:6: ui.traceback=true
146 $TESTTMP/hgrc:6: ui.traceback=true
147 $TESTTMP/hgrc:7: ui.verbose=true
147 $TESTTMP/hgrc:7: ui.verbose=true
148 $TESTTMP/hgrc:8: ui.style=~/.hgstyle
148 $TESTTMP/hgrc:8: ui.style=~/.hgstyle
149 $TESTTMP/hgrc:9: ui.logtemplate={node}
149 $TESTTMP/hgrc:9: ui.logtemplate={node}
150
150
151 plain hgrc
151 plain hgrc
152
152
153 $ HGPLAIN=; export HGPLAIN
153 $ HGPLAIN=; export HGPLAIN
154 $ hg showconfig --config ui.traceback=True --debug
154 $ hg showconfig --config ui.traceback=True --debug
155 read config from: $TESTTMP/hgrc
155 read config from: $TESTTMP/hgrc
156 none: ui.traceback=True
156 none: ui.traceback=True
157 none: ui.verbose=False
157 none: ui.verbose=False
158 none: ui.debug=True
158 none: ui.debug=True
159 none: ui.quiet=False
159 none: ui.quiet=False
160
160
161 plain mode with exceptions
161 plain mode with exceptions
162
162
163 $ cat > plain.py <<EOF
163 $ cat > plain.py <<EOF
164 > def uisetup(ui):
164 > def uisetup(ui):
165 > ui.write('plain: %r\n' % ui.plain())
165 > ui.write('plain: %r\n' % ui.plain())
166 > EOF
166 > EOF
167 $ echo "[extensions]" >> $HGRC
167 $ echo "[extensions]" >> $HGRC
168 $ echo "plain=./plain.py" >> $HGRC
168 $ echo "plain=./plain.py" >> $HGRC
169 $ HGPLAINEXCEPT=; export HGPLAINEXCEPT
169 $ HGPLAINEXCEPT=; export HGPLAINEXCEPT
170 $ hg showconfig --config ui.traceback=True --debug
170 $ hg showconfig --config ui.traceback=True --debug
171 plain: True
171 plain: True
172 read config from: $TESTTMP/hgrc
172 read config from: $TESTTMP/hgrc
173 $TESTTMP/hgrc:15: extensions.plain=./plain.py
173 $TESTTMP/hgrc:15: extensions.plain=./plain.py
174 none: ui.traceback=True
174 none: ui.traceback=True
175 none: ui.verbose=False
175 none: ui.verbose=False
176 none: ui.debug=True
176 none: ui.debug=True
177 none: ui.quiet=False
177 none: ui.quiet=False
178 $ unset HGPLAIN
178 $ unset HGPLAIN
179 $ hg showconfig --config ui.traceback=True --debug
179 $ hg showconfig --config ui.traceback=True --debug
180 plain: True
180 plain: True
181 read config from: $TESTTMP/hgrc
181 read config from: $TESTTMP/hgrc
182 $TESTTMP/hgrc:15: extensions.plain=./plain.py
182 $TESTTMP/hgrc:15: extensions.plain=./plain.py
183 none: ui.traceback=True
183 none: ui.traceback=True
184 none: ui.verbose=False
184 none: ui.verbose=False
185 none: ui.debug=True
185 none: ui.debug=True
186 none: ui.quiet=False
186 none: ui.quiet=False
187 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
187 $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
188 $ hg showconfig --config ui.traceback=True --debug
188 $ hg showconfig --config ui.traceback=True --debug
189 plain: True
189 plain: True
190 read config from: $TESTTMP/hgrc
190 read config from: $TESTTMP/hgrc
191 $TESTTMP/hgrc:15: extensions.plain=./plain.py
191 $TESTTMP/hgrc:15: extensions.plain=./plain.py
192 none: ui.traceback=True
192 none: ui.traceback=True
193 none: ui.verbose=False
193 none: ui.verbose=False
194 none: ui.debug=True
194 none: ui.debug=True
195 none: ui.quiet=False
195 none: ui.quiet=False
@@ -1,20 +1,20 b''
1 hg debuginstall
1 hg debuginstall
2 $ hg debuginstall
2 $ hg debuginstall
3 Checking encoding (ascii)...
3 Checking encoding (ascii)...
4 Checking installed modules (*/mercurial)... (glob)
4 Checking installed modules (*mercurial)... (glob)
5 Checking templates (*/mercurial/templates)... (glob)
5 Checking templates (*mercurial?templates)... (glob)
6 Checking commit editor...
6 Checking commit editor...
7 Checking username...
7 Checking username...
8 No problems detected
8 No problems detected
9
9
10 hg debuginstall with no username
10 hg debuginstall with no username
11 $ HGUSER= hg debuginstall
11 $ HGUSER= hg debuginstall
12 Checking encoding (ascii)...
12 Checking encoding (ascii)...
13 Checking installed modules (*/mercurial)... (glob)
13 Checking installed modules (*mercurial)... (glob)
14 Checking templates (*/mercurial/templates)... (glob)
14 Checking templates (*mercurial?templates)... (glob)
15 Checking commit editor...
15 Checking commit editor...
16 Checking username...
16 Checking username...
17 no username supplied (see "hg help config")
17 no username supplied (see "hg help config")
18 (specify a username in your configuration file)
18 (specify a username in your configuration file)
19 1 problems detected, please check your install!
19 1 problems detected, please check your install!
20 [1]
20 [1]
@@ -1,25 +1,25 b''
1 http://mercurial.selenic.com/bts/issue1089
1 http://mercurial.selenic.com/bts/issue1089
2
2
3 $ hg init
3 $ hg init
4 $ mkdir a
4 $ mkdir a
5 $ echo a > a/b
5 $ echo a > a/b
6 $ hg ci -Am m
6 $ hg ci -Am m
7 adding a/b
7 adding a/b
8
8
9 $ hg rm a
9 $ hg rm a
10 removing a/b
10 removing a/b (glob)
11 $ hg ci -m m a
11 $ hg ci -m m a
12
12
13 $ mkdir a b
13 $ mkdir a b
14 $ echo a > a/b
14 $ echo a > a/b
15 $ hg ci -Am m
15 $ hg ci -Am m
16 adding a/b
16 adding a/b
17
17
18 $ hg rm a
18 $ hg rm a
19 removing a/b
19 removing a/b (glob)
20 $ cd b
20 $ cd b
21
21
22 Relative delete:
22 Relative delete:
23
23
24 $ hg ci -m m ../a
24 $ hg ci -m m ../a
25
25
@@ -1,41 +1,41 b''
1 http://mercurial.selenic.com/bts/issue1502
1 http://mercurial.selenic.com/bts/issue1502
2
2
3 Initialize repository
3 Initialize repository
4
4
5 $ hg init foo
5 $ hg init foo
6 $ touch foo/a && hg -R foo commit -A -m "added a"
6 $ touch foo/a && hg -R foo commit -A -m "added a"
7 adding a
7 adding a
8
8
9 $ hg clone foo foo1
9 $ hg clone foo foo1
10 updating to branch default
10 updating to branch default
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
11 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
12
12
13 $ echo "bar" > foo1/a && hg -R foo1 commit -m "edit a in foo1"
13 $ echo "bar" > foo1/a && hg -R foo1 commit -m "edit a in foo1"
14 $ echo "hi" > foo/a && hg -R foo commit -m "edited a foo"
14 $ echo "hi" > foo/a && hg -R foo commit -m "edited a foo"
15 $ hg -R foo1 pull -u
15 $ hg -R foo1 pull -u
16 pulling from $TESTTMP/foo
16 pulling from $TESTTMP/foo (glob)
17 searching for changes
17 searching for changes
18 adding changesets
18 adding changesets
19 adding manifests
19 adding manifests
20 adding file changes
20 adding file changes
21 added 1 changesets with 1 changes to 1 files (+1 heads)
21 added 1 changesets with 1 changes to 1 files (+1 heads)
22 not updating: crosses branches (merge branches or update --check to force update)
22 not updating: crosses branches (merge branches or update --check to force update)
23
23
24 $ hg -R foo1 book branchy
24 $ hg -R foo1 book branchy
25 $ hg -R foo1 book
25 $ hg -R foo1 book
26 * branchy 1:e3e522925eff
26 * branchy 1:e3e522925eff
27
27
28 Pull. Bookmark should not jump to new head.
28 Pull. Bookmark should not jump to new head.
29
29
30 $ echo "there" >> foo/a && hg -R foo commit -m "edited a again"
30 $ echo "there" >> foo/a && hg -R foo commit -m "edited a again"
31 $ hg -R foo1 pull
31 $ hg -R foo1 pull
32 pulling from $TESTTMP/foo
32 pulling from $TESTTMP/foo (glob)
33 searching for changes
33 searching for changes
34 adding changesets
34 adding changesets
35 adding manifests
35 adding manifests
36 adding file changes
36 adding file changes
37 added 1 changesets with 1 changes to 1 files
37 added 1 changesets with 1 changes to 1 files
38 (run 'hg update' to get a working copy)
38 (run 'hg update' to get a working copy)
39
39
40 $ hg -R foo1 book
40 $ hg -R foo1 book
41 * branchy 1:e3e522925eff
41 * branchy 1:e3e522925eff
@@ -1,34 +1,34 b''
1 http://mercurial.selenic.com/bts/issue612
1 http://mercurial.selenic.com/bts/issue612
2
2
3 $ hg init
3 $ hg init
4 $ mkdir src
4 $ mkdir src
5 $ echo a > src/a.c
5 $ echo a > src/a.c
6 $ hg ci -Ama
6 $ hg ci -Ama
7 adding src/a.c
7 adding src/a.c
8
8
9 $ hg mv src source
9 $ hg mv src source
10 moving src/a.c to source/a.c
10 moving src/a.c to source/a.c (glob)
11
11
12 $ hg ci -Ammove
12 $ hg ci -Ammove
13
13
14 $ hg co -C 0
14 $ hg co -C 0
15 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
16
16
17 $ echo new > src/a.c
17 $ echo new > src/a.c
18 $ echo compiled > src/a.o
18 $ echo compiled > src/a.o
19 $ hg ci -mupdate
19 $ hg ci -mupdate
20 created new head
20 created new head
21
21
22 $ hg status
22 $ hg status
23 ? src/a.o
23 ? src/a.o
24
24
25 $ hg merge
25 $ hg merge
26 merging src/a.c and source/a.c to source/a.c
26 merging src/a.c and source/a.c to source/a.c
27 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
28 (branch merge, don't forget to commit)
28 (branch merge, don't forget to commit)
29
29
30 $ hg status
30 $ hg status
31 M source/a.c
31 M source/a.c
32 R src/a.c
32 R src/a.c
33 ? source/a.o
33 ? source/a.o
34
34
@@ -1,145 +1,145 b''
1 http://mercurial.selenic.com/bts/issue660 and:
1 http://mercurial.selenic.com/bts/issue660 and:
2 http://mercurial.selenic.com/bts/issue322
2 http://mercurial.selenic.com/bts/issue322
3
3
4 $ hg init
4 $ hg init
5 $ echo a > a
5 $ echo a > a
6 $ mkdir b
6 $ mkdir b
7 $ echo b > b/b
7 $ echo b > b/b
8 $ hg commit -A -m "a is file, b is dir"
8 $ hg commit -A -m "a is file, b is dir"
9 adding a
9 adding a
10 adding b/b
10 adding b/b
11
11
12 File replaced with directory:
12 File replaced with directory:
13
13
14 $ rm a
14 $ rm a
15 $ mkdir a
15 $ mkdir a
16 $ echo a > a/a
16 $ echo a > a/a
17
17
18 Should fail - would corrupt dirstate:
18 Should fail - would corrupt dirstate:
19
19
20 $ hg add a/a
20 $ hg add a/a
21 abort: file 'a' in dirstate clashes with 'a/a'
21 abort: file 'a' in dirstate clashes with 'a/a'
22 [255]
22 [255]
23
23
24 Removing shadow:
24 Removing shadow:
25
25
26 $ hg rm --after a
26 $ hg rm --after a
27
27
28 Should succeed - shadow removed:
28 Should succeed - shadow removed:
29
29
30 $ hg add a/a
30 $ hg add a/a
31
31
32 Directory replaced with file:
32 Directory replaced with file:
33
33
34 $ rm -r b
34 $ rm -r b
35 $ echo b > b
35 $ echo b > b
36
36
37 Should fail - would corrupt dirstate:
37 Should fail - would corrupt dirstate:
38
38
39 $ hg add b
39 $ hg add b
40 abort: directory 'b' already in dirstate
40 abort: directory 'b' already in dirstate
41 [255]
41 [255]
42
42
43 Removing shadow:
43 Removing shadow:
44
44
45 $ hg rm --after b/b
45 $ hg rm --after b/b
46
46
47 Should succeed - shadow removed:
47 Should succeed - shadow removed:
48
48
49 $ hg add b
49 $ hg add b
50
50
51 Look what we got:
51 Look what we got:
52
52
53 $ hg st
53 $ hg st
54 A a/a
54 A a/a
55 A b
55 A b
56 R a
56 R a
57 R b/b
57 R b/b
58
58
59 Revert reintroducing shadow - should fail:
59 Revert reintroducing shadow - should fail:
60
60
61 $ rm -r a b
61 $ rm -r a b
62 $ hg revert b/b
62 $ hg revert b/b
63 abort: file 'b' in dirstate clashes with 'b/b'
63 abort: file 'b' in dirstate clashes with 'b/b'
64 [255]
64 [255]
65
65
66 Revert all - should succeed:
66 Revert all - should succeed:
67
67
68 $ hg revert --all
68 $ hg revert --all
69 undeleting a
69 undeleting a
70 forgetting a/a
70 forgetting a/a (glob)
71 forgetting b
71 forgetting b
72 undeleting b/b
72 undeleting b/b (glob)
73
73
74 $ hg st
74 $ hg st
75
75
76 addremove:
76 addremove:
77
77
78 $ rm -r a b
78 $ rm -r a b
79 $ mkdir a
79 $ mkdir a
80 $ echo a > a/a
80 $ echo a > a/a
81 $ echo b > b
81 $ echo b > b
82
82
83 $ hg addremove -s 0
83 $ hg addremove -s 0
84 removing a
84 removing a
85 adding a/a
85 adding a/a
86 adding b
86 adding b
87 removing b/b
87 removing b/b
88
88
89 $ hg st
89 $ hg st
90 A a/a
90 A a/a
91 A b
91 A b
92 R a
92 R a
93 R b/b
93 R b/b
94
94
95 commit:
95 commit:
96
96
97 $ hg ci -A -m "a is dir, b is file"
97 $ hg ci -A -m "a is dir, b is file"
98 $ hg st --all
98 $ hg st --all
99 C a/a
99 C a/a
100 C b
100 C b
101
101
102 Long directory replaced with file:
102 Long directory replaced with file:
103
103
104 $ mkdir d
104 $ mkdir d
105 $ mkdir d/d
105 $ mkdir d/d
106 $ echo d > d/d/d
106 $ echo d > d/d/d
107 $ hg commit -A -m "d is long directory"
107 $ hg commit -A -m "d is long directory"
108 adding d/d/d
108 adding d/d/d
109
109
110 $ rm -r d
110 $ rm -r d
111 $ echo d > d
111 $ echo d > d
112
112
113 Should fail - would corrupt dirstate:
113 Should fail - would corrupt dirstate:
114
114
115 $ hg add d
115 $ hg add d
116 abort: directory 'd' already in dirstate
116 abort: directory 'd' already in dirstate
117 [255]
117 [255]
118
118
119 Removing shadow:
119 Removing shadow:
120
120
121 $ hg rm --after d/d/d
121 $ hg rm --after d/d/d
122
122
123 Should succeed - shadow removed:
123 Should succeed - shadow removed:
124
124
125 $ hg add d
125 $ hg add d
126 $ hg ci -md
126 $ hg ci -md
127
127
128 Update should work at least with clean working directory:
128 Update should work at least with clean working directory:
129
129
130 $ rm -r a b d
130 $ rm -r a b d
131 $ hg up -r 0
131 $ hg up -r 0
132 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
133
133
134 $ hg st --all
134 $ hg st --all
135 C a
135 C a
136 C b/b
136 C b/b
137
137
138 $ rm -r a b
138 $ rm -r a b
139 $ hg up -r 1
139 $ hg up -r 1
140 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
141
141
142 $ hg st --all
142 $ hg st --all
143 C a/a
143 C a/a
144 C b
144 C b
145
145
@@ -1,1085 +1,1085 b''
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > keyword =
5 > keyword =
6 > mq =
6 > mq =
7 > notify =
7 > notify =
8 > record =
8 > record =
9 > transplant =
9 > transplant =
10 > [ui]
10 > [ui]
11 > interactive = true
11 > interactive = true
12 > EOF
12 > EOF
13
13
14 Run kwdemo before [keyword] files are set up
14 Run kwdemo before [keyword] files are set up
15 as it would succeed without uisetup otherwise
15 as it would succeed without uisetup otherwise
16
16
17 $ hg --quiet kwdemo
17 $ hg --quiet kwdemo
18 [extensions]
18 [extensions]
19 keyword =
19 keyword =
20 [keyword]
20 [keyword]
21 demo.txt =
21 demo.txt =
22 [keywordset]
22 [keywordset]
23 svn = False
23 svn = False
24 [keywordmaps]
24 [keywordmaps]
25 Author = {author|user}
25 Author = {author|user}
26 Date = {date|utcdate}
26 Date = {date|utcdate}
27 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
27 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
28 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
28 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
29 RCSFile = {file|basename},v
29 RCSFile = {file|basename},v
30 RCSfile = {file|basename},v
30 RCSfile = {file|basename},v
31 Revision = {node|short}
31 Revision = {node|short}
32 Source = {root}/{file},v
32 Source = {root}/{file},v
33 $Author: test $
33 $Author: test $
34 $Date: ????/??/?? ??:??:?? $ (glob)
34 $Date: ????/??/?? ??:??:?? $ (glob)
35 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
35 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $RCSFile: demo.txt,v $
37 $RCSFile: demo.txt,v $
38 $RCSfile: demo.txt,v $
38 $RCSfile: demo.txt,v $
39 $Revision: ???????????? $ (glob)
39 $Revision: ???????????? $ (glob)
40 $Source: */demo.txt,v $ (glob)
40 $Source: */demo.txt,v $ (glob)
41
41
42 $ hg --quiet kwdemo "Branch = {branches}"
42 $ hg --quiet kwdemo "Branch = {branches}"
43 [extensions]
43 [extensions]
44 keyword =
44 keyword =
45 [keyword]
45 [keyword]
46 demo.txt =
46 demo.txt =
47 [keywordset]
47 [keywordset]
48 svn = False
48 svn = False
49 [keywordmaps]
49 [keywordmaps]
50 Branch = {branches}
50 Branch = {branches}
51 $Branch: demobranch $
51 $Branch: demobranch $
52
52
53 $ cat <<EOF >> $HGRCPATH
53 $ cat <<EOF >> $HGRCPATH
54 > [keyword]
54 > [keyword]
55 > ** =
55 > ** =
56 > b = ignore
56 > b = ignore
57 > i = ignore
57 > i = ignore
58 > [hooks]
58 > [hooks]
59 > EOF
59 > EOF
60 $ cp $HGRCPATH $HGRCPATH.nohooks
60 $ cp $HGRCPATH $HGRCPATH.nohooks
61 > cat <<EOF >> $HGRCPATH
61 > cat <<EOF >> $HGRCPATH
62 > commit=
62 > commit=
63 > commit.test=cp a hooktest
63 > commit.test=cp a hooktest
64 > EOF
64 > EOF
65
65
66 $ hg init Test-bndl
66 $ hg init Test-bndl
67 $ cd Test-bndl
67 $ cd Test-bndl
68
68
69 kwshrink should exit silently in empty/invalid repo
69 kwshrink should exit silently in empty/invalid repo
70
70
71 $ hg kwshrink
71 $ hg kwshrink
72
72
73 Symlinks cannot be created on Windows.
73 Symlinks cannot be created on Windows.
74 A bundle to test this was made with:
74 A bundle to test this was made with:
75 hg init t
75 hg init t
76 cd t
76 cd t
77 echo a > a
77 echo a > a
78 ln -s a sym
78 ln -s a sym
79 hg add sym
79 hg add sym
80 hg ci -m addsym -u mercurial
80 hg ci -m addsym -u mercurial
81 hg bundle --base null ../test-keyword.hg
81 hg bundle --base null ../test-keyword.hg
82
82
83 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
83 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
84 pulling from *test-keyword.hg (glob)
84 pulling from *test-keyword.hg (glob)
85 requesting all changes
85 requesting all changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 1 changesets with 1 changes to 1 files
89 added 1 changesets with 1 changes to 1 files
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 $ echo 'expand $Id$' > a
92 $ echo 'expand $Id$' > a
93 $ echo 'do not process $Id:' >> a
93 $ echo 'do not process $Id:' >> a
94 $ echo 'xxx $' >> a
94 $ echo 'xxx $' >> a
95 $ echo 'ignore $Id$' > b
95 $ echo 'ignore $Id$' > b
96
96
97 Output files as they were created
97 Output files as they were created
98
98
99 $ cat a b
99 $ cat a b
100 expand $Id$
100 expand $Id$
101 do not process $Id:
101 do not process $Id:
102 xxx $
102 xxx $
103 ignore $Id$
103 ignore $Id$
104
104
105 no kwfiles
105 no kwfiles
106
106
107 $ hg kwfiles
107 $ hg kwfiles
108
108
109 untracked candidates
109 untracked candidates
110
110
111 $ hg -v kwfiles --unknown
111 $ hg -v kwfiles --unknown
112 k a
112 k a
113
113
114 Add files and check status
114 Add files and check status
115
115
116 $ hg addremove
116 $ hg addremove
117 adding a
117 adding a
118 adding b
118 adding b
119 $ hg status
119 $ hg status
120 A a
120 A a
121 A b
121 A b
122
122
123
123
124 Default keyword expansion including commit hook
124 Default keyword expansion including commit hook
125 Interrupted commit should not change state or run commit hook
125 Interrupted commit should not change state or run commit hook
126
126
127 $ hg --debug commit
127 $ hg --debug commit
128 abort: empty commit message
128 abort: empty commit message
129 [255]
129 [255]
130 $ hg status
130 $ hg status
131 A a
131 A a
132 A b
132 A b
133
133
134 Commit with several checks
134 Commit with several checks
135
135
136 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
136 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
137 a
137 a
138 b
138 b
139 overwriting a expanding keywords
139 overwriting a expanding keywords
140 running hook commit.test: cp a hooktest
140 running hook commit.test: cp a hooktest
141 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
141 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
142 $ hg status
142 $ hg status
143 ? hooktest
143 ? hooktest
144 $ hg debugrebuildstate
144 $ hg debugrebuildstate
145 $ hg --quiet identify
145 $ hg --quiet identify
146 ef63ca68695b
146 ef63ca68695b
147
147
148 cat files in working directory with keywords expanded
148 cat files in working directory with keywords expanded
149
149
150 $ cat a b
150 $ cat a b
151 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
151 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
152 do not process $Id:
152 do not process $Id:
153 xxx $
153 xxx $
154 ignore $Id$
154 ignore $Id$
155
155
156 hg cat files and symlink, no expansion
156 hg cat files and symlink, no expansion
157
157
158 $ hg cat sym a b && echo
158 $ hg cat sym a b && echo
159 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
159 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
160 do not process $Id:
160 do not process $Id:
161 xxx $
161 xxx $
162 ignore $Id$
162 ignore $Id$
163 a
163 a
164
164
165 Test hook execution
165 Test hook execution
166
166
167 $ diff a hooktest
167 $ diff a hooktest
168
168
169 $ cp $HGRCPATH.nohooks $HGRCPATH
169 $ cp $HGRCPATH.nohooks $HGRCPATH
170 $ rm hooktest
170 $ rm hooktest
171
171
172 bundle
172 bundle
173
173
174 $ hg bundle --base null ../kw.hg
174 $ hg bundle --base null ../kw.hg
175 2 changesets found
175 2 changesets found
176 $ cd ..
176 $ cd ..
177 $ hg init Test
177 $ hg init Test
178 $ cd Test
178 $ cd Test
179
179
180 Notify on pull to check whether keywords stay as is in email
180 Notify on pull to check whether keywords stay as is in email
181 ie. if patch.diff wrapper acts as it should
181 ie. if patch.diff wrapper acts as it should
182
182
183 $ cat <<EOF >> $HGRCPATH
183 $ cat <<EOF >> $HGRCPATH
184 > [hooks]
184 > [hooks]
185 > incoming.notify = python:hgext.notify.hook
185 > incoming.notify = python:hgext.notify.hook
186 > [notify]
186 > [notify]
187 > sources = pull
187 > sources = pull
188 > diffstat = False
188 > diffstat = False
189 > maxsubject = 15
189 > maxsubject = 15
190 > [reposubs]
190 > [reposubs]
191 > * = Test
191 > * = Test
192 > EOF
192 > EOF
193
193
194 Pull from bundle and trigger notify
194 Pull from bundle and trigger notify
195
195
196 $ hg pull -u ../kw.hg
196 $ hg pull -u ../kw.hg
197 pulling from ../kw.hg
197 pulling from ../kw.hg
198 requesting all changes
198 requesting all changes
199 adding changesets
199 adding changesets
200 adding manifests
200 adding manifests
201 adding file changes
201 adding file changes
202 added 2 changesets with 3 changes to 3 files
202 added 2 changesets with 3 changes to 3 files
203 Content-Type: text/plain; charset="us-ascii"
203 Content-Type: text/plain; charset="us-ascii"
204 MIME-Version: 1.0
204 MIME-Version: 1.0
205 Content-Transfer-Encoding: 7bit
205 Content-Transfer-Encoding: 7bit
206 Date: * (glob)
206 Date: * (glob)
207 Subject: changeset in...
207 Subject: changeset in...
208 From: mercurial
208 From: mercurial
209 X-Hg-Notification: changeset a2392c293916
209 X-Hg-Notification: changeset a2392c293916
210 Message-Id: <hg.a2392c293916*> (glob)
210 Message-Id: <hg.a2392c293916*> (glob)
211 To: Test
211 To: Test
212
212
213 changeset a2392c293916 in $TESTTMP/Test
213 changeset a2392c293916 in $TESTTMP/Test (glob)
214 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
214 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
215 description:
215 description:
216 addsym
216 addsym
217
217
218 diffs (6 lines):
218 diffs (6 lines):
219
219
220 diff -r 000000000000 -r a2392c293916 sym
220 diff -r 000000000000 -r a2392c293916 sym
221 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
221 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
222 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
222 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
223 @@ -0,0 +1,1 @@
223 @@ -0,0 +1,1 @@
224 +a
224 +a
225 \ No newline at end of file
225 \ No newline at end of file
226 Content-Type: text/plain; charset="us-ascii"
226 Content-Type: text/plain; charset="us-ascii"
227 MIME-Version: 1.0
227 MIME-Version: 1.0
228 Content-Transfer-Encoding: 7bit
228 Content-Transfer-Encoding: 7bit
229 Date:* (glob)
229 Date:* (glob)
230 Subject: changeset in...
230 Subject: changeset in...
231 From: User Name <user@example.com>
231 From: User Name <user@example.com>
232 X-Hg-Notification: changeset ef63ca68695b
232 X-Hg-Notification: changeset ef63ca68695b
233 Message-Id: <hg.ef63ca68695b*> (glob)
233 Message-Id: <hg.ef63ca68695b*> (glob)
234 To: Test
234 To: Test
235
235
236 changeset ef63ca68695b in $TESTTMP/Test
236 changeset ef63ca68695b in $TESTTMP/Test (glob)
237 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
237 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
238 description:
238 description:
239 absym
239 absym
240
240
241 diffs (12 lines):
241 diffs (12 lines):
242
242
243 diff -r a2392c293916 -r ef63ca68695b a
243 diff -r a2392c293916 -r ef63ca68695b a
244 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
244 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
245 +++ b/a Thu Jan 01 00:00:00 1970 +0000
245 +++ b/a Thu Jan 01 00:00:00 1970 +0000
246 @@ -0,0 +1,3 @@
246 @@ -0,0 +1,3 @@
247 +expand $Id$
247 +expand $Id$
248 +do not process $Id:
248 +do not process $Id:
249 +xxx $
249 +xxx $
250 diff -r a2392c293916 -r ef63ca68695b b
250 diff -r a2392c293916 -r ef63ca68695b b
251 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
251 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
252 +++ b/b Thu Jan 01 00:00:00 1970 +0000
252 +++ b/b Thu Jan 01 00:00:00 1970 +0000
253 @@ -0,0 +1,1 @@
253 @@ -0,0 +1,1 @@
254 +ignore $Id$
254 +ignore $Id$
255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
256
256
257 $ cp $HGRCPATH.nohooks $HGRCPATH
257 $ cp $HGRCPATH.nohooks $HGRCPATH
258
258
259 Touch files and check with status
259 Touch files and check with status
260
260
261 $ touch a b
261 $ touch a b
262 $ hg status
262 $ hg status
263
263
264 Update and expand
264 Update and expand
265
265
266 $ rm sym a b
266 $ rm sym a b
267 $ hg update -C
267 $ hg update -C
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 $ cat a b
269 $ cat a b
270 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
270 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
271 do not process $Id:
271 do not process $Id:
272 xxx $
272 xxx $
273 ignore $Id$
273 ignore $Id$
274
274
275 Check whether expansion is filewise and file mode is preserved
275 Check whether expansion is filewise and file mode is preserved
276
276
277 $ echo '$Id$' > c
277 $ echo '$Id$' > c
278 $ echo 'tests for different changenodes' >> c
278 $ echo 'tests for different changenodes' >> c
279 $ chmod 600 c
279 $ chmod 600 c
280 $ ls -l c | cut -b 1-10
280 $ ls -l c | cut -b 1-10
281 -rw-------
281 -rw-------
282
282
283 commit file c
283 commit file c
284
284
285 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
285 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
286 adding c
286 adding c
287 $ ls -l c | cut -b 1-10
287 $ ls -l c | cut -b 1-10
288 -rw-------
288 -rw-------
289
289
290 force expansion
290 force expansion
291
291
292 $ hg -v kwexpand
292 $ hg -v kwexpand
293 overwriting a expanding keywords
293 overwriting a expanding keywords
294 overwriting c expanding keywords
294 overwriting c expanding keywords
295
295
296 compare changenodes in a and c
296 compare changenodes in a and c
297
297
298 $ cat a c
298 $ cat a c
299 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
299 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
300 do not process $Id:
300 do not process $Id:
301 xxx $
301 xxx $
302 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
302 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
303 tests for different changenodes
303 tests for different changenodes
304
304
305 record
305 record
306
306
307 $ echo '$Id$' > r
307 $ echo '$Id$' > r
308 $ hg add r
308 $ hg add r
309
309
310 record chunk
310 record chunk
311
311
312 $ python -c \
312 $ python -c \
313 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
313 > 'l=open("a").readlines();l.insert(1,"foo\n");l.append("bar\n");open("a","w").writelines(l);'
314 $ hg record -d '1 10' -m rectest a<<EOF
314 $ hg record -d '1 10' -m rectest a<<EOF
315 > y
315 > y
316 > y
316 > y
317 > n
317 > n
318 > EOF
318 > EOF
319 diff --git a/a b/a
319 diff --git a/a b/a
320 2 hunks, 2 lines changed
320 2 hunks, 2 lines changed
321 examine changes to 'a'? [Ynsfdaq?]
321 examine changes to 'a'? [Ynsfdaq?]
322 @@ -1,3 +1,4 @@
322 @@ -1,3 +1,4 @@
323 expand $Id$
323 expand $Id$
324 +foo
324 +foo
325 do not process $Id:
325 do not process $Id:
326 xxx $
326 xxx $
327 record change 1/2 to 'a'? [Ynsfdaq?]
327 record change 1/2 to 'a'? [Ynsfdaq?]
328 @@ -2,2 +3,3 @@
328 @@ -2,2 +3,3 @@
329 do not process $Id:
329 do not process $Id:
330 xxx $
330 xxx $
331 +bar
331 +bar
332 record change 2/2 to 'a'? [Ynsfdaq?]
332 record change 2/2 to 'a'? [Ynsfdaq?]
333
333
334 $ hg identify
334 $ hg identify
335 d17e03c92c97+ tip
335 d17e03c92c97+ tip
336 $ hg status
336 $ hg status
337 M a
337 M a
338 A r
338 A r
339
339
340 Cat modified file a
340 Cat modified file a
341
341
342 $ cat a
342 $ cat a
343 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
343 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
344 foo
344 foo
345 do not process $Id:
345 do not process $Id:
346 xxx $
346 xxx $
347 bar
347 bar
348
348
349 Diff remaining chunk
349 Diff remaining chunk
350
350
351 $ hg diff a
351 $ hg diff a
352 diff -r d17e03c92c97 a
352 diff -r d17e03c92c97 a
353 --- a/a Wed Dec 31 23:59:51 1969 -0000
353 --- a/a Wed Dec 31 23:59:51 1969 -0000
354 +++ b/a * (glob)
354 +++ b/a * (glob)
355 @@ -2,3 +2,4 @@
355 @@ -2,3 +2,4 @@
356 foo
356 foo
357 do not process $Id:
357 do not process $Id:
358 xxx $
358 xxx $
359 +bar
359 +bar
360
360
361 $ hg rollback
361 $ hg rollback
362 repository tip rolled back to revision 2 (undo commit)
362 repository tip rolled back to revision 2 (undo commit)
363 working directory now based on revision 2
363 working directory now based on revision 2
364
364
365 Record all chunks in file a
365 Record all chunks in file a
366
366
367 $ echo foo > msg
367 $ echo foo > msg
368
368
369 - do not use "hg record -m" here!
369 - do not use "hg record -m" here!
370
370
371 $ hg record -l msg -d '1 11' a<<EOF
371 $ hg record -l msg -d '1 11' a<<EOF
372 > y
372 > y
373 > y
373 > y
374 > y
374 > y
375 > EOF
375 > EOF
376 diff --git a/a b/a
376 diff --git a/a b/a
377 2 hunks, 2 lines changed
377 2 hunks, 2 lines changed
378 examine changes to 'a'? [Ynsfdaq?]
378 examine changes to 'a'? [Ynsfdaq?]
379 @@ -1,3 +1,4 @@
379 @@ -1,3 +1,4 @@
380 expand $Id$
380 expand $Id$
381 +foo
381 +foo
382 do not process $Id:
382 do not process $Id:
383 xxx $
383 xxx $
384 record change 1/2 to 'a'? [Ynsfdaq?]
384 record change 1/2 to 'a'? [Ynsfdaq?]
385 @@ -2,2 +3,3 @@
385 @@ -2,2 +3,3 @@
386 do not process $Id:
386 do not process $Id:
387 xxx $
387 xxx $
388 +bar
388 +bar
389 record change 2/2 to 'a'? [Ynsfdaq?]
389 record change 2/2 to 'a'? [Ynsfdaq?]
390
390
391 File a should be clean
391 File a should be clean
392
392
393 $ hg status -A a
393 $ hg status -A a
394 C a
394 C a
395
395
396 rollback and revert expansion
396 rollback and revert expansion
397
397
398 $ cat a
398 $ cat a
399 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
399 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
400 foo
400 foo
401 do not process $Id:
401 do not process $Id:
402 xxx $
402 xxx $
403 bar
403 bar
404 $ hg --verbose rollback
404 $ hg --verbose rollback
405 repository tip rolled back to revision 2 (undo commit)
405 repository tip rolled back to revision 2 (undo commit)
406 working directory now based on revision 2
406 working directory now based on revision 2
407 overwriting a expanding keywords
407 overwriting a expanding keywords
408 $ hg status a
408 $ hg status a
409 M a
409 M a
410 $ cat a
410 $ cat a
411 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
411 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
412 foo
412 foo
413 do not process $Id:
413 do not process $Id:
414 xxx $
414 xxx $
415 bar
415 bar
416 $ echo '$Id$' > y
416 $ echo '$Id$' > y
417 $ echo '$Id$' > z
417 $ echo '$Id$' > z
418 $ hg add y
418 $ hg add y
419 $ hg commit -Am "rollback only" z
419 $ hg commit -Am "rollback only" z
420 $ cat z
420 $ cat z
421 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
421 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
422 $ hg --verbose rollback
422 $ hg --verbose rollback
423 repository tip rolled back to revision 2 (undo commit)
423 repository tip rolled back to revision 2 (undo commit)
424 working directory now based on revision 2
424 working directory now based on revision 2
425 overwriting z shrinking keywords
425 overwriting z shrinking keywords
426
426
427 Only z should be overwritten
427 Only z should be overwritten
428
428
429 $ hg status a y z
429 $ hg status a y z
430 M a
430 M a
431 A y
431 A y
432 A z
432 A z
433 $ cat z
433 $ cat z
434 $Id$
434 $Id$
435 $ hg forget y z
435 $ hg forget y z
436 $ rm y z
436 $ rm y z
437
437
438 record added file alone
438 record added file alone
439
439
440 $ hg -v record -l msg -d '1 12' r<<EOF
440 $ hg -v record -l msg -d '1 12' r<<EOF
441 > y
441 > y
442 > EOF
442 > EOF
443 diff --git a/r b/r
443 diff --git a/r b/r
444 new file mode 100644
444 new file mode 100644
445 examine changes to 'r'? [Ynsfdaq?]
445 examine changes to 'r'? [Ynsfdaq?]
446 r
446 r
447 committed changeset 3:899491280810
447 committed changeset 3:899491280810
448 overwriting r expanding keywords
448 overwriting r expanding keywords
449 - status call required for dirstate.normallookup() check
449 - status call required for dirstate.normallookup() check
450 $ hg status r
450 $ hg status r
451 $ hg --verbose rollback
451 $ hg --verbose rollback
452 repository tip rolled back to revision 2 (undo commit)
452 repository tip rolled back to revision 2 (undo commit)
453 working directory now based on revision 2
453 working directory now based on revision 2
454 overwriting r shrinking keywords
454 overwriting r shrinking keywords
455 $ hg forget r
455 $ hg forget r
456 $ rm msg r
456 $ rm msg r
457 $ hg update -C
457 $ hg update -C
458 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
458 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
459
459
460 record added keyword ignored file
460 record added keyword ignored file
461
461
462 $ echo '$Id$' > i
462 $ echo '$Id$' > i
463 $ hg add i
463 $ hg add i
464 $ hg --verbose record -d '1 13' -m recignored<<EOF
464 $ hg --verbose record -d '1 13' -m recignored<<EOF
465 > y
465 > y
466 > EOF
466 > EOF
467 diff --git a/i b/i
467 diff --git a/i b/i
468 new file mode 100644
468 new file mode 100644
469 examine changes to 'i'? [Ynsfdaq?]
469 examine changes to 'i'? [Ynsfdaq?]
470 i
470 i
471 committed changeset 3:5f40fe93bbdc
471 committed changeset 3:5f40fe93bbdc
472 $ cat i
472 $ cat i
473 $Id$
473 $Id$
474 $ hg -q rollback
474 $ hg -q rollback
475 $ hg forget i
475 $ hg forget i
476 $ rm i
476 $ rm i
477
477
478 Test patch queue repo
478 Test patch queue repo
479
479
480 $ hg init --mq
480 $ hg init --mq
481 $ hg qimport -r tip -n mqtest.diff
481 $ hg qimport -r tip -n mqtest.diff
482 $ hg commit --mq -m mqtest
482 $ hg commit --mq -m mqtest
483
483
484 Keywords should not be expanded in patch
484 Keywords should not be expanded in patch
485
485
486 $ cat .hg/patches/mqtest.diff
486 $ cat .hg/patches/mqtest.diff
487 # HG changeset patch
487 # HG changeset patch
488 # User User Name <user@example.com>
488 # User User Name <user@example.com>
489 # Date 1 0
489 # Date 1 0
490 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
490 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
491 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
491 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
492 cndiff
492 cndiff
493
493
494 diff -r ef63ca68695b -r 40a904bbbe4c c
494 diff -r ef63ca68695b -r 40a904bbbe4c c
495 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
495 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
496 +++ b/c Thu Jan 01 00:00:01 1970 +0000
496 +++ b/c Thu Jan 01 00:00:01 1970 +0000
497 @@ -0,0 +1,2 @@
497 @@ -0,0 +1,2 @@
498 +$Id$
498 +$Id$
499 +tests for different changenodes
499 +tests for different changenodes
500
500
501 $ hg qpop
501 $ hg qpop
502 popping mqtest.diff
502 popping mqtest.diff
503 patch queue now empty
503 patch queue now empty
504
504
505 qgoto, implying qpush, should expand
505 qgoto, implying qpush, should expand
506
506
507 $ hg qgoto mqtest.diff
507 $ hg qgoto mqtest.diff
508 applying mqtest.diff
508 applying mqtest.diff
509 now at: mqtest.diff
509 now at: mqtest.diff
510 $ cat c
510 $ cat c
511 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
511 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
512 tests for different changenodes
512 tests for different changenodes
513 $ hg cat c
513 $ hg cat c
514 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
514 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
515 tests for different changenodes
515 tests for different changenodes
516
516
517 Keywords should not be expanded in filelog
517 Keywords should not be expanded in filelog
518
518
519 $ hg --config 'extensions.keyword=!' cat c
519 $ hg --config 'extensions.keyword=!' cat c
520 $Id$
520 $Id$
521 tests for different changenodes
521 tests for different changenodes
522
522
523 qpop and move on
523 qpop and move on
524
524
525 $ hg qpop
525 $ hg qpop
526 popping mqtest.diff
526 popping mqtest.diff
527 patch queue now empty
527 patch queue now empty
528
528
529 Copy and show added kwfiles
529 Copy and show added kwfiles
530
530
531 $ hg cp a c
531 $ hg cp a c
532 $ hg kwfiles
532 $ hg kwfiles
533 a
533 a
534 c
534 c
535
535
536 Commit and show expansion in original and copy
536 Commit and show expansion in original and copy
537
537
538 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
538 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
539 c
539 c
540 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
540 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
541 overwriting c expanding keywords
541 overwriting c expanding keywords
542 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
542 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
543 $ cat a c
543 $ cat a c
544 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
544 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
545 do not process $Id:
545 do not process $Id:
546 xxx $
546 xxx $
547 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
547 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
548 do not process $Id:
548 do not process $Id:
549 xxx $
549 xxx $
550
550
551 Touch copied c and check its status
551 Touch copied c and check its status
552
552
553 $ touch c
553 $ touch c
554 $ hg status
554 $ hg status
555
555
556 Copy kwfile to keyword ignored file unexpanding keywords
556 Copy kwfile to keyword ignored file unexpanding keywords
557
557
558 $ hg --verbose copy a i
558 $ hg --verbose copy a i
559 copying a to i
559 copying a to i
560 overwriting i shrinking keywords
560 overwriting i shrinking keywords
561 $ head -n 1 i
561 $ head -n 1 i
562 expand $Id$
562 expand $Id$
563 $ hg forget i
563 $ hg forget i
564 $ rm i
564 $ rm i
565
565
566 Copy ignored file to ignored file: no overwriting
566 Copy ignored file to ignored file: no overwriting
567
567
568 $ hg --verbose copy b i
568 $ hg --verbose copy b i
569 copying b to i
569 copying b to i
570 $ hg forget i
570 $ hg forget i
571 $ rm i
571 $ rm i
572
572
573 cp symlink file; hg cp -A symlink file (part1)
573 cp symlink file; hg cp -A symlink file (part1)
574 - copied symlink points to kwfile: overwrite
574 - copied symlink points to kwfile: overwrite
575
575
576 $ cp sym i
576 $ cp sym i
577 $ ls -l i
577 $ ls -l i
578 -rw-r--r--* (glob)
578 -rw-r--r--* (glob)
579 $ head -1 i
579 $ head -1 i
580 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
580 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
581 $ hg copy --after --verbose sym i
581 $ hg copy --after --verbose sym i
582 copying sym to i
582 copying sym to i
583 overwriting i shrinking keywords
583 overwriting i shrinking keywords
584 $ head -1 i
584 $ head -1 i
585 expand $Id$
585 expand $Id$
586 $ hg forget i
586 $ hg forget i
587 $ rm i
587 $ rm i
588
588
589 Test different options of hg kwfiles
589 Test different options of hg kwfiles
590
590
591 $ hg kwfiles
591 $ hg kwfiles
592 a
592 a
593 c
593 c
594 $ hg -v kwfiles --ignore
594 $ hg -v kwfiles --ignore
595 I b
595 I b
596 I sym
596 I sym
597 $ hg kwfiles --all
597 $ hg kwfiles --all
598 K a
598 K a
599 K c
599 K c
600 I b
600 I b
601 I sym
601 I sym
602
602
603 Diff specific revision
603 Diff specific revision
604
604
605 $ hg diff --rev 1
605 $ hg diff --rev 1
606 diff -r ef63ca68695b c
606 diff -r ef63ca68695b c
607 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
607 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
608 +++ b/c * (glob)
608 +++ b/c * (glob)
609 @@ -0,0 +1,3 @@
609 @@ -0,0 +1,3 @@
610 +expand $Id$
610 +expand $Id$
611 +do not process $Id:
611 +do not process $Id:
612 +xxx $
612 +xxx $
613
613
614 Status after rollback:
614 Status after rollback:
615
615
616 $ hg rollback
616 $ hg rollback
617 repository tip rolled back to revision 1 (undo commit)
617 repository tip rolled back to revision 1 (undo commit)
618 working directory now based on revision 1
618 working directory now based on revision 1
619 $ hg status
619 $ hg status
620 A c
620 A c
621 $ hg update --clean
621 $ hg update --clean
622 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
622 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
623
623
624 cp symlink file; hg cp -A symlink file (part2)
624 cp symlink file; hg cp -A symlink file (part2)
625 - copied symlink points to kw ignored file: do not overwrite
625 - copied symlink points to kw ignored file: do not overwrite
626
626
627 $ cat a > i
627 $ cat a > i
628 $ ln -s i symignored
628 $ ln -s i symignored
629 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
629 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
630 $ cp symignored x
630 $ cp symignored x
631 $ hg copy --after --verbose symignored x
631 $ hg copy --after --verbose symignored x
632 copying symignored to x
632 copying symignored to x
633 $ head -n 1 x
633 $ head -n 1 x
634 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
634 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
635 $ hg forget x
635 $ hg forget x
636 $ rm x
636 $ rm x
637
637
638 $ hg rollback
638 $ hg rollback
639 repository tip rolled back to revision 1 (undo commit)
639 repository tip rolled back to revision 1 (undo commit)
640 working directory now based on revision 1
640 working directory now based on revision 1
641 $ hg update --clean
641 $ hg update --clean
642 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
642 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 $ rm i symignored
643 $ rm i symignored
644
644
645 Custom keywordmaps as argument to kwdemo
645 Custom keywordmaps as argument to kwdemo
646
646
647 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
647 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
648 [extensions]
648 [extensions]
649 keyword =
649 keyword =
650 [keyword]
650 [keyword]
651 ** =
651 ** =
652 b = ignore
652 b = ignore
653 demo.txt =
653 demo.txt =
654 i = ignore
654 i = ignore
655 [keywordset]
655 [keywordset]
656 svn = False
656 svn = False
657 [keywordmaps]
657 [keywordmaps]
658 Xinfo = {author}: {desc}
658 Xinfo = {author}: {desc}
659 $Xinfo: test: hg keyword configuration and expansion example $
659 $Xinfo: test: hg keyword configuration and expansion example $
660
660
661 Configure custom keywordmaps
661 Configure custom keywordmaps
662
662
663 $ cat <<EOF >>$HGRCPATH
663 $ cat <<EOF >>$HGRCPATH
664 > [keywordmaps]
664 > [keywordmaps]
665 > Id = {file} {node|short} {date|rfc822date} {author|user}
665 > Id = {file} {node|short} {date|rfc822date} {author|user}
666 > Xinfo = {author}: {desc}
666 > Xinfo = {author}: {desc}
667 > EOF
667 > EOF
668
668
669 Cat and hg cat files before custom expansion
669 Cat and hg cat files before custom expansion
670
670
671 $ cat a b
671 $ cat a b
672 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
672 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
673 do not process $Id:
673 do not process $Id:
674 xxx $
674 xxx $
675 ignore $Id$
675 ignore $Id$
676 $ hg cat sym a b && echo
676 $ hg cat sym a b && echo
677 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
677 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
678 do not process $Id:
678 do not process $Id:
679 xxx $
679 xxx $
680 ignore $Id$
680 ignore $Id$
681 a
681 a
682
682
683 Write custom keyword and prepare multiline commit message
683 Write custom keyword and prepare multiline commit message
684
684
685 $ echo '$Xinfo$' >> a
685 $ echo '$Xinfo$' >> a
686 $ cat <<EOF >> log
686 $ cat <<EOF >> log
687 > firstline
687 > firstline
688 > secondline
688 > secondline
689 > EOF
689 > EOF
690
690
691 Interrupted commit should not change state
691 Interrupted commit should not change state
692
692
693 $ hg commit
693 $ hg commit
694 abort: empty commit message
694 abort: empty commit message
695 [255]
695 [255]
696 $ hg status
696 $ hg status
697 M a
697 M a
698 ? c
698 ? c
699 ? log
699 ? log
700
700
701 Commit with multiline message and custom expansion
701 Commit with multiline message and custom expansion
702
702
703 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
703 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
704 a
704 a
705 overwriting a expanding keywords
705 overwriting a expanding keywords
706 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
706 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
707 $ rm log
707 $ rm log
708
708
709 Stat, verify and show custom expansion (firstline)
709 Stat, verify and show custom expansion (firstline)
710
710
711 $ hg status
711 $ hg status
712 ? c
712 ? c
713 $ hg verify
713 $ hg verify
714 checking changesets
714 checking changesets
715 checking manifests
715 checking manifests
716 crosschecking files in changesets and manifests
716 crosschecking files in changesets and manifests
717 checking files
717 checking files
718 3 files, 3 changesets, 4 total revisions
718 3 files, 3 changesets, 4 total revisions
719 $ cat a b
719 $ cat a b
720 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
720 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
721 do not process $Id:
721 do not process $Id:
722 xxx $
722 xxx $
723 $Xinfo: User Name <user@example.com>: firstline $
723 $Xinfo: User Name <user@example.com>: firstline $
724 ignore $Id$
724 ignore $Id$
725 $ hg cat sym a b && echo
725 $ hg cat sym a b && echo
726 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
726 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
727 do not process $Id:
727 do not process $Id:
728 xxx $
728 xxx $
729 $Xinfo: User Name <user@example.com>: firstline $
729 $Xinfo: User Name <user@example.com>: firstline $
730 ignore $Id$
730 ignore $Id$
731 a
731 a
732
732
733 annotate
733 annotate
734
734
735 $ hg annotate a
735 $ hg annotate a
736 1: expand $Id$
736 1: expand $Id$
737 1: do not process $Id:
737 1: do not process $Id:
738 1: xxx $
738 1: xxx $
739 2: $Xinfo$
739 2: $Xinfo$
740
740
741 remove with status checks
741 remove with status checks
742
742
743 $ hg debugrebuildstate
743 $ hg debugrebuildstate
744 $ hg remove a
744 $ hg remove a
745 $ hg --debug commit -m rma
745 $ hg --debug commit -m rma
746 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
746 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
747 $ hg status
747 $ hg status
748 ? c
748 ? c
749
749
750 Rollback, revert, and check expansion
750 Rollback, revert, and check expansion
751
751
752 $ hg rollback
752 $ hg rollback
753 repository tip rolled back to revision 2 (undo commit)
753 repository tip rolled back to revision 2 (undo commit)
754 working directory now based on revision 2
754 working directory now based on revision 2
755 $ hg status
755 $ hg status
756 R a
756 R a
757 ? c
757 ? c
758 $ hg revert --no-backup --rev tip a
758 $ hg revert --no-backup --rev tip a
759 $ cat a
759 $ cat a
760 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
760 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
761 do not process $Id:
761 do not process $Id:
762 xxx $
762 xxx $
763 $Xinfo: User Name <user@example.com>: firstline $
763 $Xinfo: User Name <user@example.com>: firstline $
764
764
765 Clone to test global and local configurations
765 Clone to test global and local configurations
766
766
767 $ cd ..
767 $ cd ..
768
768
769 Expansion in destinaton with global configuration
769 Expansion in destinaton with global configuration
770
770
771 $ hg --quiet clone Test globalconf
771 $ hg --quiet clone Test globalconf
772 $ cat globalconf/a
772 $ cat globalconf/a
773 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
773 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
774 do not process $Id:
774 do not process $Id:
775 xxx $
775 xxx $
776 $Xinfo: User Name <user@example.com>: firstline $
776 $Xinfo: User Name <user@example.com>: firstline $
777
777
778 No expansion in destination with local configuration in origin only
778 No expansion in destination with local configuration in origin only
779
779
780 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
780 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
781 $ cat localconf/a
781 $ cat localconf/a
782 expand $Id$
782 expand $Id$
783 do not process $Id:
783 do not process $Id:
784 xxx $
784 xxx $
785 $Xinfo$
785 $Xinfo$
786
786
787 Clone to test incoming
787 Clone to test incoming
788
788
789 $ hg clone -r1 Test Test-a
789 $ hg clone -r1 Test Test-a
790 adding changesets
790 adding changesets
791 adding manifests
791 adding manifests
792 adding file changes
792 adding file changes
793 added 2 changesets with 3 changes to 3 files
793 added 2 changesets with 3 changes to 3 files
794 updating to branch default
794 updating to branch default
795 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 $ cd Test-a
796 $ cd Test-a
797 $ cat <<EOF >> .hg/hgrc
797 $ cat <<EOF >> .hg/hgrc
798 > [paths]
798 > [paths]
799 > default = ../Test
799 > default = ../Test
800 > EOF
800 > EOF
801 $ hg incoming
801 $ hg incoming
802 comparing with $TESTTMP/Test
802 comparing with $TESTTMP/Test (glob)
803 searching for changes
803 searching for changes
804 changeset: 2:bb948857c743
804 changeset: 2:bb948857c743
805 tag: tip
805 tag: tip
806 user: User Name <user@example.com>
806 user: User Name <user@example.com>
807 date: Thu Jan 01 00:00:02 1970 +0000
807 date: Thu Jan 01 00:00:02 1970 +0000
808 summary: firstline
808 summary: firstline
809
809
810 Imported patch should not be rejected
810 Imported patch should not be rejected
811
811
812 $ python -c \
812 $ python -c \
813 > 'import re; s=re.sub("(Id.*)","\\1 rejecttest",open("a").read()); open("a","wb").write(s);'
813 > 'import re; s=re.sub("(Id.*)","\\1 rejecttest",open("a").read()); open("a","wb").write(s);'
814 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
814 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
815 a
815 a
816 overwriting a expanding keywords
816 overwriting a expanding keywords
817 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
817 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
818 $ hg export -o ../rejecttest.diff tip
818 $ hg export -o ../rejecttest.diff tip
819 $ cd ../Test
819 $ cd ../Test
820 $ hg import ../rejecttest.diff
820 $ hg import ../rejecttest.diff
821 applying ../rejecttest.diff
821 applying ../rejecttest.diff
822 $ cat a b
822 $ cat a b
823 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
823 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
824 do not process $Id: rejecttest
824 do not process $Id: rejecttest
825 xxx $
825 xxx $
826 $Xinfo: User Name <user@example.com>: rejects? $
826 $Xinfo: User Name <user@example.com>: rejects? $
827 ignore $Id$
827 ignore $Id$
828
828
829 $ hg rollback
829 $ hg rollback
830 repository tip rolled back to revision 2 (undo import)
830 repository tip rolled back to revision 2 (undo import)
831 working directory now based on revision 2
831 working directory now based on revision 2
832 $ hg update --clean
832 $ hg update --clean
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
834
834
835 kwexpand/kwshrink on selected files
835 kwexpand/kwshrink on selected files
836
836
837 $ mkdir x
837 $ mkdir x
838 $ hg copy a x/a
838 $ hg copy a x/a
839 $ hg --verbose kwshrink a
839 $ hg --verbose kwshrink a
840 overwriting a shrinking keywords
840 overwriting a shrinking keywords
841 - sleep required for dirstate.normal() check
841 - sleep required for dirstate.normal() check
842 $ sleep 1
842 $ sleep 1
843 $ hg status a
843 $ hg status a
844 $ hg --verbose kwexpand a
844 $ hg --verbose kwexpand a
845 overwriting a expanding keywords
845 overwriting a expanding keywords
846 $ hg status a
846 $ hg status a
847
847
848 kwexpand x/a should abort
848 kwexpand x/a should abort
849
849
850 $ hg --verbose kwexpand x/a
850 $ hg --verbose kwexpand x/a
851 abort: outstanding uncommitted changes
851 abort: outstanding uncommitted changes
852 [255]
852 [255]
853 $ cd x
853 $ cd x
854 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
854 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
855 x/a
855 x/a
856 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
856 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
857 overwriting x/a expanding keywords
857 overwriting x/a expanding keywords
858 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
858 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
859 $ cat a
859 $ cat a
860 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
860 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
861 do not process $Id:
861 do not process $Id:
862 xxx $
862 xxx $
863 $Xinfo: User Name <user@example.com>: xa $
863 $Xinfo: User Name <user@example.com>: xa $
864
864
865 kwshrink a inside directory x
865 kwshrink a inside directory x
866
866
867 $ hg --verbose kwshrink a
867 $ hg --verbose kwshrink a
868 overwriting x/a shrinking keywords
868 overwriting x/a shrinking keywords
869 $ cat a
869 $ cat a
870 expand $Id$
870 expand $Id$
871 do not process $Id:
871 do not process $Id:
872 xxx $
872 xxx $
873 $Xinfo$
873 $Xinfo$
874 $ cd ..
874 $ cd ..
875
875
876 kwexpand nonexistent
876 kwexpand nonexistent
877
877
878 $ hg kwexpand nonexistent
878 $ hg kwexpand nonexistent
879 nonexistent:* (glob)
879 nonexistent:* (glob)
880
880
881
881
882 hg serve
882 hg serve
883 - expand with hgweb file
883 - expand with hgweb file
884 - no expansion with hgweb annotate/changeset/filediff
884 - no expansion with hgweb annotate/changeset/filediff
885 - check errors
885 - check errors
886
886
887 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
887 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
888 $ cat hg.pid >> $DAEMON_PIDS
888 $ cat hg.pid >> $DAEMON_PIDS
889 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
889 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/file/tip/a/?style=raw'
890 200 Script output follows
890 200 Script output follows
891
891
892 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
892 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
893 do not process $Id:
893 do not process $Id:
894 xxx $
894 xxx $
895 $Xinfo: User Name <user@example.com>: firstline $
895 $Xinfo: User Name <user@example.com>: firstline $
896 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
896 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/annotate/tip/a/?style=raw'
897 200 Script output follows
897 200 Script output follows
898
898
899
899
900 user@1: expand $Id$
900 user@1: expand $Id$
901 user@1: do not process $Id:
901 user@1: do not process $Id:
902 user@1: xxx $
902 user@1: xxx $
903 user@2: $Xinfo$
903 user@2: $Xinfo$
904
904
905
905
906
906
907
907
908 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
908 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw'
909 200 Script output follows
909 200 Script output follows
910
910
911
911
912 # HG changeset patch
912 # HG changeset patch
913 # User User Name <user@example.com>
913 # User User Name <user@example.com>
914 # Date 3 0
914 # Date 3 0
915 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
915 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
916 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
916 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
917 xa
917 xa
918
918
919 diff -r bb948857c743 -r b4560182a3f9 x/a
919 diff -r bb948857c743 -r b4560182a3f9 x/a
920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
920 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
921 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
921 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
922 @@ -0,0 +1,4 @@
922 @@ -0,0 +1,4 @@
923 +expand $Id$
923 +expand $Id$
924 +do not process $Id:
924 +do not process $Id:
925 +xxx $
925 +xxx $
926 +$Xinfo$
926 +$Xinfo$
927
927
928 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
928 $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
929 200 Script output follows
929 200 Script output follows
930
930
931
931
932 diff -r ef63ca68695b -r bb948857c743 a
932 diff -r ef63ca68695b -r bb948857c743 a
933 --- a/a Thu Jan 01 00:00:00 1970 +0000
933 --- a/a Thu Jan 01 00:00:00 1970 +0000
934 +++ b/a Thu Jan 01 00:00:02 1970 +0000
934 +++ b/a Thu Jan 01 00:00:02 1970 +0000
935 @@ -1,3 +1,4 @@
935 @@ -1,3 +1,4 @@
936 expand $Id$
936 expand $Id$
937 do not process $Id:
937 do not process $Id:
938 xxx $
938 xxx $
939 +$Xinfo$
939 +$Xinfo$
940
940
941
941
942
942
943
943
944 $ cat errors.log
944 $ cat errors.log
945
945
946 Prepare merge and resolve tests
946 Prepare merge and resolve tests
947
947
948 $ echo '$Id$' > m
948 $ echo '$Id$' > m
949 $ hg add m
949 $ hg add m
950 $ hg commit -m 4kw
950 $ hg commit -m 4kw
951 $ echo foo >> m
951 $ echo foo >> m
952 $ hg commit -m 5foo
952 $ hg commit -m 5foo
953
953
954 simplemerge
954 simplemerge
955
955
956 $ hg update 4
956 $ hg update 4
957 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
957 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
958 $ echo foo >> m
958 $ echo foo >> m
959 $ hg commit -m 6foo
959 $ hg commit -m 6foo
960 created new head
960 created new head
961 $ hg merge
961 $ hg merge
962 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
962 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
963 (branch merge, don't forget to commit)
963 (branch merge, don't forget to commit)
964 $ hg commit -m simplemerge
964 $ hg commit -m simplemerge
965 $ cat m
965 $ cat m
966 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
966 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
967 foo
967 foo
968
968
969 conflict: keyword should stay outside conflict zone
969 conflict: keyword should stay outside conflict zone
970
970
971 $ hg update 4
971 $ hg update 4
972 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
972 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
973 $ echo bar >> m
973 $ echo bar >> m
974 $ hg commit -m 8bar
974 $ hg commit -m 8bar
975 created new head
975 created new head
976 $ hg merge
976 $ hg merge
977 merging m
977 merging m
978 warning: conflicts during merge.
978 warning: conflicts during merge.
979 merging m failed!
979 merging m failed!
980 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
980 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
981 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
981 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
982 [1]
982 [1]
983 $ cat m
983 $ cat m
984 $Id$
984 $Id$
985 <<<<<<< local
985 <<<<<<< local
986 bar
986 bar
987 =======
987 =======
988 foo
988 foo
989 >>>>>>> other
989 >>>>>>> other
990
990
991 resolve to local
991 resolve to local
992
992
993 $ HGMERGE=internal:local hg resolve -a
993 $ HGMERGE=internal:local hg resolve -a
994 $ hg commit -m localresolve
994 $ hg commit -m localresolve
995 $ cat m
995 $ cat m
996 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
996 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
997 bar
997 bar
998
998
999 Test restricted mode with transplant -b
999 Test restricted mode with transplant -b
1000
1000
1001 $ hg update 6
1001 $ hg update 6
1002 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1002 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003 $ hg branch foo
1003 $ hg branch foo
1004 marked working directory as branch foo
1004 marked working directory as branch foo
1005 $ mv a a.bak
1005 $ mv a a.bak
1006 $ echo foobranch > a
1006 $ echo foobranch > a
1007 $ cat a.bak >> a
1007 $ cat a.bak >> a
1008 $ rm a.bak
1008 $ rm a.bak
1009 $ hg commit -m 9foobranch
1009 $ hg commit -m 9foobranch
1010 $ hg update default
1010 $ hg update default
1011 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1011 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1012 $ hg -y transplant -b foo tip
1012 $ hg -y transplant -b foo tip
1013 applying 4aa30d025d50
1013 applying 4aa30d025d50
1014 4aa30d025d50 transplanted to e00abbf63521
1014 4aa30d025d50 transplanted to e00abbf63521
1015
1015
1016 Expansion in changeset but not in file
1016 Expansion in changeset but not in file
1017
1017
1018 $ hg tip -p
1018 $ hg tip -p
1019 changeset: 11:e00abbf63521
1019 changeset: 11:e00abbf63521
1020 tag: tip
1020 tag: tip
1021 parent: 9:800511b3a22d
1021 parent: 9:800511b3a22d
1022 user: test
1022 user: test
1023 date: Thu Jan 01 00:00:00 1970 +0000
1023 date: Thu Jan 01 00:00:00 1970 +0000
1024 summary: 9foobranch
1024 summary: 9foobranch
1025
1025
1026 diff -r 800511b3a22d -r e00abbf63521 a
1026 diff -r 800511b3a22d -r e00abbf63521 a
1027 --- a/a Thu Jan 01 00:00:00 1970 +0000
1027 --- a/a Thu Jan 01 00:00:00 1970 +0000
1028 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1028 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1029 @@ -1,3 +1,4 @@
1029 @@ -1,3 +1,4 @@
1030 +foobranch
1030 +foobranch
1031 expand $Id$
1031 expand $Id$
1032 do not process $Id:
1032 do not process $Id:
1033 xxx $
1033 xxx $
1034
1034
1035 $ head -n 2 a
1035 $ head -n 2 a
1036 foobranch
1036 foobranch
1037 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1037 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1038
1038
1039 Turn off expansion
1039 Turn off expansion
1040
1040
1041 $ hg -q rollback
1041 $ hg -q rollback
1042 $ hg -q update -C
1042 $ hg -q update -C
1043
1043
1044 kwshrink with unknown file u
1044 kwshrink with unknown file u
1045
1045
1046 $ cp a u
1046 $ cp a u
1047 $ hg --verbose kwshrink
1047 $ hg --verbose kwshrink
1048 overwriting a shrinking keywords
1048 overwriting a shrinking keywords
1049 overwriting m shrinking keywords
1049 overwriting m shrinking keywords
1050 overwriting x/a shrinking keywords
1050 overwriting x/a shrinking keywords
1051
1051
1052 Keywords shrunk in working directory, but not yet disabled
1052 Keywords shrunk in working directory, but not yet disabled
1053 - cat shows unexpanded keywords
1053 - cat shows unexpanded keywords
1054 - hg cat shows expanded keywords
1054 - hg cat shows expanded keywords
1055
1055
1056 $ cat a b
1056 $ cat a b
1057 expand $Id$
1057 expand $Id$
1058 do not process $Id:
1058 do not process $Id:
1059 xxx $
1059 xxx $
1060 $Xinfo$
1060 $Xinfo$
1061 ignore $Id$
1061 ignore $Id$
1062 $ hg cat sym a b && echo
1062 $ hg cat sym a b && echo
1063 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1063 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1064 do not process $Id:
1064 do not process $Id:
1065 xxx $
1065 xxx $
1066 $Xinfo: User Name <user@example.com>: firstline $
1066 $Xinfo: User Name <user@example.com>: firstline $
1067 ignore $Id$
1067 ignore $Id$
1068 a
1068 a
1069
1069
1070 Now disable keyword expansion
1070 Now disable keyword expansion
1071
1071
1072 $ rm "$HGRCPATH"
1072 $ rm "$HGRCPATH"
1073 $ cat a b
1073 $ cat a b
1074 expand $Id$
1074 expand $Id$
1075 do not process $Id:
1075 do not process $Id:
1076 xxx $
1076 xxx $
1077 $Xinfo$
1077 $Xinfo$
1078 ignore $Id$
1078 ignore $Id$
1079 $ hg cat sym a b && echo
1079 $ hg cat sym a b && echo
1080 expand $Id$
1080 expand $Id$
1081 do not process $Id:
1081 do not process $Id:
1082 xxx $
1082 xxx $
1083 $Xinfo$
1083 $Xinfo$
1084 ignore $Id$
1084 ignore $Id$
1085 a
1085 a
@@ -1,844 +1,844 b''
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [largefiles]
9 > [largefiles]
10 > minsize=2
10 > minsize=2
11 > patterns=glob:**.dat
11 > patterns=glob:**.dat
12 > EOF
12 > EOF
13
13
14 Create the repo with a couple of revisions of both large and normal
14 Create the repo with a couple of revisions of both large and normal
15 files, testing that status correctly shows largefiles.
15 files, testing that status correctly shows largefiles.
16
16
17 $ hg init a
17 $ hg init a
18 $ cd a
18 $ cd a
19 $ mkdir sub
19 $ mkdir sub
20 $ echo normal1 > normal1
20 $ echo normal1 > normal1
21 $ echo normal2 > sub/normal2
21 $ echo normal2 > sub/normal2
22 $ echo large1 > large1
22 $ echo large1 > large1
23 $ echo large2 > sub/large2
23 $ echo large2 > sub/large2
24 $ hg add normal1 sub/normal2
24 $ hg add normal1 sub/normal2
25 $ hg add --large large1 sub/large2
25 $ hg add --large large1 sub/large2
26 $ hg commit -m "add files"
26 $ hg commit -m "add files"
27 $ echo normal11 > normal1
27 $ echo normal11 > normal1
28 $ echo normal22 > sub/normal2
28 $ echo normal22 > sub/normal2
29 $ echo large11 > large1
29 $ echo large11 > large1
30 $ echo large22 > sub/large2
30 $ echo large22 > sub/large2
31 $ hg st
31 $ hg st
32 M large1
32 M large1
33 M normal1
33 M normal1
34 M sub/large2
34 M sub/large2
35 M sub/normal2
35 M sub/normal2
36 $ hg commit -m "edit files"
36 $ hg commit -m "edit files"
37
37
38 Commit preserved largefile contents.
38 Commit preserved largefile contents.
39
39
40 $ cat normal1
40 $ cat normal1
41 normal11
41 normal11
42 $ cat large1
42 $ cat large1
43 large11
43 large11
44 $ cat sub/normal2
44 $ cat sub/normal2
45 normal22
45 normal22
46 $ cat sub/large2
46 $ cat sub/large2
47 large22
47 large22
48
48
49 Remove both largefiles and normal files.
49 Remove both largefiles and normal files.
50
50
51 $ hg remove normal1 large1
51 $ hg remove normal1 large1
52 $ hg commit -m "remove files"
52 $ hg commit -m "remove files"
53 $ ls
53 $ ls
54 sub
54 sub
55
55
56 Copy both largefiles and normal files.
56 Copy both largefiles and normal files.
57
57
58 $ hg cp sub/normal2 normal1
58 $ hg cp sub/normal2 normal1
59 $ hg cp sub/large2 large1
59 $ hg cp sub/large2 large1
60 $ hg commit -m "copy files"
60 $ hg commit -m "copy files"
61 $ cat normal1
61 $ cat normal1
62 normal22
62 normal22
63 $ cat large1
63 $ cat large1
64 large22
64 large22
65
65
66 Test moving largefiles and verify that normal files are also unaffected.
66 Test moving largefiles and verify that normal files are also unaffected.
67
67
68 $ hg mv normal1 normal3
68 $ hg mv normal1 normal3
69 $ hg mv large1 large3
69 $ hg mv large1 large3
70 $ hg mv sub/normal2 sub/normal4
70 $ hg mv sub/normal2 sub/normal4
71 $ hg mv sub/large2 sub/large4
71 $ hg mv sub/large2 sub/large4
72 $ hg commit -m "move files"
72 $ hg commit -m "move files"
73 $ cat normal3
73 $ cat normal3
74 normal22
74 normal22
75 $ cat large3
75 $ cat large3
76 large22
76 large22
77 $ cat sub/normal4
77 $ cat sub/normal4
78 normal22
78 normal22
79 $ cat sub/large4
79 $ cat sub/large4
80 large22
80 large22
81
81
82 Test archiving the various revisions. These hit corner cases known with
82 Test archiving the various revisions. These hit corner cases known with
83 archiving.
83 archiving.
84
84
85 $ hg archive -r 0 ../archive0
85 $ hg archive -r 0 ../archive0
86 $ hg archive -r 1 ../archive1
86 $ hg archive -r 1 ../archive1
87 $ hg archive -r 2 ../archive2
87 $ hg archive -r 2 ../archive2
88 $ hg archive -r 3 ../archive3
88 $ hg archive -r 3 ../archive3
89 $ hg archive -r 4 ../archive4
89 $ hg archive -r 4 ../archive4
90 $ cd ../archive0
90 $ cd ../archive0
91 $ cat normal1
91 $ cat normal1
92 normal1
92 normal1
93 $ cat large1
93 $ cat large1
94 large1
94 large1
95 $ cat sub/normal2
95 $ cat sub/normal2
96 normal2
96 normal2
97 $ cat sub/large2
97 $ cat sub/large2
98 large2
98 large2
99 $ cd ../archive1
99 $ cd ../archive1
100 $ cat normal1
100 $ cat normal1
101 normal11
101 normal11
102 $ cat large1
102 $ cat large1
103 large11
103 large11
104 $ cat sub/normal2
104 $ cat sub/normal2
105 normal22
105 normal22
106 $ cat sub/large2
106 $ cat sub/large2
107 large22
107 large22
108 $ cd ../archive2
108 $ cd ../archive2
109 $ ls
109 $ ls
110 sub
110 sub
111 $ cat sub/normal2
111 $ cat sub/normal2
112 normal22
112 normal22
113 $ cat sub/large2
113 $ cat sub/large2
114 large22
114 large22
115 $ cd ../archive3
115 $ cd ../archive3
116 $ cat normal1
116 $ cat normal1
117 normal22
117 normal22
118 $ cat large1
118 $ cat large1
119 large22
119 large22
120 $ cat sub/normal2
120 $ cat sub/normal2
121 normal22
121 normal22
122 $ cat sub/large2
122 $ cat sub/large2
123 large22
123 large22
124 $ cd ../archive4
124 $ cd ../archive4
125 $ cat normal3
125 $ cat normal3
126 normal22
126 normal22
127 $ cat large3
127 $ cat large3
128 large22
128 large22
129 $ cat sub/normal4
129 $ cat sub/normal4
130 normal22
130 normal22
131 $ cat sub/large4
131 $ cat sub/large4
132 large22
132 large22
133
133
134 Commit corner case: specify files to commit.
134 Commit corner case: specify files to commit.
135
135
136 $ cd ../a
136 $ cd ../a
137 $ echo normal3 > normal3
137 $ echo normal3 > normal3
138 $ echo large3 > large3
138 $ echo large3 > large3
139 $ echo normal4 > sub/normal4
139 $ echo normal4 > sub/normal4
140 $ echo large4 > sub/large4
140 $ echo large4 > sub/large4
141 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
141 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
142 $ cat normal3
142 $ cat normal3
143 normal3
143 normal3
144 $ cat large3
144 $ cat large3
145 large3
145 large3
146 $ cat sub/normal4
146 $ cat sub/normal4
147 normal4
147 normal4
148 $ cat sub/large4
148 $ cat sub/large4
149 large4
149 large4
150
150
151 One more commit corner case: commit from a subdirectory.
151 One more commit corner case: commit from a subdirectory.
152
152
153 $ cd ../a
153 $ cd ../a
154 $ echo normal33 > normal3
154 $ echo normal33 > normal3
155 $ echo large33 > large3
155 $ echo large33 > large3
156 $ echo normal44 > sub/normal4
156 $ echo normal44 > sub/normal4
157 $ echo large44 > sub/large4
157 $ echo large44 > sub/large4
158 $ cd sub
158 $ cd sub
159 $ hg commit -m "edit files yet again"
159 $ hg commit -m "edit files yet again"
160 $ cat ../normal3
160 $ cat ../normal3
161 normal33
161 normal33
162 $ cat ../large3
162 $ cat ../large3
163 large33
163 large33
164 $ cat normal4
164 $ cat normal4
165 normal44
165 normal44
166 $ cat large4
166 $ cat large4
167 large44
167 large44
168
168
169 Committing standins is not allowed.
169 Committing standins is not allowed.
170
170
171 $ cd ..
171 $ cd ..
172 $ echo large3 > large3
172 $ echo large3 > large3
173 $ hg commit .hglf/large3 -m "try to commit standin"
173 $ hg commit .hglf/large3 -m "try to commit standin"
174 abort: file ".hglf/large3" is a largefile standin
174 abort: file ".hglf/large3" is a largefile standin
175 (commit the largefile itself instead)
175 (commit the largefile itself instead)
176 [255]
176 [255]
177
177
178 Corner cases for adding largefiles.
178 Corner cases for adding largefiles.
179
179
180 $ echo large5 > large5
180 $ echo large5 > large5
181 $ hg add --large large5
181 $ hg add --large large5
182 $ hg add --large large5
182 $ hg add --large large5
183 large5 already a largefile
183 large5 already a largefile
184 $ mkdir sub2
184 $ mkdir sub2
185 $ echo large6 > sub2/large6
185 $ echo large6 > sub2/large6
186 $ echo large7 > sub2/large7
186 $ echo large7 > sub2/large7
187 $ hg add --large sub2
187 $ hg add --large sub2
188 adding sub2/large6 as a largefile
188 adding sub2/large6 as a largefile (glob)
189 adding sub2/large7 as a largefile
189 adding sub2/large7 as a largefile (glob)
190 $ hg st
190 $ hg st
191 M large3
191 M large3
192 A large5
192 A large5
193 A sub2/large6
193 A sub2/large6
194 A sub2/large7
194 A sub2/large7
195
195
196 Config settings (pattern **.dat, minsize 2 MB) are respected.
196 Config settings (pattern **.dat, minsize 2 MB) are respected.
197
197
198 $ echo testdata > test.dat
198 $ echo testdata > test.dat
199 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
199 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
200 $ hg add
200 $ hg add
201 adding reallylarge as a largefile
201 adding reallylarge as a largefile
202 adding test.dat as a largefile
202 adding test.dat as a largefile
203
203
204 Test that minsize and --lfsize handle float values;
204 Test that minsize and --lfsize handle float values;
205 also tests that --lfsize overrides largefiles.minsize.
205 also tests that --lfsize overrides largefiles.minsize.
206 (0.250 MB = 256 kB = 262144 B)
206 (0.250 MB = 256 kB = 262144 B)
207
207
208 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
208 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
209 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
209 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
210 $ hg --config largefiles.minsize=.25 add
210 $ hg --config largefiles.minsize=.25 add
211 adding ratherlarge as a largefile
211 adding ratherlarge as a largefile
212 adding medium
212 adding medium
213 $ hg forget medium
213 $ hg forget medium
214 $ hg --config largefiles.minsize=.25 add --lfsize=.125
214 $ hg --config largefiles.minsize=.25 add --lfsize=.125
215 adding medium as a largefile
215 adding medium as a largefile
216 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
216 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
217 $ hg --config largefiles.minsize=.25 add --lfsize=.125
217 $ hg --config largefiles.minsize=.25 add --lfsize=.125
218 adding notlarge
218 adding notlarge
219 $ hg forget notlarge
219 $ hg forget notlarge
220
220
221 Test forget on largefiles.
221 Test forget on largefiles.
222
222
223 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
223 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
224 $ hg st
224 $ hg st
225 A sub2/large6
225 A sub2/large6
226 A sub2/large7
226 A sub2/large7
227 R large3
227 R large3
228 ? large5
228 ? large5
229 ? medium
229 ? medium
230 ? notlarge
230 ? notlarge
231 ? ratherlarge
231 ? ratherlarge
232 ? reallylarge
232 ? reallylarge
233 ? test.dat
233 ? test.dat
234 $ hg commit -m "add/edit more largefiles"
234 $ hg commit -m "add/edit more largefiles"
235 $ hg st
235 $ hg st
236 ? large3
236 ? large3
237 ? large5
237 ? large5
238 ? medium
238 ? medium
239 ? notlarge
239 ? notlarge
240 ? ratherlarge
240 ? ratherlarge
241 ? reallylarge
241 ? reallylarge
242 ? test.dat
242 ? test.dat
243
243
244 Purge with largefiles: verify that largefiles are still in the working
244 Purge with largefiles: verify that largefiles are still in the working
245 dir after a purge.
245 dir after a purge.
246
246
247 $ hg purge --all
247 $ hg purge --all
248 $ cat sub/large4
248 $ cat sub/large4
249 large44
249 large44
250 $ cat sub2/large6
250 $ cat sub2/large6
251 large6
251 large6
252 $ cat sub2/large7
252 $ cat sub2/large7
253 large7
253 large7
254
254
255 Clone a largefiles repo.
255 Clone a largefiles repo.
256
256
257 $ cd ..
257 $ cd ..
258 $ hg clone a b
258 $ hg clone a b
259 updating to branch default
259 updating to branch default
260 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
261 getting changed largefiles
261 getting changed largefiles
262 3 largefiles updated, 0 removed
262 3 largefiles updated, 0 removed
263 $ cd b
263 $ cd b
264 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
264 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
265 7:daea875e9014 add/edit more largefiles
265 7:daea875e9014 add/edit more largefiles
266 6:4355d653f84f edit files yet again
266 6:4355d653f84f edit files yet again
267 5:9d5af5072dbd edit files again
267 5:9d5af5072dbd edit files again
268 4:74c02385b94c move files
268 4:74c02385b94c move files
269 3:9e8fbc4bce62 copy files
269 3:9e8fbc4bce62 copy files
270 2:51a0ae4d5864 remove files
270 2:51a0ae4d5864 remove files
271 1:ce8896473775 edit files
271 1:ce8896473775 edit files
272 0:30d30fe6a5be add files
272 0:30d30fe6a5be add files
273 $ cat normal3
273 $ cat normal3
274 normal33
274 normal33
275 $ cat sub/normal4
275 $ cat sub/normal4
276 normal44
276 normal44
277 $ cat sub/large4
277 $ cat sub/large4
278 large44
278 large44
279 $ cat sub2/large6
279 $ cat sub2/large6
280 large6
280 large6
281 $ cat sub2/large7
281 $ cat sub2/large7
282 large7
282 large7
283 $ cd ..
283 $ cd ..
284 $ hg clone a -r 3 c
284 $ hg clone a -r 3 c
285 adding changesets
285 adding changesets
286 adding manifests
286 adding manifests
287 adding file changes
287 adding file changes
288 added 4 changesets with 10 changes to 4 files
288 added 4 changesets with 10 changes to 4 files
289 updating to branch default
289 updating to branch default
290 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 getting changed largefiles
291 getting changed largefiles
292 2 largefiles updated, 0 removed
292 2 largefiles updated, 0 removed
293 $ cd c
293 $ cd c
294 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
294 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
295 3:9e8fbc4bce62 copy files
295 3:9e8fbc4bce62 copy files
296 2:51a0ae4d5864 remove files
296 2:51a0ae4d5864 remove files
297 1:ce8896473775 edit files
297 1:ce8896473775 edit files
298 0:30d30fe6a5be add files
298 0:30d30fe6a5be add files
299 $ cat normal1
299 $ cat normal1
300 normal22
300 normal22
301 $ cat large1
301 $ cat large1
302 large22
302 large22
303 $ cat sub/normal2
303 $ cat sub/normal2
304 normal22
304 normal22
305 $ cat sub/large2
305 $ cat sub/large2
306 large22
306 large22
307
307
308 Old revisions of a clone have correct largefiles content (this also
308 Old revisions of a clone have correct largefiles content (this also
309 tests update).
309 tests update).
310
310
311 $ hg update -r 1
311 $ hg update -r 1
312 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
312 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
313 getting changed largefiles
313 getting changed largefiles
314 1 largefiles updated, 0 removed
314 1 largefiles updated, 0 removed
315 $ cat large1
315 $ cat large1
316 large11
316 large11
317 $ cat sub/large2
317 $ cat sub/large2
318 large22
318 large22
319
319
320 Rebasing between two repositories does not revert largefiles to old
320 Rebasing between two repositories does not revert largefiles to old
321 revisions (this was a very bad bug that took a lot of work to fix).
321 revisions (this was a very bad bug that took a lot of work to fix).
322
322
323 $ cd ..
323 $ cd ..
324 $ hg clone a d
324 $ hg clone a d
325 updating to branch default
325 updating to branch default
326 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
326 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
327 getting changed largefiles
327 getting changed largefiles
328 3 largefiles updated, 0 removed
328 3 largefiles updated, 0 removed
329 $ cd b
329 $ cd b
330 $ echo large4-modified > sub/large4
330 $ echo large4-modified > sub/large4
331 $ echo normal3-modified > normal3
331 $ echo normal3-modified > normal3
332 $ hg commit -m "modify normal file and largefile in repo b"
332 $ hg commit -m "modify normal file and largefile in repo b"
333 $ cd ../d
333 $ cd ../d
334 $ echo large6-modified > sub2/large6
334 $ echo large6-modified > sub2/large6
335 $ echo normal4-modified > sub/normal4
335 $ echo normal4-modified > sub/normal4
336 $ hg commit -m "modify normal file largefile in repo d"
336 $ hg commit -m "modify normal file largefile in repo d"
337 $ cd ..
337 $ cd ..
338 $ hg clone d e
338 $ hg clone d e
339 updating to branch default
339 updating to branch default
340 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 getting changed largefiles
341 getting changed largefiles
342 3 largefiles updated, 0 removed
342 3 largefiles updated, 0 removed
343 $ cd d
343 $ cd d
344 $ hg pull --rebase ../b
344 $ hg pull --rebase ../b
345 pulling from ../b
345 pulling from ../b
346 searching for changes
346 searching for changes
347 adding changesets
347 adding changesets
348 adding manifests
348 adding manifests
349 adding file changes
349 adding file changes
350 added 1 changesets with 2 changes to 2 files (+1 heads)
350 added 1 changesets with 2 changes to 2 files (+1 heads)
351 getting changed largefiles
351 getting changed largefiles
352 1 largefiles updated, 0 removed
352 1 largefiles updated, 0 removed
353 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg
353 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
354 nothing to rebase
354 nothing to rebase
355 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
355 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
356 9:598410d3eb9a modify normal file largefile in repo d
356 9:598410d3eb9a modify normal file largefile in repo d
357 8:a381d2c8c80e modify normal file and largefile in repo b
357 8:a381d2c8c80e modify normal file and largefile in repo b
358 7:daea875e9014 add/edit more largefiles
358 7:daea875e9014 add/edit more largefiles
359 6:4355d653f84f edit files yet again
359 6:4355d653f84f edit files yet again
360 5:9d5af5072dbd edit files again
360 5:9d5af5072dbd edit files again
361 4:74c02385b94c move files
361 4:74c02385b94c move files
362 3:9e8fbc4bce62 copy files
362 3:9e8fbc4bce62 copy files
363 2:51a0ae4d5864 remove files
363 2:51a0ae4d5864 remove files
364 1:ce8896473775 edit files
364 1:ce8896473775 edit files
365 0:30d30fe6a5be add files
365 0:30d30fe6a5be add files
366 $ cat normal3
366 $ cat normal3
367 normal3-modified
367 normal3-modified
368 $ cat sub/normal4
368 $ cat sub/normal4
369 normal4-modified
369 normal4-modified
370 $ cat sub/large4
370 $ cat sub/large4
371 large4-modified
371 large4-modified
372 $ cat sub2/large6
372 $ cat sub2/large6
373 large6-modified
373 large6-modified
374 $ cat sub2/large7
374 $ cat sub2/large7
375 large7
375 large7
376 $ cd ../e
376 $ cd ../e
377 $ hg pull ../b
377 $ hg pull ../b
378 pulling from ../b
378 pulling from ../b
379 searching for changes
379 searching for changes
380 adding changesets
380 adding changesets
381 adding manifests
381 adding manifests
382 adding file changes
382 adding file changes
383 added 1 changesets with 2 changes to 2 files (+1 heads)
383 added 1 changesets with 2 changes to 2 files (+1 heads)
384 (run 'hg heads' to see heads, 'hg merge' to merge)
384 (run 'hg heads' to see heads, 'hg merge' to merge)
385 $ hg rebase
385 $ hg rebase
386 getting changed largefiles
386 getting changed largefiles
387 1 largefiles updated, 0 removed
387 1 largefiles updated, 0 removed
388 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg
388 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
389 $ hg log
389 $ hg log
390 changeset: 9:598410d3eb9a
390 changeset: 9:598410d3eb9a
391 tag: tip
391 tag: tip
392 user: test
392 user: test
393 date: Thu Jan 01 00:00:00 1970 +0000
393 date: Thu Jan 01 00:00:00 1970 +0000
394 summary: modify normal file largefile in repo d
394 summary: modify normal file largefile in repo d
395
395
396 changeset: 8:a381d2c8c80e
396 changeset: 8:a381d2c8c80e
397 user: test
397 user: test
398 date: Thu Jan 01 00:00:00 1970 +0000
398 date: Thu Jan 01 00:00:00 1970 +0000
399 summary: modify normal file and largefile in repo b
399 summary: modify normal file and largefile in repo b
400
400
401 changeset: 7:daea875e9014
401 changeset: 7:daea875e9014
402 user: test
402 user: test
403 date: Thu Jan 01 00:00:00 1970 +0000
403 date: Thu Jan 01 00:00:00 1970 +0000
404 summary: add/edit more largefiles
404 summary: add/edit more largefiles
405
405
406 changeset: 6:4355d653f84f
406 changeset: 6:4355d653f84f
407 user: test
407 user: test
408 date: Thu Jan 01 00:00:00 1970 +0000
408 date: Thu Jan 01 00:00:00 1970 +0000
409 summary: edit files yet again
409 summary: edit files yet again
410
410
411 changeset: 5:9d5af5072dbd
411 changeset: 5:9d5af5072dbd
412 user: test
412 user: test
413 date: Thu Jan 01 00:00:00 1970 +0000
413 date: Thu Jan 01 00:00:00 1970 +0000
414 summary: edit files again
414 summary: edit files again
415
415
416 changeset: 4:74c02385b94c
416 changeset: 4:74c02385b94c
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:00 1970 +0000
418 date: Thu Jan 01 00:00:00 1970 +0000
419 summary: move files
419 summary: move files
420
420
421 changeset: 3:9e8fbc4bce62
421 changeset: 3:9e8fbc4bce62
422 user: test
422 user: test
423 date: Thu Jan 01 00:00:00 1970 +0000
423 date: Thu Jan 01 00:00:00 1970 +0000
424 summary: copy files
424 summary: copy files
425
425
426 changeset: 2:51a0ae4d5864
426 changeset: 2:51a0ae4d5864
427 user: test
427 user: test
428 date: Thu Jan 01 00:00:00 1970 +0000
428 date: Thu Jan 01 00:00:00 1970 +0000
429 summary: remove files
429 summary: remove files
430
430
431 changeset: 1:ce8896473775
431 changeset: 1:ce8896473775
432 user: test
432 user: test
433 date: Thu Jan 01 00:00:00 1970 +0000
433 date: Thu Jan 01 00:00:00 1970 +0000
434 summary: edit files
434 summary: edit files
435
435
436 changeset: 0:30d30fe6a5be
436 changeset: 0:30d30fe6a5be
437 user: test
437 user: test
438 date: Thu Jan 01 00:00:00 1970 +0000
438 date: Thu Jan 01 00:00:00 1970 +0000
439 summary: add files
439 summary: add files
440
440
441 $ cat normal3
441 $ cat normal3
442 normal3-modified
442 normal3-modified
443 $ cat sub/normal4
443 $ cat sub/normal4
444 normal4-modified
444 normal4-modified
445 $ cat sub/large4
445 $ cat sub/large4
446 large4-modified
446 large4-modified
447 $ cat sub2/large6
447 $ cat sub2/large6
448 large6-modified
448 large6-modified
449 $ cat sub2/large7
449 $ cat sub2/large7
450 large7
450 large7
451
451
452 Rollback on largefiles.
452 Rollback on largefiles.
453
453
454 $ echo large4-modified-again > sub/large4
454 $ echo large4-modified-again > sub/large4
455 $ hg commit -m "Modify large4 again"
455 $ hg commit -m "Modify large4 again"
456 $ hg rollback
456 $ hg rollback
457 repository tip rolled back to revision 9 (undo commit)
457 repository tip rolled back to revision 9 (undo commit)
458 working directory now based on revision 9
458 working directory now based on revision 9
459 $ hg st
459 $ hg st
460 M sub/large4
460 M sub/large4
461 $ hg log
461 $ hg log
462 changeset: 9:598410d3eb9a
462 changeset: 9:598410d3eb9a
463 tag: tip
463 tag: tip
464 user: test
464 user: test
465 date: Thu Jan 01 00:00:00 1970 +0000
465 date: Thu Jan 01 00:00:00 1970 +0000
466 summary: modify normal file largefile in repo d
466 summary: modify normal file largefile in repo d
467
467
468 changeset: 8:a381d2c8c80e
468 changeset: 8:a381d2c8c80e
469 user: test
469 user: test
470 date: Thu Jan 01 00:00:00 1970 +0000
470 date: Thu Jan 01 00:00:00 1970 +0000
471 summary: modify normal file and largefile in repo b
471 summary: modify normal file and largefile in repo b
472
472
473 changeset: 7:daea875e9014
473 changeset: 7:daea875e9014
474 user: test
474 user: test
475 date: Thu Jan 01 00:00:00 1970 +0000
475 date: Thu Jan 01 00:00:00 1970 +0000
476 summary: add/edit more largefiles
476 summary: add/edit more largefiles
477
477
478 changeset: 6:4355d653f84f
478 changeset: 6:4355d653f84f
479 user: test
479 user: test
480 date: Thu Jan 01 00:00:00 1970 +0000
480 date: Thu Jan 01 00:00:00 1970 +0000
481 summary: edit files yet again
481 summary: edit files yet again
482
482
483 changeset: 5:9d5af5072dbd
483 changeset: 5:9d5af5072dbd
484 user: test
484 user: test
485 date: Thu Jan 01 00:00:00 1970 +0000
485 date: Thu Jan 01 00:00:00 1970 +0000
486 summary: edit files again
486 summary: edit files again
487
487
488 changeset: 4:74c02385b94c
488 changeset: 4:74c02385b94c
489 user: test
489 user: test
490 date: Thu Jan 01 00:00:00 1970 +0000
490 date: Thu Jan 01 00:00:00 1970 +0000
491 summary: move files
491 summary: move files
492
492
493 changeset: 3:9e8fbc4bce62
493 changeset: 3:9e8fbc4bce62
494 user: test
494 user: test
495 date: Thu Jan 01 00:00:00 1970 +0000
495 date: Thu Jan 01 00:00:00 1970 +0000
496 summary: copy files
496 summary: copy files
497
497
498 changeset: 2:51a0ae4d5864
498 changeset: 2:51a0ae4d5864
499 user: test
499 user: test
500 date: Thu Jan 01 00:00:00 1970 +0000
500 date: Thu Jan 01 00:00:00 1970 +0000
501 summary: remove files
501 summary: remove files
502
502
503 changeset: 1:ce8896473775
503 changeset: 1:ce8896473775
504 user: test
504 user: test
505 date: Thu Jan 01 00:00:00 1970 +0000
505 date: Thu Jan 01 00:00:00 1970 +0000
506 summary: edit files
506 summary: edit files
507
507
508 changeset: 0:30d30fe6a5be
508 changeset: 0:30d30fe6a5be
509 user: test
509 user: test
510 date: Thu Jan 01 00:00:00 1970 +0000
510 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: add files
511 summary: add files
512
512
513 $ cat sub/large4
513 $ cat sub/large4
514 large4-modified-again
514 large4-modified-again
515
515
516 "update --check" refuses to update with uncommitted changes.
516 "update --check" refuses to update with uncommitted changes.
517 $ hg update --check 8
517 $ hg update --check 8
518 abort: uncommitted local changes
518 abort: uncommitted local changes
519 [255]
519 [255]
520
520
521 "update --clean" leaves correct largefiles in working copy.
521 "update --clean" leaves correct largefiles in working copy.
522
522
523 $ hg update --clean
523 $ hg update --clean
524 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
524 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
525 getting changed largefiles
525 getting changed largefiles
526 1 largefiles updated, 0 removed
526 1 largefiles updated, 0 removed
527 $ cat normal3
527 $ cat normal3
528 normal3-modified
528 normal3-modified
529 $ cat sub/normal4
529 $ cat sub/normal4
530 normal4-modified
530 normal4-modified
531 $ cat sub/large4
531 $ cat sub/large4
532 large4-modified
532 large4-modified
533 $ cat sub2/large6
533 $ cat sub2/large6
534 large6-modified
534 large6-modified
535 $ cat sub2/large7
535 $ cat sub2/large7
536 large7
536 large7
537
537
538 Now "update check" is happy.
538 Now "update check" is happy.
539 $ hg update --check 8
539 $ hg update --check 8
540 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
541 getting changed largefiles
541 getting changed largefiles
542 1 largefiles updated, 0 removed
542 1 largefiles updated, 0 removed
543 $ hg update --check
543 $ hg update --check
544 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
545 getting changed largefiles
545 getting changed largefiles
546 1 largefiles updated, 0 removed
546 1 largefiles updated, 0 removed
547
547
548 "revert" works on largefiles (and normal files too).
548 "revert" works on largefiles (and normal files too).
549 $ echo hack3 >> normal3
549 $ echo hack3 >> normal3
550 $ echo hack4 >> sub/normal4
550 $ echo hack4 >> sub/normal4
551 $ echo hack4 >> sub/large4
551 $ echo hack4 >> sub/large4
552 $ hg rm sub2/large6
552 $ hg rm sub2/large6
553 $ echo new >> sub2/large8
553 $ echo new >> sub2/large8
554 $ hg add --large sub2/large8
554 $ hg add --large sub2/large8
555 # XXX we don't really want to report that we're reverting the standin;
555 # XXX we don't really want to report that we're reverting the standin;
556 # that's just an implementation detail. But I don't see an obvious fix. ;-(
556 # that's just an implementation detail. But I don't see an obvious fix. ;-(
557 $ hg revert sub
557 $ hg revert sub
558 reverting .hglf/sub/large4
558 reverting .hglf/sub/large4 (glob)
559 reverting sub/normal4
559 reverting sub/normal4 (glob)
560 $ hg status
560 $ hg status
561 M normal3
561 M normal3
562 A sub2/large8
562 A sub2/large8
563 R sub2/large6
563 R sub2/large6
564 ? sub/large4.orig
564 ? sub/large4.orig
565 ? sub/normal4.orig
565 ? sub/normal4.orig
566 $ cat sub/normal4
566 $ cat sub/normal4
567 normal4-modified
567 normal4-modified
568 $ cat sub/large4
568 $ cat sub/large4
569 large4-modified
569 large4-modified
570 $ hg revert -a --no-backup
570 $ hg revert -a --no-backup
571 undeleting .hglf/sub2/large6
571 undeleting .hglf/sub2/large6 (glob)
572 forgetting .hglf/sub2/large8
572 forgetting .hglf/sub2/large8 (glob)
573 reverting normal3
573 reverting normal3
574 $ hg status
574 $ hg status
575 ? sub/large4.orig
575 ? sub/large4.orig
576 ? sub/normal4.orig
576 ? sub/normal4.orig
577 ? sub2/large8
577 ? sub2/large8
578 $ cat normal3
578 $ cat normal3
579 normal3-modified
579 normal3-modified
580 $ cat sub2/large6
580 $ cat sub2/large6
581 large6-modified
581 large6-modified
582 $ rm sub/*.orig sub2/large8
582 $ rm sub/*.orig sub2/large8
583
583
584 revert some files to an older revision
584 revert some files to an older revision
585 $ hg revert --no-backup -r 8 sub2
585 $ hg revert --no-backup -r 8 sub2
586 reverting .hglf/sub2/large6
586 reverting .hglf/sub2/large6 (glob)
587 $ cat sub2/large6
587 $ cat sub2/large6
588 large6
588 large6
589 $ hg revert --no-backup sub2
589 $ hg revert --no-backup sub2
590 reverting .hglf/sub2/large6
590 reverting .hglf/sub2/large6 (glob)
591 $ hg status
591 $ hg status
592
592
593 "verify --large" actually verifies largefiles
593 "verify --large" actually verifies largefiles
594
594
595 $ hg verify --large
595 $ hg verify --large
596 checking changesets
596 checking changesets
597 checking manifests
597 checking manifests
598 crosschecking files in changesets and manifests
598 crosschecking files in changesets and manifests
599 checking files
599 checking files
600 10 files, 10 changesets, 28 total revisions
600 10 files, 10 changesets, 28 total revisions
601 searching 1 changesets for largefiles
601 searching 1 changesets for largefiles
602 verified existence of 3 revisions of 3 largefiles
602 verified existence of 3 revisions of 3 largefiles
603
603
604 Merging does not revert to old versions of largefiles (this has also
604 Merging does not revert to old versions of largefiles (this has also
605 been very problematic).
605 been very problematic).
606
606
607 $ cd ..
607 $ cd ..
608 $ hg clone -r 7 e f
608 $ hg clone -r 7 e f
609 adding changesets
609 adding changesets
610 adding manifests
610 adding manifests
611 adding file changes
611 adding file changes
612 added 8 changesets with 24 changes to 10 files
612 added 8 changesets with 24 changes to 10 files
613 updating to branch default
613 updating to branch default
614 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
614 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
615 getting changed largefiles
615 getting changed largefiles
616 3 largefiles updated, 0 removed
616 3 largefiles updated, 0 removed
617 $ cd f
617 $ cd f
618 $ echo "large4-merge-test" > sub/large4
618 $ echo "large4-merge-test" > sub/large4
619 $ hg commit -m "Modify large4 to test merge"
619 $ hg commit -m "Modify large4 to test merge"
620 $ hg pull ../e
620 $ hg pull ../e
621 pulling from ../e
621 pulling from ../e
622 searching for changes
622 searching for changes
623 adding changesets
623 adding changesets
624 adding manifests
624 adding manifests
625 adding file changes
625 adding file changes
626 added 2 changesets with 4 changes to 4 files (+1 heads)
626 added 2 changesets with 4 changes to 4 files (+1 heads)
627 (run 'hg heads' to see heads, 'hg merge' to merge)
627 (run 'hg heads' to see heads, 'hg merge' to merge)
628 $ hg merge
628 $ hg merge
629 merging sub/large4
629 merging sub/large4
630 largefile sub/large4 has a merge conflict
630 largefile sub/large4 has a merge conflict
631 keep (l)ocal or take (o)ther? l
631 keep (l)ocal or take (o)ther? l
632 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
632 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
633 (branch merge, don't forget to commit)
633 (branch merge, don't forget to commit)
634 getting changed largefiles
634 getting changed largefiles
635 1 largefiles updated, 0 removed
635 1 largefiles updated, 0 removed
636 $ hg commit -m "Merge repos e and f"
636 $ hg commit -m "Merge repos e and f"
637 $ cat normal3
637 $ cat normal3
638 normal3-modified
638 normal3-modified
639 $ cat sub/normal4
639 $ cat sub/normal4
640 normal4-modified
640 normal4-modified
641 $ cat sub/large4
641 $ cat sub/large4
642 large4-merge-test
642 large4-merge-test
643 $ cat sub2/large6
643 $ cat sub2/large6
644 large6-modified
644 large6-modified
645 $ cat sub2/large7
645 $ cat sub2/large7
646 large7
646 large7
647
647
648 Test that a normal file and a largefile with the same name and path cannot
648 Test that a normal file and a largefile with the same name and path cannot
649 coexist.
649 coexist.
650
650
651 $ rm sub2/large7
651 $ rm sub2/large7
652 $ echo "largeasnormal" > sub2/large7
652 $ echo "largeasnormal" > sub2/large7
653 $ hg add sub2/large7
653 $ hg add sub2/large7
654 sub2/large7 already a largefile
654 sub2/large7 already a largefile
655
655
656 Test that transplanting a largefile change works correctly.
656 Test that transplanting a largefile change works correctly.
657
657
658 $ cd ..
658 $ cd ..
659 $ hg clone -r 8 d g
659 $ hg clone -r 8 d g
660 adding changesets
660 adding changesets
661 adding manifests
661 adding manifests
662 adding file changes
662 adding file changes
663 added 9 changesets with 26 changes to 10 files
663 added 9 changesets with 26 changes to 10 files
664 updating to branch default
664 updating to branch default
665 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
665 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
666 getting changed largefiles
666 getting changed largefiles
667 3 largefiles updated, 0 removed
667 3 largefiles updated, 0 removed
668 $ cd g
668 $ cd g
669 $ hg transplant -s ../d 598410d3eb9a
669 $ hg transplant -s ../d 598410d3eb9a
670 searching for changes
670 searching for changes
671 searching for changes
671 searching for changes
672 adding changesets
672 adding changesets
673 adding manifests
673 adding manifests
674 adding file changes
674 adding file changes
675 added 1 changesets with 2 changes to 2 files
675 added 1 changesets with 2 changes to 2 files
676 getting changed largefiles
676 getting changed largefiles
677 1 largefiles updated, 0 removed
677 1 largefiles updated, 0 removed
678 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
678 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
679 9:598410d3eb9a modify normal file largefile in repo d
679 9:598410d3eb9a modify normal file largefile in repo d
680 8:a381d2c8c80e modify normal file and largefile in repo b
680 8:a381d2c8c80e modify normal file and largefile in repo b
681 7:daea875e9014 add/edit more largefiles
681 7:daea875e9014 add/edit more largefiles
682 6:4355d653f84f edit files yet again
682 6:4355d653f84f edit files yet again
683 5:9d5af5072dbd edit files again
683 5:9d5af5072dbd edit files again
684 4:74c02385b94c move files
684 4:74c02385b94c move files
685 3:9e8fbc4bce62 copy files
685 3:9e8fbc4bce62 copy files
686 2:51a0ae4d5864 remove files
686 2:51a0ae4d5864 remove files
687 1:ce8896473775 edit files
687 1:ce8896473775 edit files
688 0:30d30fe6a5be add files
688 0:30d30fe6a5be add files
689 $ cat normal3
689 $ cat normal3
690 normal3-modified
690 normal3-modified
691 $ cat sub/normal4
691 $ cat sub/normal4
692 normal4-modified
692 normal4-modified
693 $ cat sub/large4
693 $ cat sub/large4
694 large4-modified
694 large4-modified
695 $ cat sub2/large6
695 $ cat sub2/large6
696 large6-modified
696 large6-modified
697 $ cat sub2/large7
697 $ cat sub2/large7
698 large7
698 large7
699 $ cd ..
699 $ cd ..
700
700
701 vanilla clients not locked out from largefiles servers on vanilla repos
701 vanilla clients not locked out from largefiles servers on vanilla repos
702 $ mkdir r1
702 $ mkdir r1
703 $ cd r1
703 $ cd r1
704 $ hg init
704 $ hg init
705 $ echo c1 > f1
705 $ echo c1 > f1
706 $ hg add f1
706 $ hg add f1
707 $ hg com -m "m1"
707 $ hg com -m "m1"
708 $ cd ..
708 $ cd ..
709 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
709 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
710 $ cat hg.pid >> $DAEMON_PIDS
710 $ cat hg.pid >> $DAEMON_PIDS
711 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
711 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
712 requesting all changes
712 requesting all changes
713 adding changesets
713 adding changesets
714 adding manifests
714 adding manifests
715 adding file changes
715 adding file changes
716 added 1 changesets with 1 changes to 1 files
716 added 1 changesets with 1 changes to 1 files
717 updating to branch default
717 updating to branch default
718 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
718 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
719
719
720 largefiles clients still work with vanilla servers
720 largefiles clients still work with vanilla servers
721 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
721 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
722 $ cat hg.pid >> $DAEMON_PIDS
722 $ cat hg.pid >> $DAEMON_PIDS
723 $ hg clone http://localhost:$HGPORT1 r3
723 $ hg clone http://localhost:$HGPORT1 r3
724 requesting all changes
724 requesting all changes
725 adding changesets
725 adding changesets
726 adding manifests
726 adding manifests
727 adding file changes
727 adding file changes
728 added 1 changesets with 1 changes to 1 files
728 added 1 changesets with 1 changes to 1 files
729 updating to branch default
729 updating to branch default
730 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
730 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
731
731
732 vanilla clients locked out from largefiles http repos
732 vanilla clients locked out from largefiles http repos
733 $ mkdir r4
733 $ mkdir r4
734 $ cd r4
734 $ cd r4
735 $ hg init
735 $ hg init
736 $ echo c1 > f1
736 $ echo c1 > f1
737 $ hg add --large f1
737 $ hg add --large f1
738 $ hg com -m "m1"
738 $ hg com -m "m1"
739 $ cd ..
739 $ cd ..
740 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
740 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
741 $ cat hg.pid >> $DAEMON_PIDS
741 $ cat hg.pid >> $DAEMON_PIDS
742 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
742 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
743 abort: remote error:
743 abort: remote error:
744
744
745 This repository uses the largefiles extension.
745 This repository uses the largefiles extension.
746
746
747 Please enable it in your Mercurial config file.
747 Please enable it in your Mercurial config file.
748 [255]
748 [255]
749
749
750 used all HGPORTs, kill all daemons
750 used all HGPORTs, kill all daemons
751 $ "$TESTDIR/killdaemons.py"
751 $ "$TESTDIR/killdaemons.py"
752
752
753 vanilla clients locked out from largefiles ssh repos
753 vanilla clients locked out from largefiles ssh repos
754 $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5
754 $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5
755 abort: remote error:
755 abort: remote error:
756
756
757 This repository uses the largefiles extension.
757 This repository uses the largefiles extension.
758
758
759 Please enable it in your Mercurial config file.
759 Please enable it in your Mercurial config file.
760 [255]
760 [255]
761
761
762 largefiles clients refuse to push largefiles repos to vanilla servers
762 largefiles clients refuse to push largefiles repos to vanilla servers
763 $ mkdir r6
763 $ mkdir r6
764 $ cd r6
764 $ cd r6
765 $ hg init
765 $ hg init
766 $ echo c1 > f1
766 $ echo c1 > f1
767 $ hg add f1
767 $ hg add f1
768 $ hg com -m "m1"
768 $ hg com -m "m1"
769 $ cat >> .hg/hgrc <<!
769 $ cat >> .hg/hgrc <<!
770 > [web]
770 > [web]
771 > push_ssl = false
771 > push_ssl = false
772 > allow_push = *
772 > allow_push = *
773 > !
773 > !
774 $ cd ..
774 $ cd ..
775 $ hg clone r6 r7
775 $ hg clone r6 r7
776 updating to branch default
776 updating to branch default
777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
777 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 $ cd r7
778 $ cd r7
779 $ echo c2 > f2
779 $ echo c2 > f2
780 $ hg add --large f2
780 $ hg add --large f2
781 $ hg com -m "m2"
781 $ hg com -m "m2"
782 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
782 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
783 $ cat ../hg.pid >> $DAEMON_PIDS
783 $ cat ../hg.pid >> $DAEMON_PIDS
784 $ hg push http://localhost:$HGPORT
784 $ hg push http://localhost:$HGPORT
785 pushing to http://localhost:$HGPORT/
785 pushing to http://localhost:$HGPORT/
786 searching for changes
786 searching for changes
787 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
787 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
788 [255]
788 [255]
789 $ cd ..
789 $ cd ..
790
790
791 $ cd ..
791 $ cd ..
792
792
793 Clone a local repository owned by another user
793 Clone a local repository owned by another user
794 We have to simulate that here by setting $HOME and removing write permissions
794 We have to simulate that here by setting $HOME and removing write permissions
795 $ ORIGHOME="$HOME"
795 $ ORIGHOME="$HOME"
796 $ mkdir alice
796 $ mkdir alice
797 $ HOME="`pwd`/alice"
797 $ HOME="`pwd`/alice"
798 $ cd alice
798 $ cd alice
799 $ hg init pubrepo
799 $ hg init pubrepo
800 $ cd pubrepo
800 $ cd pubrepo
801 $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null
801 $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null
802 $ hg add --large a-large-file
802 $ hg add --large a-large-file
803 $ hg commit -m "Add a large file"
803 $ hg commit -m "Add a large file"
804 $ cd ..
804 $ cd ..
805 $ chmod -R a-w pubrepo
805 $ chmod -R a-w pubrepo
806 $ cd ..
806 $ cd ..
807 $ mkdir bob
807 $ mkdir bob
808 $ HOME="`pwd`/bob"
808 $ HOME="`pwd`/bob"
809 $ cd bob
809 $ cd bob
810 $ hg clone --pull ../alice/pubrepo pubrepo
810 $ hg clone --pull ../alice/pubrepo pubrepo
811 requesting all changes
811 requesting all changes
812 adding changesets
812 adding changesets
813 adding manifests
813 adding manifests
814 adding file changes
814 adding file changes
815 added 1 changesets with 1 changes to 1 files
815 added 1 changesets with 1 changes to 1 files
816 updating to branch default
816 updating to branch default
817 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
817 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
818 getting changed largefiles
818 getting changed largefiles
819 1 largefiles updated, 0 removed
819 1 largefiles updated, 0 removed
820 $ cd ..
820 $ cd ..
821 $ HOME="$ORIGHOME"
821 $ HOME="$ORIGHOME"
822
822
823 Symlink to a large largefile should behave the same as a symlink to a normal file
823 Symlink to a large largefile should behave the same as a symlink to a normal file
824 $ hg init largesymlink
824 $ hg init largesymlink
825 $ cd largesymlink
825 $ cd largesymlink
826 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
826 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
827 $ hg add --large largefile
827 $ hg add --large largefile
828 $ hg commit -m "commit a large file"
828 $ hg commit -m "commit a large file"
829 $ ln -s largefile largelink
829 $ ln -s largefile largelink
830 $ hg add largelink
830 $ hg add largelink
831 $ hg commit -m "commit a large symlink"
831 $ hg commit -m "commit a large symlink"
832 $ rm -f largelink
832 $ rm -f largelink
833 $ hg up >/dev/null
833 $ hg up >/dev/null
834 $ test -f largelink
834 $ test -f largelink
835 [1]
835 [1]
836 $ test -L largelink
836 $ test -L largelink
837 [1]
837 [1]
838 $ rm -f largelink # make next part of the test independent of the previous
838 $ rm -f largelink # make next part of the test independent of the previous
839 $ hg up -C >/dev/null
839 $ hg up -C >/dev/null
840 $ test -f largelink
840 $ test -f largelink
841 $ test -L largelink
841 $ test -L largelink
842 $ cd ..
842 $ cd ..
843
843
844
844
@@ -1,232 +1,232 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > largefiles =
3 > largefiles =
4 > share =
4 > share =
5 > graphlog =
5 > graphlog =
6 > [largefiles]
6 > [largefiles]
7 > minsize = 0.5
7 > minsize = 0.5
8 > patterns = **.dat
8 > patterns = **.dat
9 > EOF
9 > EOF
10
10
11 "lfconvert" works
11 "lfconvert" works
12 $ hg init bigfile-repo
12 $ hg init bigfile-repo
13 $ cd bigfile-repo
13 $ cd bigfile-repo
14 $ cat >> .hg/hgrc <<EOF
14 $ cat >> .hg/hgrc <<EOF
15 > [extensions]
15 > [extensions]
16 > largefiles = !
16 > largefiles = !
17 > EOF
17 > EOF
18 $ mkdir sub
18 $ mkdir sub
19 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
19 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
20 $ echo normal > normal1
20 $ echo normal > normal1
21 $ echo alsonormal > sub/normal2
21 $ echo alsonormal > sub/normal2
22 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
22 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
23 $ hg addremove
23 $ hg addremove
24 adding large
24 adding large
25 adding normal1
25 adding normal1
26 adding sub/maybelarge.dat
26 adding sub/maybelarge.dat
27 adding sub/normal2
27 adding sub/normal2
28 $ hg commit -m"add large, normal1" large normal1
28 $ hg commit -m"add large, normal1" large normal1
29 $ hg commit -m"add sub/*" sub
29 $ hg commit -m"add sub/*" sub
30 $ [ -d .hg/largefiles ] && echo fail || echo pass
30 $ [ -d .hg/largefiles ] && echo fail || echo pass
31 pass
31 pass
32 $ cd ..
32 $ cd ..
33 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
33 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
34 initializing destination largefiles-repo
34 initializing destination largefiles-repo
35
35
36 "lfconvert" converts content correctly
36 "lfconvert" converts content correctly
37 $ cd largefiles-repo
37 $ cd largefiles-repo
38 $ hg up
38 $ hg up
39 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 getting changed largefiles
40 getting changed largefiles
41 2 largefiles updated, 0 removed
41 2 largefiles updated, 0 removed
42 $ hg locate
42 $ hg locate
43 .hglf/large
43 .hglf/large
44 .hglf/sub/maybelarge.dat
44 .hglf/sub/maybelarge.dat
45 normal1
45 normal1
46 sub/normal2
46 sub/normal2
47 $ cat normal1
47 $ cat normal1
48 normal
48 normal
49 $ cat sub/normal2
49 $ cat sub/normal2
50 alsonormal
50 alsonormal
51 $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat
51 $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat
52 ec87a838931d4d5d2e94a04644788a55 large
52 ec87a838931d4d5d2e94a04644788a55 large
53 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
53 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
54
54
55 "lfconvert" adds 'largefiles' to .hg/requires.
55 "lfconvert" adds 'largefiles' to .hg/requires.
56 $ cat .hg/requires
56 $ cat .hg/requires
57 largefiles
57 largefiles
58 revlogv1
58 revlogv1
59 fncache
59 fncache
60 store
60 store
61 dotencode
61 dotencode
62
62
63 "lfconvert" includes a newline at the end of the standin files.
63 "lfconvert" includes a newline at the end of the standin files.
64 $ cat .hglf/large .hglf/sub/maybelarge.dat
64 $ cat .hglf/large .hglf/sub/maybelarge.dat
65 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
65 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
66 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
66 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
67 $ cd ..
67 $ cd ..
68
68
69 add some changesets to rename/remove/merge
69 add some changesets to rename/remove/merge
70 $ cd bigfile-repo
70 $ cd bigfile-repo
71 $ hg mv -q sub stuff
71 $ hg mv -q sub stuff
72 $ hg commit -m"rename sub/ to stuff/"
72 $ hg commit -m"rename sub/ to stuff/"
73 $ hg update -q 1
73 $ hg update -q 1
74 $ echo blah >> normal3
74 $ echo blah >> normal3
75 $ echo blah >> sub/normal2
75 $ echo blah >> sub/normal2
76 $ echo blah >> sub/maybelarge.dat
76 $ echo blah >> sub/maybelarge.dat
77 $ "$TESTDIR/md5sum.py" sub/maybelarge.dat
77 $ "$TESTDIR/md5sum.py" sub/maybelarge.dat
78 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
78 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
79 $ hg commit -A -m"add normal3, modify sub/*"
79 $ hg commit -A -m"add normal3, modify sub/*"
80 adding normal3
80 adding normal3
81 created new head
81 created new head
82 $ hg rm large normal3
82 $ hg rm large normal3
83 $ hg commit -q -m"remove large, normal3"
83 $ hg commit -q -m"remove large, normal3"
84 $ hg merge
84 $ hg merge
85 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
85 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
86 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file.
86 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob)
87 merging stuff/maybelarge.dat failed!
87 merging stuff/maybelarge.dat failed!
88 merging sub/normal2 and stuff/normal2 to stuff/normal2
88 merging sub/normal2 and stuff/normal2 to stuff/normal2
89 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
89 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
90 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
90 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
91 [1]
91 [1]
92 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
92 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
93 $ hg resolve -m stuff/maybelarge.dat
93 $ hg resolve -m stuff/maybelarge.dat
94 $ hg commit -m"merge"
94 $ hg commit -m"merge"
95 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
95 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
96 @ 5:4884f215abda merge
96 @ 5:4884f215abda merge
97 |\
97 |\
98 | o 4:7285f817b77e remove large, normal3
98 | o 4:7285f817b77e remove large, normal3
99 | |
99 | |
100 | o 3:67e3892e3534 add normal3, modify sub/*
100 | o 3:67e3892e3534 add normal3, modify sub/*
101 | |
101 | |
102 o | 2:c96c8beb5d56 rename sub/ to stuff/
102 o | 2:c96c8beb5d56 rename sub/ to stuff/
103 |/
103 |/
104 o 1:020c65d24e11 add sub/*
104 o 1:020c65d24e11 add sub/*
105 |
105 |
106 o 0:117b8328f97a add large, normal1
106 o 0:117b8328f97a add large, normal1
107
107
108 $ cd ..
108 $ cd ..
109
109
110 lfconvert with rename, merge, and remove
110 lfconvert with rename, merge, and remove
111 $ rm -rf largefiles-repo
111 $ rm -rf largefiles-repo
112 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
112 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
113 initializing destination largefiles-repo
113 initializing destination largefiles-repo
114 $ cd largefiles-repo
114 $ cd largefiles-repo
115 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
115 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
116 o 5:8e05f5f2b77e merge
116 o 5:8e05f5f2b77e merge
117 |\
117 |\
118 | o 4:a5a02de7a8e4 remove large, normal3
118 | o 4:a5a02de7a8e4 remove large, normal3
119 | |
119 | |
120 | o 3:55759520c76f add normal3, modify sub/*
120 | o 3:55759520c76f add normal3, modify sub/*
121 | |
121 | |
122 o | 2:261ad3f3f037 rename sub/ to stuff/
122 o | 2:261ad3f3f037 rename sub/ to stuff/
123 |/
123 |/
124 o 1:334e5237836d add sub/*
124 o 1:334e5237836d add sub/*
125 |
125 |
126 o 0:d4892ec57ce2 add large, normal1
126 o 0:d4892ec57ce2 add large, normal1
127
127
128 $ hg locate -r 2
128 $ hg locate -r 2
129 .hglf/large
129 .hglf/large
130 .hglf/stuff/maybelarge.dat
130 .hglf/stuff/maybelarge.dat
131 normal1
131 normal1
132 stuff/normal2
132 stuff/normal2
133 $ hg locate -r 3
133 $ hg locate -r 3
134 .hglf/large
134 .hglf/large
135 .hglf/sub/maybelarge.dat
135 .hglf/sub/maybelarge.dat
136 normal1
136 normal1
137 normal3
137 normal3
138 sub/normal2
138 sub/normal2
139 $ hg locate -r 4
139 $ hg locate -r 4
140 .hglf/sub/maybelarge.dat
140 .hglf/sub/maybelarge.dat
141 normal1
141 normal1
142 sub/normal2
142 sub/normal2
143 $ hg locate -r 5
143 $ hg locate -r 5
144 .hglf/stuff/maybelarge.dat
144 .hglf/stuff/maybelarge.dat
145 normal1
145 normal1
146 stuff/normal2
146 stuff/normal2
147 $ hg update
147 $ hg update
148 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 getting changed largefiles
149 getting changed largefiles
150 1 largefiles updated, 0 removed
150 1 largefiles updated, 0 removed
151 $ cat stuff/normal2
151 $ cat stuff/normal2
152 alsonormal
152 alsonormal
153 blah
153 blah
154 $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat
154 $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat
155 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
155 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
156 $ cat .hglf/stuff/maybelarge.dat
156 $ cat .hglf/stuff/maybelarge.dat
157 76236b6a2c6102826c61af4297dd738fb3b1de38
157 76236b6a2c6102826c61af4297dd738fb3b1de38
158 $ cd ..
158 $ cd ..
159
159
160 "lfconvert" error cases
160 "lfconvert" error cases
161 $ hg lfconvert http://localhost/foo foo
161 $ hg lfconvert http://localhost/foo foo
162 abort: http://localhost/foo is not a local Mercurial repo
162 abort: http://localhost/foo is not a local Mercurial repo
163 [255]
163 [255]
164 $ hg lfconvert foo ssh://localhost/foo
164 $ hg lfconvert foo ssh://localhost/foo
165 abort: ssh://localhost/foo is not a local Mercurial repo
165 abort: ssh://localhost/foo is not a local Mercurial repo
166 [255]
166 [255]
167 $ hg lfconvert nosuchrepo foo
167 $ hg lfconvert nosuchrepo foo
168 abort: repository nosuchrepo not found!
168 abort: repository nosuchrepo not found!
169 [255]
169 [255]
170 $ hg share -q -U bigfile-repo shared
170 $ hg share -q -U bigfile-repo shared
171 $ printf 'bogus' > shared/.hg/sharedpath
171 $ printf 'bogus' > shared/.hg/sharedpath
172 $ hg lfconvert shared foo
172 $ hg lfconvert shared foo
173 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus!
173 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob)
174 [255]
174 [255]
175 $ hg lfconvert bigfile-repo largefiles-repo
175 $ hg lfconvert bigfile-repo largefiles-repo
176 initializing destination largefiles-repo
176 initializing destination largefiles-repo
177 abort: repository largefiles-repo already exists!
177 abort: repository largefiles-repo already exists!
178 [255]
178 [255]
179
179
180 add another largefile to the new largefiles repo
180 add another largefile to the new largefiles repo
181 $ cd largefiles-repo
181 $ cd largefiles-repo
182 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
182 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
183 $ hg add --lfsize=1 anotherlarge
183 $ hg add --lfsize=1 anotherlarge
184 $ hg commit -m "add anotherlarge (should be a largefile)"
184 $ hg commit -m "add anotherlarge (should be a largefile)"
185 $ cat .hglf/anotherlarge
185 $ cat .hglf/anotherlarge
186 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
186 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
187 $ cd ..
187 $ cd ..
188
188
189 round-trip: converting back to a normal (non-largefiles) repo with
189 round-trip: converting back to a normal (non-largefiles) repo with
190 "lfconvert --to-normal" should give the same as ../bigfile-repo
190 "lfconvert --to-normal" should give the same as ../bigfile-repo
191 $ cd largefiles-repo
191 $ cd largefiles-repo
192 $ hg lfconvert --to-normal . ../normal-repo
192 $ hg lfconvert --to-normal . ../normal-repo
193 initializing destination ../normal-repo
193 initializing destination ../normal-repo
194 $ cd ../normal-repo
194 $ cd ../normal-repo
195 $ cat >> .hg/hgrc <<EOF
195 $ cat >> .hg/hgrc <<EOF
196 > [extensions]
196 > [extensions]
197 > largefiles = !
197 > largefiles = !
198 > EOF
198 > EOF
199
199
200 # Hmmm: the changeset ID for rev 5 is different from the original
200 # Hmmm: the changeset ID for rev 5 is different from the original
201 # normal repo (../bigfile-repo), because the changelog filelist
201 # normal repo (../bigfile-repo), because the changelog filelist
202 # differs between the two incarnations of rev 5: this repo includes
202 # differs between the two incarnations of rev 5: this repo includes
203 # 'large' in the list, but ../bigfile-repo does not. Since rev 5
203 # 'large' in the list, but ../bigfile-repo does not. Since rev 5
204 # removes 'large' relative to the first parent in both repos, it seems
204 # removes 'large' relative to the first parent in both repos, it seems
205 # to me that lfconvert is doing a *better* job than
205 # to me that lfconvert is doing a *better* job than
206 # "hg remove" + "hg merge" + "hg commit".
206 # "hg remove" + "hg merge" + "hg commit".
207 # $ hg -R ../bigfile-repo debugdata -c 5
207 # $ hg -R ../bigfile-repo debugdata -c 5
208 # $ hg debugdata -c 5
208 # $ hg debugdata -c 5
209 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
209 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
210 o 6:1635824e6f59 add anotherlarge (should be a largefile)
210 o 6:1635824e6f59 add anotherlarge (should be a largefile)
211 |
211 |
212 o 5:7215f8deeaaf merge
212 o 5:7215f8deeaaf merge
213 |\
213 |\
214 | o 4:7285f817b77e remove large, normal3
214 | o 4:7285f817b77e remove large, normal3
215 | |
215 | |
216 | o 3:67e3892e3534 add normal3, modify sub/*
216 | o 3:67e3892e3534 add normal3, modify sub/*
217 | |
217 | |
218 o | 2:c96c8beb5d56 rename sub/ to stuff/
218 o | 2:c96c8beb5d56 rename sub/ to stuff/
219 |/
219 |/
220 o 1:020c65d24e11 add sub/*
220 o 1:020c65d24e11 add sub/*
221 |
221 |
222 o 0:117b8328f97a add large, normal1
222 o 0:117b8328f97a add large, normal1
223
223
224 $ hg update
224 $ hg update
225 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
225 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 $ hg locate
226 $ hg locate
227 anotherlarge
227 anotherlarge
228 normal1
228 normal1
229 stuff/maybelarge.dat
229 stuff/maybelarge.dat
230 stuff/normal2
230 stuff/normal2
231 $ [ -d .hg/largefiles ] && echo fail || echo pass
231 $ [ -d .hg/largefiles ] && echo fail || echo pass
232 pass
232 pass
@@ -1,120 +1,120 b''
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3 $ echo 0 > a
3 $ echo 0 > a
4 $ echo 0 > b
4 $ echo 0 > b
5 $ echo 0 > t.h
5 $ echo 0 > t.h
6 $ mkdir t
6 $ mkdir t
7 $ echo 0 > t/x
7 $ echo 0 > t/x
8 $ echo 0 > t/b
8 $ echo 0 > t/b
9 $ echo 0 > t/e.h
9 $ echo 0 > t/e.h
10 $ mkdir dir.h
10 $ mkdir dir.h
11 $ echo 0 > dir.h/foo
11 $ echo 0 > dir.h/foo
12
12
13 $ hg ci -A -m m
13 $ hg ci -A -m m
14 adding a
14 adding a
15 adding b
15 adding b
16 adding dir.h/foo
16 adding dir.h/foo
17 adding t.h
17 adding t.h
18 adding t/b
18 adding t/b
19 adding t/e.h
19 adding t/e.h
20 adding t/x
20 adding t/x
21
21
22 $ touch nottracked
22 $ touch nottracked
23
23
24 $ hg locate a
24 $ hg locate a
25 a
25 a
26
26
27 $ hg locate NONEXISTENT
27 $ hg locate NONEXISTENT
28 [1]
28 [1]
29
29
30 $ hg locate
30 $ hg locate
31 a
31 a
32 b
32 b
33 dir.h/foo
33 dir.h/foo
34 t.h
34 t.h
35 t/b
35 t/b
36 t/e.h
36 t/e.h
37 t/x
37 t/x
38
38
39 $ hg rm a
39 $ hg rm a
40 $ hg ci -m m
40 $ hg ci -m m
41
41
42 $ hg locate a
42 $ hg locate a
43 [1]
43 [1]
44 $ hg locate NONEXISTENT
44 $ hg locate NONEXISTENT
45 [1]
45 [1]
46 $ hg locate relpath:NONEXISTENT
46 $ hg locate relpath:NONEXISTENT
47 [1]
47 [1]
48 $ hg locate
48 $ hg locate
49 b
49 b
50 dir.h/foo
50 dir.h/foo
51 t.h
51 t.h
52 t/b
52 t/b
53 t/e.h
53 t/e.h
54 t/x
54 t/x
55 $ hg locate -r 0 a
55 $ hg locate -r 0 a
56 a
56 a
57 $ hg locate -r 0 NONEXISTENT
57 $ hg locate -r 0 NONEXISTENT
58 [1]
58 [1]
59 $ hg locate -r 0 relpath:NONEXISTENT
59 $ hg locate -r 0 relpath:NONEXISTENT
60 [1]
60 [1]
61 $ hg locate -r 0
61 $ hg locate -r 0
62 a
62 a
63 b
63 b
64 dir.h/foo
64 dir.h/foo
65 t.h
65 t.h
66 t/b
66 t/b
67 t/e.h
67 t/e.h
68 t/x
68 t/x
69
69
70 -I/-X with relative path should work:
70 -I/-X with relative path should work:
71
71
72 $ cd t
72 $ cd t
73 $ hg locate
73 $ hg locate
74 b
74 b
75 dir.h/foo
75 dir.h/foo
76 t.h
76 t.h
77 t/b
77 t/b
78 t/e.h
78 t/e.h
79 t/x
79 t/x
80 $ hg locate -I ../t
80 $ hg locate -I ../t
81 t/b
81 t/b
82 t/e.h
82 t/e.h
83 t/x
83 t/x
84
84
85 Issue294: hg remove --after dir fails when dir.* also exists
85 Issue294: hg remove --after dir fails when dir.* also exists
86
86
87 $ cd ..
87 $ cd ..
88 $ rm -r t
88 $ rm -r t
89
89
90 $ hg locate 't/**'
90 $ hg locate 't/**'
91 t/b
91 t/b (glob)
92 t/e.h
92 t/e.h (glob)
93 t/x
93 t/x (glob)
94
94
95 $ mkdir otherdir
95 $ mkdir otherdir
96 $ cd otherdir
96 $ cd otherdir
97
97
98 $ hg locate b
98 $ hg locate b
99 ../b
99 ../b (glob)
100 ../t/b
100 ../t/b (glob)
101 $ hg locate '*.h'
101 $ hg locate '*.h'
102 ../t.h
102 ../t.h (glob)
103 ../t/e.h
103 ../t/e.h (glob)
104 $ hg locate path:t/x
104 $ hg locate path:t/x
105 ../t/x
105 ../t/x (glob)
106 $ hg locate 're:.*\.h$'
106 $ hg locate 're:.*\.h$'
107 ../t.h
107 ../t.h (glob)
108 ../t/e.h
108 ../t/e.h (glob)
109 $ hg locate -r 0 b
109 $ hg locate -r 0 b
110 ../b
110 ../b (glob)
111 ../t/b
111 ../t/b (glob)
112 $ hg locate -r 0 '*.h'
112 $ hg locate -r 0 '*.h'
113 ../t.h
113 ../t.h (glob)
114 ../t/e.h
114 ../t/e.h (glob)
115 $ hg locate -r 0 path:t/x
115 $ hg locate -r 0 path:t/x
116 ../t/x
116 ../t/x (glob)
117 $ hg locate -r 0 're:.*\.h$'
117 $ hg locate -r 0 're:.*\.h$'
118 ../t.h
118 ../t.h (glob)
119 ../t/e.h
119 ../t/e.h (glob)
120
120
@@ -1,177 +1,177 b''
1 Setup extension:
1 Setup extension:
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "mq =" >> $HGRCPATH
4 $ echo "mq =" >> $HGRCPATH
5 $ echo "[mq]" >> $HGRCPATH
5 $ echo "[mq]" >> $HGRCPATH
6 $ echo "git = keep" >> $HGRCPATH
6 $ echo "git = keep" >> $HGRCPATH
7
7
8 Test merge with mq changeset as the second parent:
8 Test merge with mq changeset as the second parent:
9
9
10 $ hg init m
10 $ hg init m
11 $ cd m
11 $ cd m
12 $ touch a b c
12 $ touch a b c
13 $ hg add a
13 $ hg add a
14 $ hg commit -m a
14 $ hg commit -m a
15 $ hg add b
15 $ hg add b
16 $ hg qnew -d "0 0" b
16 $ hg qnew -d "0 0" b
17 $ hg update 0
17 $ hg update 0
18 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
18 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
19 $ hg add c
19 $ hg add c
20 $ hg commit -m c
20 $ hg commit -m c
21 created new head
21 created new head
22 $ hg merge
22 $ hg merge
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 (branch merge, don't forget to commit)
24 (branch merge, don't forget to commit)
25 $ hg commit -m merge
25 $ hg commit -m merge
26 abort: cannot commit over an applied mq patch
26 abort: cannot commit over an applied mq patch
27 [255]
27 [255]
28 $ cd ..
28 $ cd ..
29
29
30 Issue529: mq aborts when merging patch deleting files
30 Issue529: mq aborts when merging patch deleting files
31
31
32 $ checkundo()
32 $ checkundo()
33 > {
33 > {
34 > if [ -f .hg/store/undo ]; then
34 > if [ -f .hg/store/undo ]; then
35 > echo ".hg/store/undo still exists"
35 > echo ".hg/store/undo still exists"
36 > fi
36 > fi
37 > }
37 > }
38
38
39 Commit two dummy files in "init" changeset:
39 Commit two dummy files in "init" changeset:
40
40
41 $ hg init t
41 $ hg init t
42 $ cd t
42 $ cd t
43 $ echo a > a
43 $ echo a > a
44 $ echo b > b
44 $ echo b > b
45 $ hg ci -Am init
45 $ hg ci -Am init
46 adding a
46 adding a
47 adding b
47 adding b
48 $ hg tag -l init
48 $ hg tag -l init
49
49
50 Create a patch removing a:
50 Create a patch removing a:
51
51
52 $ hg qnew rm_a
52 $ hg qnew rm_a
53 $ hg rm a
53 $ hg rm a
54 $ hg qrefresh -m "rm a"
54 $ hg qrefresh -m "rm a"
55
55
56 Save the patch queue so we can merge it later:
56 Save the patch queue so we can merge it later:
57
57
58 $ hg qsave -c -e
58 $ hg qsave -c -e
59 copy $TESTTMP/t/.hg/patches to $TESTTMP/t/.hg/patches.1
59 copy $TESTTMP/t/.hg/patches to $TESTTMP/t/.hg/patches.1 (glob)
60 $ checkundo
60 $ checkundo
61
61
62 Update b and commit in an "update" changeset:
62 Update b and commit in an "update" changeset:
63
63
64 $ hg up -C init
64 $ hg up -C init
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 $ echo b >> b
66 $ echo b >> b
67 $ hg st
67 $ hg st
68 M b
68 M b
69 $ hg ci -m update
69 $ hg ci -m update
70 created new head
70 created new head
71
71
72 # Here, qpush used to abort with :
72 # Here, qpush used to abort with :
73 # The system cannot find the file specified => a
73 # The system cannot find the file specified => a
74 $ hg manifest
74 $ hg manifest
75 a
75 a
76 b
76 b
77
77
78 $ hg qpush -a -m
78 $ hg qpush -a -m
79 merging with queue at: $TESTTMP/t/.hg/patches.1
79 merging with queue at: $TESTTMP/t/.hg/patches.1 (glob)
80 applying rm_a
80 applying rm_a
81 now at: rm_a
81 now at: rm_a
82
82
83 $ checkundo
83 $ checkundo
84 $ hg manifest
84 $ hg manifest
85 b
85 b
86
86
87 Ensure status is correct after merge:
87 Ensure status is correct after merge:
88
88
89 $ hg qpop -a
89 $ hg qpop -a
90 popping rm_a
90 popping rm_a
91 popping .hg.patches.merge.marker
91 popping .hg.patches.merge.marker
92 patch queue now empty
92 patch queue now empty
93
93
94 $ cd ..
94 $ cd ..
95
95
96 Classic MQ merge sequence *with an explicit named queue*:
96 Classic MQ merge sequence *with an explicit named queue*:
97
97
98 $ hg init t2
98 $ hg init t2
99 $ cd t2
99 $ cd t2
100 $ echo '[diff]' > .hg/hgrc
100 $ echo '[diff]' > .hg/hgrc
101 $ echo 'nodates = 1' >> .hg/hgrc
101 $ echo 'nodates = 1' >> .hg/hgrc
102 $ echo a > a
102 $ echo a > a
103 $ hg ci -Am init
103 $ hg ci -Am init
104 adding a
104 adding a
105 $ echo b > a
105 $ echo b > a
106 $ hg ci -m changea
106 $ hg ci -m changea
107 $ hg up -C 0
107 $ hg up -C 0
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 $ hg cp a aa
109 $ hg cp a aa
110 $ echo c >> a
110 $ echo c >> a
111 $ hg qnew --git -f -e patcha
111 $ hg qnew --git -f -e patcha
112 $ echo d >> a
112 $ echo d >> a
113 $ hg qnew -d '0 0' -f -e patcha2
113 $ hg qnew -d '0 0' -f -e patcha2
114
114
115 Create the reference queue:
115 Create the reference queue:
116
116
117 $ hg qsave -c -e -n refqueue
117 $ hg qsave -c -e -n refqueue
118 copy $TESTTMP/t2/.hg/patches to $TESTTMP/t2/.hg/refqueue
118 copy $TESTTMP/t2/.hg/patches to $TESTTMP/t2/.hg/refqueue (glob)
119 $ hg up -C 1
119 $ hg up -C 1
120 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
120 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
121
121
122 Merge:
122 Merge:
123
123
124 $ HGMERGE=internal:other hg qpush -a -m -n refqueue
124 $ HGMERGE=internal:other hg qpush -a -m -n refqueue
125 merging with queue at: $TESTTMP/t2/.hg/refqueue
125 merging with queue at: $TESTTMP/t2/.hg/refqueue (glob)
126 applying patcha
126 applying patcha
127 patching file a
127 patching file a
128 Hunk #1 FAILED at 0
128 Hunk #1 FAILED at 0
129 1 out of 1 hunks FAILED -- saving rejects to file a.rej
129 1 out of 1 hunks FAILED -- saving rejects to file a.rej
130 patch failed, unable to continue (try -v)
130 patch failed, unable to continue (try -v)
131 patch failed, rejects left in working dir
131 patch failed, rejects left in working dir
132 patch didn't work out, merging patcha
132 patch didn't work out, merging patcha
133 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
133 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
134 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
134 0 files updated, 2 files merged, 0 files removed, 0 files unresolved
135 (branch merge, don't forget to commit)
135 (branch merge, don't forget to commit)
136 applying patcha2
136 applying patcha2
137 now at: patcha2
137 now at: patcha2
138
138
139 Check patcha is still a git patch:
139 Check patcha is still a git patch:
140
140
141 $ cat .hg/patches/patcha
141 $ cat .hg/patches/patcha
142 # HG changeset patch
142 # HG changeset patch
143 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
143 # Parent d3873e73d99ef67873dac33fbcc66268d5d2b6f4
144
144
145 diff --git a/a b/a
145 diff --git a/a b/a
146 --- a/a
146 --- a/a
147 +++ b/a
147 +++ b/a
148 @@ -1,1 +1,2 @@
148 @@ -1,1 +1,2 @@
149 -b
149 -b
150 +a
150 +a
151 +c
151 +c
152 diff --git a/a b/aa
152 diff --git a/a b/aa
153 copy from a
153 copy from a
154 copy to aa
154 copy to aa
155 --- a/a
155 --- a/a
156 +++ b/aa
156 +++ b/aa
157 @@ -1,1 +1,1 @@
157 @@ -1,1 +1,1 @@
158 -b
158 -b
159 +a
159 +a
160
160
161 Check patcha2 is still a regular patch:
161 Check patcha2 is still a regular patch:
162
162
163 $ cat .hg/patches/patcha2
163 $ cat .hg/patches/patcha2
164 # HG changeset patch
164 # HG changeset patch
165 # Parent ???????????????????????????????????????? (glob)
165 # Parent ???????????????????????????????????????? (glob)
166 # Date 0 0
166 # Date 0 0
167
167
168 diff -r ???????????? -r ???????????? a (glob)
168 diff -r ???????????? -r ???????????? a (glob)
169 --- a/a
169 --- a/a
170 +++ b/a
170 +++ b/a
171 @@ -1,2 +1,3 @@
171 @@ -1,2 +1,3 @@
172 a
172 a
173 c
173 c
174 +d
174 +d
175
175
176 $ cd ..
176 $ cd ..
177
177
@@ -1,175 +1,175 b''
1 $ echo '[extensions]' >> $HGRCPATH
1 $ echo '[extensions]' >> $HGRCPATH
2 $ echo 'mq =' >> $HGRCPATH
2 $ echo 'mq =' >> $HGRCPATH
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 $ hg ci -qAm 'add a file'
8 $ hg ci -qAm 'add a file'
9
9
10 $ hg qinit
10 $ hg qinit
11
11
12 $ hg qnew foo
12 $ hg qnew foo
13 $ echo foo >> foo
13 $ echo foo >> foo
14 $ hg qrefresh -m 'append foo'
14 $ hg qrefresh -m 'append foo'
15
15
16 $ hg qnew bar
16 $ hg qnew bar
17 $ echo bar >> foo
17 $ echo bar >> foo
18 $ hg qrefresh -m 'append bar'
18 $ hg qrefresh -m 'append bar'
19
19
20
20
21 try to commit on top of a patch
21 try to commit on top of a patch
22
22
23 $ echo quux >> foo
23 $ echo quux >> foo
24 $ hg ci -m 'append quux'
24 $ hg ci -m 'append quux'
25 abort: cannot commit over an applied mq patch
25 abort: cannot commit over an applied mq patch
26 [255]
26 [255]
27
27
28
28
29 cheat a bit...
29 cheat a bit...
30
30
31 $ mv .hg/patches .hg/patches2
31 $ mv .hg/patches .hg/patches2
32 $ hg ci -m 'append quux'
32 $ hg ci -m 'append quux'
33 $ mv .hg/patches2 .hg/patches
33 $ mv .hg/patches2 .hg/patches
34
34
35
35
36 qpop/qrefresh on the wrong revision
36 qpop/qrefresh on the wrong revision
37
37
38 $ hg qpop
38 $ hg qpop
39 abort: popping would remove a revision not managed by this patch queue
39 abort: popping would remove a revision not managed by this patch queue
40 [255]
40 [255]
41 $ hg qpop -n patches
41 $ hg qpop -n patches
42 using patch queue: $TESTTMP/repo/.hg/patches
42 using patch queue: $TESTTMP/repo/.hg/patches (glob)
43 abort: popping would remove a revision not managed by this patch queue
43 abort: popping would remove a revision not managed by this patch queue
44 [255]
44 [255]
45 $ hg qrefresh
45 $ hg qrefresh
46 abort: working directory revision is not qtip
46 abort: working directory revision is not qtip
47 [255]
47 [255]
48
48
49 $ hg up -C qtip
49 $ hg up -C qtip
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 $ hg qpop
51 $ hg qpop
52 abort: popping would remove a revision not managed by this patch queue
52 abort: popping would remove a revision not managed by this patch queue
53 [255]
53 [255]
54 $ hg qrefresh
54 $ hg qrefresh
55 abort: cannot refresh a revision with children
55 abort: cannot refresh a revision with children
56 [255]
56 [255]
57 $ hg tip --template '{rev} {desc}\n'
57 $ hg tip --template '{rev} {desc}\n'
58 3 append quux
58 3 append quux
59
59
60
60
61 qpush warning branchheads
61 qpush warning branchheads
62
62
63 $ cd ..
63 $ cd ..
64 $ hg init branchy
64 $ hg init branchy
65 $ cd branchy
65 $ cd branchy
66 $ echo q > q
66 $ echo q > q
67 $ hg add q
67 $ hg add q
68 $ hg qnew -f qp
68 $ hg qnew -f qp
69 $ hg qpop
69 $ hg qpop
70 popping qp
70 popping qp
71 patch queue now empty
71 patch queue now empty
72 $ echo a > a
72 $ echo a > a
73 $ hg ci -Ama
73 $ hg ci -Ama
74 adding a
74 adding a
75 $ hg up null
75 $ hg up null
76 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
76 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
77 $ hg branch b
77 $ hg branch b
78 marked working directory as branch b
78 marked working directory as branch b
79 $ echo c > c
79 $ echo c > c
80 $ hg ci -Amc
80 $ hg ci -Amc
81 adding c
81 adding c
82 $ hg merge default
82 $ hg merge default
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 (branch merge, don't forget to commit)
84 (branch merge, don't forget to commit)
85 $ hg ci -mmerge
85 $ hg ci -mmerge
86 $ hg up default
86 $ hg up default
87 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
87 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
88 $ hg log
88 $ hg log
89 changeset: 2:65309210bf4e
89 changeset: 2:65309210bf4e
90 branch: b
90 branch: b
91 tag: tip
91 tag: tip
92 parent: 1:707adb4c8ae1
92 parent: 1:707adb4c8ae1
93 parent: 0:cb9a9f314b8b
93 parent: 0:cb9a9f314b8b
94 user: test
94 user: test
95 date: Thu Jan 01 00:00:00 1970 +0000
95 date: Thu Jan 01 00:00:00 1970 +0000
96 summary: merge
96 summary: merge
97
97
98 changeset: 1:707adb4c8ae1
98 changeset: 1:707adb4c8ae1
99 branch: b
99 branch: b
100 parent: -1:000000000000
100 parent: -1:000000000000
101 user: test
101 user: test
102 date: Thu Jan 01 00:00:00 1970 +0000
102 date: Thu Jan 01 00:00:00 1970 +0000
103 summary: c
103 summary: c
104
104
105 changeset: 0:cb9a9f314b8b
105 changeset: 0:cb9a9f314b8b
106 user: test
106 user: test
107 date: Thu Jan 01 00:00:00 1970 +0000
107 date: Thu Jan 01 00:00:00 1970 +0000
108 summary: a
108 summary: a
109
109
110 $ hg qpush
110 $ hg qpush
111 applying qp
111 applying qp
112 now at: qp
112 now at: qp
113
113
114 Testing applied patches, push and --force
114 Testing applied patches, push and --force
115
115
116 $ cd ..
116 $ cd ..
117 $ hg init forcepush
117 $ hg init forcepush
118 $ cd forcepush
118 $ cd forcepush
119 $ echo a > a
119 $ echo a > a
120 $ hg ci -Am adda
120 $ hg ci -Am adda
121 adding a
121 adding a
122 $ echo a >> a
122 $ echo a >> a
123 $ hg ci -m changea
123 $ hg ci -m changea
124 $ hg up 0
124 $ hg up 0
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 $ hg branch branch
126 $ hg branch branch
127 marked working directory as branch branch
127 marked working directory as branch branch
128 $ echo b > b
128 $ echo b > b
129 $ hg ci -Am addb
129 $ hg ci -Am addb
130 adding b
130 adding b
131 $ hg up 0
131 $ hg up 0
132 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
132 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
133 $ hg --cwd .. clone -r 0 forcepush forcepush2
133 $ hg --cwd .. clone -r 0 forcepush forcepush2
134 adding changesets
134 adding changesets
135 adding manifests
135 adding manifests
136 adding file changes
136 adding file changes
137 added 1 changesets with 1 changes to 1 files
137 added 1 changesets with 1 changes to 1 files
138 updating to branch default
138 updating to branch default
139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 $ echo a >> a
140 $ echo a >> a
141 $ hg qnew patch
141 $ hg qnew patch
142
142
143 Pushing applied patch with --rev without --force
143 Pushing applied patch with --rev without --force
144
144
145 $ hg push -r default ../forcepush2
145 $ hg push -r default ../forcepush2
146 pushing to ../forcepush2
146 pushing to ../forcepush2
147 abort: source has mq patches applied
147 abort: source has mq patches applied
148 [255]
148 [255]
149
149
150 Pushing applied patch with branchhash, without --force
150 Pushing applied patch with branchhash, without --force
151
151
152 $ hg push ../forcepush2#default
152 $ hg push ../forcepush2#default
153 pushing to ../forcepush2
153 pushing to ../forcepush2
154 abort: source has mq patches applied
154 abort: source has mq patches applied
155 [255]
155 [255]
156
156
157 Pushing revs excluding applied patch
157 Pushing revs excluding applied patch
158
158
159 $ hg push --new-branch -r branch -r 2 ../forcepush2
159 $ hg push --new-branch -r branch -r 2 ../forcepush2
160 pushing to ../forcepush2
160 pushing to ../forcepush2
161 searching for changes
161 searching for changes
162 adding changesets
162 adding changesets
163 adding manifests
163 adding manifests
164 adding file changes
164 adding file changes
165 added 1 changesets with 1 changes to 1 files
165 added 1 changesets with 1 changes to 1 files
166
166
167 Pushing applied patch with --force
167 Pushing applied patch with --force
168
168
169 $ hg push --force -r default ../forcepush2
169 $ hg push --force -r default ../forcepush2
170 pushing to ../forcepush2
170 pushing to ../forcepush2
171 searching for changes
171 searching for changes
172 adding changesets
172 adding changesets
173 adding manifests
173 adding manifests
174 adding file changes
174 adding file changes
175 added 1 changesets with 1 changes to 1 files (+1 heads)
175 added 1 changesets with 1 changes to 1 files (+1 heads)
@@ -1,1396 +1,1396 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
1 $ "$TESTDIR/hghave" execbit || exit 80
2
2
3 $ checkundo()
3 $ checkundo()
4 > {
4 > {
5 > if [ -f .hg/store/undo ]; then
5 > if [ -f .hg/store/undo ]; then
6 > echo ".hg/store/undo still exists after $1"
6 > echo ".hg/store/undo still exists after $1"
7 > fi
7 > fi
8 > }
8 > }
9
9
10 $ echo "[extensions]" >> $HGRCPATH
10 $ echo "[extensions]" >> $HGRCPATH
11 $ echo "mq=" >> $HGRCPATH
11 $ echo "mq=" >> $HGRCPATH
12
12
13 $ echo "[mq]" >> $HGRCPATH
13 $ echo "[mq]" >> $HGRCPATH
14 $ echo "plain=true" >> $HGRCPATH
14 $ echo "plain=true" >> $HGRCPATH
15
15
16
16
17 help
17 help
18
18
19 $ hg help mq
19 $ hg help mq
20 mq extension - manage a stack of patches
20 mq extension - manage a stack of patches
21
21
22 This extension lets you work with a stack of patches in a Mercurial
22 This extension lets you work with a stack of patches in a Mercurial
23 repository. It manages two stacks of patches - all known patches, and applied
23 repository. It manages two stacks of patches - all known patches, and applied
24 patches (subset of known patches).
24 patches (subset of known patches).
25
25
26 Known patches are represented as patch files in the .hg/patches directory.
26 Known patches are represented as patch files in the .hg/patches directory.
27 Applied patches are both patch files and changesets.
27 Applied patches are both patch files and changesets.
28
28
29 Common tasks (use "hg help command" for more details):
29 Common tasks (use "hg help command" for more details):
30
30
31 create new patch qnew
31 create new patch qnew
32 import existing patch qimport
32 import existing patch qimport
33
33
34 print patch series qseries
34 print patch series qseries
35 print applied patches qapplied
35 print applied patches qapplied
36
36
37 add known patch to applied stack qpush
37 add known patch to applied stack qpush
38 remove patch from applied stack qpop
38 remove patch from applied stack qpop
39 refresh contents of top applied patch qrefresh
39 refresh contents of top applied patch qrefresh
40
40
41 By default, mq will automatically use git patches when required to avoid
41 By default, mq will automatically use git patches when required to avoid
42 losing file mode changes, copy records, binary files or empty files creations
42 losing file mode changes, copy records, binary files or empty files creations
43 or deletions. This behaviour can be configured with:
43 or deletions. This behaviour can be configured with:
44
44
45 [mq]
45 [mq]
46 git = auto/keep/yes/no
46 git = auto/keep/yes/no
47
47
48 If set to 'keep', mq will obey the [diff] section configuration while
48 If set to 'keep', mq will obey the [diff] section configuration while
49 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
49 preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq
50 will override the [diff] section and always generate git or regular patches,
50 will override the [diff] section and always generate git or regular patches,
51 possibly losing data in the second case.
51 possibly losing data in the second case.
52
52
53 You will by default be managing a patch queue named "patches". You can create
53 You will by default be managing a patch queue named "patches". You can create
54 other, independent patch queues with the "hg qqueue" command.
54 other, independent patch queues with the "hg qqueue" command.
55
55
56 list of commands:
56 list of commands:
57
57
58 qapplied print the patches already applied
58 qapplied print the patches already applied
59 qclone clone main and patch repository at same time
59 qclone clone main and patch repository at same time
60 qdelete remove patches from queue
60 qdelete remove patches from queue
61 qdiff diff of the current patch and subsequent modifications
61 qdiff diff of the current patch and subsequent modifications
62 qfinish move applied patches into repository history
62 qfinish move applied patches into repository history
63 qfold fold the named patches into the current patch
63 qfold fold the named patches into the current patch
64 qgoto push or pop patches until named patch is at top of stack
64 qgoto push or pop patches until named patch is at top of stack
65 qguard set or print guards for a patch
65 qguard set or print guards for a patch
66 qheader print the header of the topmost or specified patch
66 qheader print the header of the topmost or specified patch
67 qimport import a patch
67 qimport import a patch
68 qnew create a new patch
68 qnew create a new patch
69 qnext print the name of the next patch
69 qnext print the name of the next patch
70 qpop pop the current patch off the stack
70 qpop pop the current patch off the stack
71 qprev print the name of the previous patch
71 qprev print the name of the previous patch
72 qpush push the next patch onto the stack
72 qpush push the next patch onto the stack
73 qqueue manage multiple patch queues
73 qqueue manage multiple patch queues
74 qrefresh update the current patch
74 qrefresh update the current patch
75 qrename rename a patch
75 qrename rename a patch
76 qselect set or print guarded patches to push
76 qselect set or print guarded patches to push
77 qseries print the entire series file
77 qseries print the entire series file
78 qtop print the name of the current patch
78 qtop print the name of the current patch
79 qunapplied print the patches not yet applied
79 qunapplied print the patches not yet applied
80 strip strip changesets and all their descendants from the repository
80 strip strip changesets and all their descendants from the repository
81
81
82 use "hg -v help mq" to show builtin aliases and global options
82 use "hg -v help mq" to show builtin aliases and global options
83
83
84 $ hg init a
84 $ hg init a
85 $ cd a
85 $ cd a
86 $ echo a > a
86 $ echo a > a
87 $ hg ci -Ama
87 $ hg ci -Ama
88 adding a
88 adding a
89
89
90 $ hg clone . ../k
90 $ hg clone . ../k
91 updating to branch default
91 updating to branch default
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
93
93
94 $ mkdir b
94 $ mkdir b
95 $ echo z > b/z
95 $ echo z > b/z
96 $ hg ci -Ama
96 $ hg ci -Ama
97 adding b/z
97 adding b/z
98
98
99
99
100 qinit
100 qinit
101
101
102 $ hg qinit
102 $ hg qinit
103
103
104 $ cd ..
104 $ cd ..
105 $ hg init b
105 $ hg init b
106
106
107
107
108 -R qinit
108 -R qinit
109
109
110 $ hg -R b qinit
110 $ hg -R b qinit
111
111
112 $ hg init c
112 $ hg init c
113
113
114
114
115 qinit -c
115 qinit -c
116
116
117 $ hg --cwd c qinit -c
117 $ hg --cwd c qinit -c
118 $ hg -R c/.hg/patches st
118 $ hg -R c/.hg/patches st
119 A .hgignore
119 A .hgignore
120 A series
120 A series
121
121
122
122
123 qinit; qinit -c
123 qinit; qinit -c
124
124
125 $ hg init d
125 $ hg init d
126 $ cd d
126 $ cd d
127 $ hg qinit
127 $ hg qinit
128 $ hg qinit -c
128 $ hg qinit -c
129
129
130 qinit -c should create both files if they don't exist
130 qinit -c should create both files if they don't exist
131
131
132 $ cat .hg/patches/.hgignore
132 $ cat .hg/patches/.hgignore
133 ^\.hg
133 ^\.hg
134 ^\.mq
134 ^\.mq
135 syntax: glob
135 syntax: glob
136 status
136 status
137 guards
137 guards
138 $ cat .hg/patches/series
138 $ cat .hg/patches/series
139 $ hg qinit -c
139 $ hg qinit -c
140 abort: repository $TESTTMP/d/.hg/patches already exists!
140 abort: repository $TESTTMP/d/.hg/patches already exists! (glob)
141 [255]
141 [255]
142 $ cd ..
142 $ cd ..
143
143
144 $ echo '% qinit; <stuff>; qinit -c'
144 $ echo '% qinit; <stuff>; qinit -c'
145 % qinit; <stuff>; qinit -c
145 % qinit; <stuff>; qinit -c
146 $ hg init e
146 $ hg init e
147 $ cd e
147 $ cd e
148 $ hg qnew A
148 $ hg qnew A
149 $ checkundo qnew
149 $ checkundo qnew
150 $ echo foo > foo
150 $ echo foo > foo
151 $ hg add foo
151 $ hg add foo
152 $ hg qrefresh
152 $ hg qrefresh
153 $ hg qnew B
153 $ hg qnew B
154 $ echo >> foo
154 $ echo >> foo
155 $ hg qrefresh
155 $ hg qrefresh
156 $ echo status >> .hg/patches/.hgignore
156 $ echo status >> .hg/patches/.hgignore
157 $ echo bleh >> .hg/patches/.hgignore
157 $ echo bleh >> .hg/patches/.hgignore
158 $ hg qinit -c
158 $ hg qinit -c
159 adding .hg/patches/A
159 adding .hg/patches/A (glob)
160 adding .hg/patches/B
160 adding .hg/patches/B (glob)
161 $ hg -R .hg/patches status
161 $ hg -R .hg/patches status
162 A .hgignore
162 A .hgignore
163 A A
163 A A
164 A B
164 A B
165 A series
165 A series
166
166
167 qinit -c shouldn't touch these files if they already exist
167 qinit -c shouldn't touch these files if they already exist
168
168
169 $ cat .hg/patches/.hgignore
169 $ cat .hg/patches/.hgignore
170 status
170 status
171 bleh
171 bleh
172 $ cat .hg/patches/series
172 $ cat .hg/patches/series
173 A
173 A
174 B
174 B
175
175
176 add an untracked file
176 add an untracked file
177
177
178 $ echo >> .hg/patches/flaf
178 $ echo >> .hg/patches/flaf
179
179
180 status --mq with color (issue2096)
180 status --mq with color (issue2096)
181
181
182 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
182 $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always
183 \x1b[0;32;1mA .hgignore\x1b[0m (esc)
183 \x1b[0;32;1mA .hgignore\x1b[0m (esc)
184 \x1b[0;32;1mA A\x1b[0m (esc)
184 \x1b[0;32;1mA A\x1b[0m (esc)
185 \x1b[0;32;1mA B\x1b[0m (esc)
185 \x1b[0;32;1mA B\x1b[0m (esc)
186 \x1b[0;32;1mA series\x1b[0m (esc)
186 \x1b[0;32;1mA series\x1b[0m (esc)
187 \x1b[0;35;1;4m? flaf\x1b[0m (esc)
187 \x1b[0;35;1;4m? flaf\x1b[0m (esc)
188
188
189 try the --mq option on a command provided by an extension
189 try the --mq option on a command provided by an extension
190
190
191 $ hg purge --mq --verbose --config extensions.purge=
191 $ hg purge --mq --verbose --config extensions.purge=
192 Removing file flaf
192 Removing file flaf
193
193
194 $ cd ..
194 $ cd ..
195
195
196 init --mq without repo
196 init --mq without repo
197
197
198 $ mkdir f
198 $ mkdir f
199 $ cd f
199 $ cd f
200 $ hg init --mq
200 $ hg init --mq
201 abort: there is no Mercurial repository here (.hg not found)
201 abort: there is no Mercurial repository here (.hg not found)
202 [255]
202 [255]
203 $ cd ..
203 $ cd ..
204
204
205 init --mq with repo path
205 init --mq with repo path
206
206
207 $ hg init g
207 $ hg init g
208 $ hg init --mq g
208 $ hg init --mq g
209 $ test -d g/.hg/patches/.hg
209 $ test -d g/.hg/patches/.hg
210
210
211 init --mq with nonexistent directory
211 init --mq with nonexistent directory
212
212
213 $ hg init --mq nonexistentdir
213 $ hg init --mq nonexistentdir
214 abort: repository nonexistentdir not found!
214 abort: repository nonexistentdir not found!
215 [255]
215 [255]
216
216
217
217
218 init --mq with bundle (non "local")
218 init --mq with bundle (non "local")
219
219
220 $ hg -R a bundle --all a.bundle >/dev/null
220 $ hg -R a bundle --all a.bundle >/dev/null
221 $ hg init --mq a.bundle
221 $ hg init --mq a.bundle
222 abort: only a local queue repository may be initialized
222 abort: only a local queue repository may be initialized
223 [255]
223 [255]
224
224
225 $ cd a
225 $ cd a
226
226
227 $ hg qnew -m 'foo bar' test.patch
227 $ hg qnew -m 'foo bar' test.patch
228
228
229 $ echo '# comment' > .hg/patches/series.tmp
229 $ echo '# comment' > .hg/patches/series.tmp
230 $ echo >> .hg/patches/series.tmp # empty line
230 $ echo >> .hg/patches/series.tmp # empty line
231 $ cat .hg/patches/series >> .hg/patches/series.tmp
231 $ cat .hg/patches/series >> .hg/patches/series.tmp
232 $ mv .hg/patches/series.tmp .hg/patches/series
232 $ mv .hg/patches/series.tmp .hg/patches/series
233
233
234
234
235 qrefresh
235 qrefresh
236
236
237 $ echo a >> a
237 $ echo a >> a
238 $ hg qrefresh
238 $ hg qrefresh
239 $ cat .hg/patches/test.patch
239 $ cat .hg/patches/test.patch
240 foo bar
240 foo bar
241
241
242 diff -r [a-f0-9]* a (re)
242 diff -r [a-f0-9]* a (re)
243 --- a/a\t(?P<date>.*) (re)
243 --- a/a\t(?P<date>.*) (re)
244 \+\+\+ b/a\t(?P<date2>.*) (re)
244 \+\+\+ b/a\t(?P<date2>.*) (re)
245 @@ -1,1 +1,2 @@
245 @@ -1,1 +1,2 @@
246 a
246 a
247 +a
247 +a
248
248
249 empty qrefresh
249 empty qrefresh
250
250
251 $ hg qrefresh -X a
251 $ hg qrefresh -X a
252
252
253 revision:
253 revision:
254
254
255 $ hg diff -r -2 -r -1
255 $ hg diff -r -2 -r -1
256
256
257 patch:
257 patch:
258
258
259 $ cat .hg/patches/test.patch
259 $ cat .hg/patches/test.patch
260 foo bar
260 foo bar
261
261
262
262
263 working dir diff:
263 working dir diff:
264
264
265 $ hg diff --nodates -q
265 $ hg diff --nodates -q
266 --- a/a
266 --- a/a
267 +++ b/a
267 +++ b/a
268 @@ -1,1 +1,2 @@
268 @@ -1,1 +1,2 @@
269 a
269 a
270 +a
270 +a
271
271
272 restore things
272 restore things
273
273
274 $ hg qrefresh
274 $ hg qrefresh
275 $ checkundo qrefresh
275 $ checkundo qrefresh
276
276
277
277
278 qpop
278 qpop
279
279
280 $ hg qpop
280 $ hg qpop
281 popping test.patch
281 popping test.patch
282 patch queue now empty
282 patch queue now empty
283 $ checkundo qpop
283 $ checkundo qpop
284
284
285
285
286 qpush with dump of tag cache
286 qpush with dump of tag cache
287 Dump the tag cache to ensure that it has exactly one head after qpush.
287 Dump the tag cache to ensure that it has exactly one head after qpush.
288
288
289 $ rm -f .hg/cache/tags
289 $ rm -f .hg/cache/tags
290 $ hg tags > /dev/null
290 $ hg tags > /dev/null
291
291
292 .hg/cache/tags (pre qpush):
292 .hg/cache/tags (pre qpush):
293
293
294 $ cat .hg/cache/tags
294 $ cat .hg/cache/tags
295 1 [\da-f]{40} (re)
295 1 [\da-f]{40} (re)
296
296
297 $ hg qpush
297 $ hg qpush
298 applying test.patch
298 applying test.patch
299 now at: test.patch
299 now at: test.patch
300 $ hg tags > /dev/null
300 $ hg tags > /dev/null
301
301
302 .hg/cache/tags (post qpush):
302 .hg/cache/tags (post qpush):
303
303
304 $ cat .hg/cache/tags
304 $ cat .hg/cache/tags
305 2 [\da-f]{40} (re)
305 2 [\da-f]{40} (re)
306
306
307 $ checkundo qpush
307 $ checkundo qpush
308 $ cd ..
308 $ cd ..
309
309
310
310
311 pop/push outside repo
311 pop/push outside repo
312 $ hg -R a qpop
312 $ hg -R a qpop
313 popping test.patch
313 popping test.patch
314 patch queue now empty
314 patch queue now empty
315 $ hg -R a qpush
315 $ hg -R a qpush
316 applying test.patch
316 applying test.patch
317 now at: test.patch
317 now at: test.patch
318
318
319 $ cd a
319 $ cd a
320 $ hg qnew test2.patch
320 $ hg qnew test2.patch
321
321
322 qrefresh in subdir
322 qrefresh in subdir
323
323
324 $ cd b
324 $ cd b
325 $ echo a > a
325 $ echo a > a
326 $ hg add a
326 $ hg add a
327 $ hg qrefresh
327 $ hg qrefresh
328
328
329 pop/push -a in subdir
329 pop/push -a in subdir
330
330
331 $ hg qpop -a
331 $ hg qpop -a
332 popping test2.patch
332 popping test2.patch
333 popping test.patch
333 popping test.patch
334 patch queue now empty
334 patch queue now empty
335 $ hg --traceback qpush -a
335 $ hg --traceback qpush -a
336 applying test.patch
336 applying test.patch
337 applying test2.patch
337 applying test2.patch
338 now at: test2.patch
338 now at: test2.patch
339
339
340
340
341 setting columns & formatted tests truncating (issue1912)
341 setting columns & formatted tests truncating (issue1912)
342
342
343 $ COLUMNS=4 hg qseries --config ui.formatted=true
343 $ COLUMNS=4 hg qseries --config ui.formatted=true
344 test.patch
344 test.patch
345 test2.patch
345 test2.patch
346 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
346 $ COLUMNS=20 hg qseries --config ui.formatted=true -vs
347 0 A test.patch: f...
347 0 A test.patch: f...
348 1 A test2.patch:
348 1 A test2.patch:
349 $ hg qpop
349 $ hg qpop
350 popping test2.patch
350 popping test2.patch
351 now at: test.patch
351 now at: test.patch
352 $ hg qseries -vs
352 $ hg qseries -vs
353 0 A test.patch: foo bar
353 0 A test.patch: foo bar
354 1 U test2.patch:
354 1 U test2.patch:
355 $ hg sum | grep mq
355 $ hg sum | grep mq
356 mq: 1 applied, 1 unapplied
356 mq: 1 applied, 1 unapplied
357 $ hg qpush
357 $ hg qpush
358 applying test2.patch
358 applying test2.patch
359 now at: test2.patch
359 now at: test2.patch
360 $ hg sum | grep mq
360 $ hg sum | grep mq
361 mq: 2 applied
361 mq: 2 applied
362 $ hg qapplied
362 $ hg qapplied
363 test.patch
363 test.patch
364 test2.patch
364 test2.patch
365 $ hg qtop
365 $ hg qtop
366 test2.patch
366 test2.patch
367
367
368
368
369 prev
369 prev
370
370
371 $ hg qapp -1
371 $ hg qapp -1
372 test.patch
372 test.patch
373
373
374 next
374 next
375
375
376 $ hg qunapp -1
376 $ hg qunapp -1
377 all patches applied
377 all patches applied
378 [1]
378 [1]
379
379
380 $ hg qpop
380 $ hg qpop
381 popping test2.patch
381 popping test2.patch
382 now at: test.patch
382 now at: test.patch
383
383
384 commit should fail
384 commit should fail
385
385
386 $ hg commit
386 $ hg commit
387 abort: cannot commit over an applied mq patch
387 abort: cannot commit over an applied mq patch
388 [255]
388 [255]
389
389
390 push should fail
390 push should fail
391
391
392 $ hg push ../../k
392 $ hg push ../../k
393 pushing to ../../k
393 pushing to ../../k
394 abort: source has mq patches applied
394 abort: source has mq patches applied
395 [255]
395 [255]
396
396
397
397
398 import should fail
398 import should fail
399
399
400 $ hg st .
400 $ hg st .
401 $ echo foo >> ../a
401 $ echo foo >> ../a
402 $ hg diff > ../../import.diff
402 $ hg diff > ../../import.diff
403 $ hg revert --no-backup ../a
403 $ hg revert --no-backup ../a
404 $ hg import ../../import.diff
404 $ hg import ../../import.diff
405 abort: cannot import over an applied patch
405 abort: cannot import over an applied patch
406 [255]
406 [255]
407 $ hg st
407 $ hg st
408
408
409 import --no-commit should succeed
409 import --no-commit should succeed
410
410
411 $ hg import --no-commit ../../import.diff
411 $ hg import --no-commit ../../import.diff
412 applying ../../import.diff
412 applying ../../import.diff
413 $ hg st
413 $ hg st
414 M a
414 M a
415 $ hg revert --no-backup ../a
415 $ hg revert --no-backup ../a
416
416
417
417
418 qunapplied
418 qunapplied
419
419
420 $ hg qunapplied
420 $ hg qunapplied
421 test2.patch
421 test2.patch
422
422
423
423
424 qpush/qpop with index
424 qpush/qpop with index
425
425
426 $ hg qnew test1b.patch
426 $ hg qnew test1b.patch
427 $ echo 1b > 1b
427 $ echo 1b > 1b
428 $ hg add 1b
428 $ hg add 1b
429 $ hg qrefresh
429 $ hg qrefresh
430 $ hg qpush 2
430 $ hg qpush 2
431 applying test2.patch
431 applying test2.patch
432 now at: test2.patch
432 now at: test2.patch
433 $ hg qpop 0
433 $ hg qpop 0
434 popping test2.patch
434 popping test2.patch
435 popping test1b.patch
435 popping test1b.patch
436 now at: test.patch
436 now at: test.patch
437 $ hg qpush test.patch+1
437 $ hg qpush test.patch+1
438 applying test1b.patch
438 applying test1b.patch
439 now at: test1b.patch
439 now at: test1b.patch
440 $ hg qpush test.patch+2
440 $ hg qpush test.patch+2
441 applying test2.patch
441 applying test2.patch
442 now at: test2.patch
442 now at: test2.patch
443 $ hg qpop test2.patch-1
443 $ hg qpop test2.patch-1
444 popping test2.patch
444 popping test2.patch
445 now at: test1b.patch
445 now at: test1b.patch
446 $ hg qpop test2.patch-2
446 $ hg qpop test2.patch-2
447 popping test1b.patch
447 popping test1b.patch
448 now at: test.patch
448 now at: test.patch
449 $ hg qpush test1b.patch+1
449 $ hg qpush test1b.patch+1
450 applying test1b.patch
450 applying test1b.patch
451 applying test2.patch
451 applying test2.patch
452 now at: test2.patch
452 now at: test2.patch
453
453
454
454
455 qpush --move
455 qpush --move
456
456
457 $ hg qpop -a
457 $ hg qpop -a
458 popping test2.patch
458 popping test2.patch
459 popping test1b.patch
459 popping test1b.patch
460 popping test.patch
460 popping test.patch
461 patch queue now empty
461 patch queue now empty
462 $ hg qguard test1b.patch -- -negguard
462 $ hg qguard test1b.patch -- -negguard
463 $ hg qguard test2.patch -- +posguard
463 $ hg qguard test2.patch -- +posguard
464 $ hg qpush --move test2.patch # can't move guarded patch
464 $ hg qpush --move test2.patch # can't move guarded patch
465 cannot push 'test2.patch' - guarded by '+posguard'
465 cannot push 'test2.patch' - guarded by '+posguard'
466 [1]
466 [1]
467 $ hg qselect posguard
467 $ hg qselect posguard
468 number of unguarded, unapplied patches has changed from 2 to 3
468 number of unguarded, unapplied patches has changed from 2 to 3
469 $ hg qpush --move test2.patch # move to front
469 $ hg qpush --move test2.patch # move to front
470 applying test2.patch
470 applying test2.patch
471 now at: test2.patch
471 now at: test2.patch
472 $ hg qpush --move test1b.patch # negative guard unselected
472 $ hg qpush --move test1b.patch # negative guard unselected
473 applying test1b.patch
473 applying test1b.patch
474 now at: test1b.patch
474 now at: test1b.patch
475 $ hg qpush --move test.patch # noop move
475 $ hg qpush --move test.patch # noop move
476 applying test.patch
476 applying test.patch
477 now at: test.patch
477 now at: test.patch
478 $ hg qseries -v
478 $ hg qseries -v
479 0 A test2.patch
479 0 A test2.patch
480 1 A test1b.patch
480 1 A test1b.patch
481 2 A test.patch
481 2 A test.patch
482 $ hg qpop -a
482 $ hg qpop -a
483 popping test.patch
483 popping test.patch
484 popping test1b.patch
484 popping test1b.patch
485 popping test2.patch
485 popping test2.patch
486 patch queue now empty
486 patch queue now empty
487
487
488 cleaning up
488 cleaning up
489
489
490 $ hg qselect --none
490 $ hg qselect --none
491 guards deactivated
491 guards deactivated
492 number of unguarded, unapplied patches has changed from 3 to 2
492 number of unguarded, unapplied patches has changed from 3 to 2
493 $ hg qguard --none test1b.patch
493 $ hg qguard --none test1b.patch
494 $ hg qguard --none test2.patch
494 $ hg qguard --none test2.patch
495 $ hg qpush --move test.patch
495 $ hg qpush --move test.patch
496 applying test.patch
496 applying test.patch
497 now at: test.patch
497 now at: test.patch
498 $ hg qpush --move test1b.patch
498 $ hg qpush --move test1b.patch
499 applying test1b.patch
499 applying test1b.patch
500 now at: test1b.patch
500 now at: test1b.patch
501 $ hg qpush --move bogus # nonexistent patch
501 $ hg qpush --move bogus # nonexistent patch
502 abort: patch bogus not in series
502 abort: patch bogus not in series
503 [255]
503 [255]
504 $ hg qpush --move # no patch
504 $ hg qpush --move # no patch
505 abort: please specify the patch to move
505 abort: please specify the patch to move
506 [255]
506 [255]
507 $ hg qpush --move test.patch # already applied
507 $ hg qpush --move test.patch # already applied
508 abort: cannot push to a previous patch: test.patch
508 abort: cannot push to a previous patch: test.patch
509 [255]
509 [255]
510 $ hg qpush
510 $ hg qpush
511 applying test2.patch
511 applying test2.patch
512 now at: test2.patch
512 now at: test2.patch
513
513
514
514
515 series after move
515 series after move
516
516
517 $ cat `hg root`/.hg/patches/series
517 $ cat `hg root`/.hg/patches/series
518 test.patch
518 test.patch
519 test1b.patch
519 test1b.patch
520 test2.patch
520 test2.patch
521 # comment
521 # comment
522
522
523
523
524
524
525 pop, qapplied, qunapplied
525 pop, qapplied, qunapplied
526
526
527 $ hg qseries -v
527 $ hg qseries -v
528 0 A test.patch
528 0 A test.patch
529 1 A test1b.patch
529 1 A test1b.patch
530 2 A test2.patch
530 2 A test2.patch
531
531
532 qapplied -1 test.patch
532 qapplied -1 test.patch
533
533
534 $ hg qapplied -1 test.patch
534 $ hg qapplied -1 test.patch
535 only one patch applied
535 only one patch applied
536 [1]
536 [1]
537
537
538 qapplied -1 test1b.patch
538 qapplied -1 test1b.patch
539
539
540 $ hg qapplied -1 test1b.patch
540 $ hg qapplied -1 test1b.patch
541 test.patch
541 test.patch
542
542
543 qapplied -1 test2.patch
543 qapplied -1 test2.patch
544
544
545 $ hg qapplied -1 test2.patch
545 $ hg qapplied -1 test2.patch
546 test1b.patch
546 test1b.patch
547
547
548 qapplied -1
548 qapplied -1
549
549
550 $ hg qapplied -1
550 $ hg qapplied -1
551 test1b.patch
551 test1b.patch
552
552
553 qapplied
553 qapplied
554
554
555 $ hg qapplied
555 $ hg qapplied
556 test.patch
556 test.patch
557 test1b.patch
557 test1b.patch
558 test2.patch
558 test2.patch
559
559
560 qapplied test1b.patch
560 qapplied test1b.patch
561
561
562 $ hg qapplied test1b.patch
562 $ hg qapplied test1b.patch
563 test.patch
563 test.patch
564 test1b.patch
564 test1b.patch
565
565
566 qunapplied -1
566 qunapplied -1
567
567
568 $ hg qunapplied -1
568 $ hg qunapplied -1
569 all patches applied
569 all patches applied
570 [1]
570 [1]
571
571
572 qunapplied
572 qunapplied
573
573
574 $ hg qunapplied
574 $ hg qunapplied
575
575
576 popping
576 popping
577
577
578 $ hg qpop
578 $ hg qpop
579 popping test2.patch
579 popping test2.patch
580 now at: test1b.patch
580 now at: test1b.patch
581
581
582 qunapplied -1
582 qunapplied -1
583
583
584 $ hg qunapplied -1
584 $ hg qunapplied -1
585 test2.patch
585 test2.patch
586
586
587 qunapplied
587 qunapplied
588
588
589 $ hg qunapplied
589 $ hg qunapplied
590 test2.patch
590 test2.patch
591
591
592 qunapplied test2.patch
592 qunapplied test2.patch
593
593
594 $ hg qunapplied test2.patch
594 $ hg qunapplied test2.patch
595
595
596 qunapplied -1 test2.patch
596 qunapplied -1 test2.patch
597
597
598 $ hg qunapplied -1 test2.patch
598 $ hg qunapplied -1 test2.patch
599 all patches applied
599 all patches applied
600 [1]
600 [1]
601
601
602 popping -a
602 popping -a
603
603
604 $ hg qpop -a
604 $ hg qpop -a
605 popping test1b.patch
605 popping test1b.patch
606 popping test.patch
606 popping test.patch
607 patch queue now empty
607 patch queue now empty
608
608
609 qapplied
609 qapplied
610
610
611 $ hg qapplied
611 $ hg qapplied
612
612
613 qapplied -1
613 qapplied -1
614
614
615 $ hg qapplied -1
615 $ hg qapplied -1
616 no patches applied
616 no patches applied
617 [1]
617 [1]
618 $ hg qpush
618 $ hg qpush
619 applying test.patch
619 applying test.patch
620 now at: test.patch
620 now at: test.patch
621
621
622
622
623 push should succeed
623 push should succeed
624
624
625 $ hg qpop -a
625 $ hg qpop -a
626 popping test.patch
626 popping test.patch
627 patch queue now empty
627 patch queue now empty
628 $ hg push ../../k
628 $ hg push ../../k
629 pushing to ../../k
629 pushing to ../../k
630 searching for changes
630 searching for changes
631 adding changesets
631 adding changesets
632 adding manifests
632 adding manifests
633 adding file changes
633 adding file changes
634 added 1 changesets with 1 changes to 1 files
634 added 1 changesets with 1 changes to 1 files
635
635
636
636
637 we want to start with some patches applied
637 we want to start with some patches applied
638
638
639 $ hg qpush -a
639 $ hg qpush -a
640 applying test.patch
640 applying test.patch
641 applying test1b.patch
641 applying test1b.patch
642 applying test2.patch
642 applying test2.patch
643 now at: test2.patch
643 now at: test2.patch
644
644
645 % pops all patches and succeeds
645 % pops all patches and succeeds
646
646
647 $ hg qpop -a
647 $ hg qpop -a
648 popping test2.patch
648 popping test2.patch
649 popping test1b.patch
649 popping test1b.patch
650 popping test.patch
650 popping test.patch
651 patch queue now empty
651 patch queue now empty
652
652
653 % does nothing and succeeds
653 % does nothing and succeeds
654
654
655 $ hg qpop -a
655 $ hg qpop -a
656 no patches applied
656 no patches applied
657
657
658 % fails - nothing else to pop
658 % fails - nothing else to pop
659
659
660 $ hg qpop
660 $ hg qpop
661 no patches applied
661 no patches applied
662 [1]
662 [1]
663
663
664 % pushes a patch and succeeds
664 % pushes a patch and succeeds
665
665
666 $ hg qpush
666 $ hg qpush
667 applying test.patch
667 applying test.patch
668 now at: test.patch
668 now at: test.patch
669
669
670 % pops a patch and succeeds
670 % pops a patch and succeeds
671
671
672 $ hg qpop
672 $ hg qpop
673 popping test.patch
673 popping test.patch
674 patch queue now empty
674 patch queue now empty
675
675
676 % pushes up to test1b.patch and succeeds
676 % pushes up to test1b.patch and succeeds
677
677
678 $ hg qpush test1b.patch
678 $ hg qpush test1b.patch
679 applying test.patch
679 applying test.patch
680 applying test1b.patch
680 applying test1b.patch
681 now at: test1b.patch
681 now at: test1b.patch
682
682
683 % does nothing and succeeds
683 % does nothing and succeeds
684
684
685 $ hg qpush test1b.patch
685 $ hg qpush test1b.patch
686 qpush: test1b.patch is already at the top
686 qpush: test1b.patch is already at the top
687
687
688 % does nothing and succeeds
688 % does nothing and succeeds
689
689
690 $ hg qpop test1b.patch
690 $ hg qpop test1b.patch
691 qpop: test1b.patch is already at the top
691 qpop: test1b.patch is already at the top
692
692
693 % fails - can't push to this patch
693 % fails - can't push to this patch
694
694
695 $ hg qpush test.patch
695 $ hg qpush test.patch
696 abort: cannot push to a previous patch: test.patch
696 abort: cannot push to a previous patch: test.patch
697 [255]
697 [255]
698
698
699 % fails - can't pop to this patch
699 % fails - can't pop to this patch
700
700
701 $ hg qpop test2.patch
701 $ hg qpop test2.patch
702 abort: patch test2.patch is not applied
702 abort: patch test2.patch is not applied
703 [255]
703 [255]
704
704
705 % pops up to test.patch and succeeds
705 % pops up to test.patch and succeeds
706
706
707 $ hg qpop test.patch
707 $ hg qpop test.patch
708 popping test1b.patch
708 popping test1b.patch
709 now at: test.patch
709 now at: test.patch
710
710
711 % pushes all patches and succeeds
711 % pushes all patches and succeeds
712
712
713 $ hg qpush -a
713 $ hg qpush -a
714 applying test1b.patch
714 applying test1b.patch
715 applying test2.patch
715 applying test2.patch
716 now at: test2.patch
716 now at: test2.patch
717
717
718 % does nothing and succeeds
718 % does nothing and succeeds
719
719
720 $ hg qpush -a
720 $ hg qpush -a
721 all patches are currently applied
721 all patches are currently applied
722
722
723 % fails - nothing else to push
723 % fails - nothing else to push
724
724
725 $ hg qpush
725 $ hg qpush
726 patch series already fully applied
726 patch series already fully applied
727 [1]
727 [1]
728
728
729 % does nothing and succeeds
729 % does nothing and succeeds
730
730
731 $ hg qpush test2.patch
731 $ hg qpush test2.patch
732 qpush: test2.patch is already at the top
732 qpush: test2.patch is already at the top
733
733
734 strip
734 strip
735
735
736 $ cd ../../b
736 $ cd ../../b
737 $ echo x>x
737 $ echo x>x
738 $ hg ci -Ama
738 $ hg ci -Ama
739 adding x
739 adding x
740 $ hg strip tip
740 $ hg strip tip
741 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
741 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
742 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
742 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
743 $ hg unbundle .hg/strip-backup/*
743 $ hg unbundle .hg/strip-backup/*
744 adding changesets
744 adding changesets
745 adding manifests
745 adding manifests
746 adding file changes
746 adding file changes
747 added 1 changesets with 1 changes to 1 files
747 added 1 changesets with 1 changes to 1 files
748 (run 'hg update' to get a working copy)
748 (run 'hg update' to get a working copy)
749
749
750
750
751 strip with local changes, should complain
751 strip with local changes, should complain
752
752
753 $ hg up
753 $ hg up
754 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
754 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
755 $ echo y>y
755 $ echo y>y
756 $ hg add y
756 $ hg add y
757 $ hg strip tip
757 $ hg strip tip
758 abort: local changes found
758 abort: local changes found
759 [255]
759 [255]
760
760
761 --force strip with local changes
761 --force strip with local changes
762
762
763 $ hg strip -f tip
763 $ hg strip -f tip
764 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
764 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
765 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
765 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
766
766
767
767
768 cd b; hg qrefresh
768 cd b; hg qrefresh
769
769
770 $ hg init refresh
770 $ hg init refresh
771 $ cd refresh
771 $ cd refresh
772 $ echo a > a
772 $ echo a > a
773 $ hg ci -Ama
773 $ hg ci -Ama
774 adding a
774 adding a
775 $ hg qnew -mfoo foo
775 $ hg qnew -mfoo foo
776 $ echo a >> a
776 $ echo a >> a
777 $ hg qrefresh
777 $ hg qrefresh
778 $ mkdir b
778 $ mkdir b
779 $ cd b
779 $ cd b
780 $ echo f > f
780 $ echo f > f
781 $ hg add f
781 $ hg add f
782 $ hg qrefresh
782 $ hg qrefresh
783 $ cat ../.hg/patches/foo
783 $ cat ../.hg/patches/foo
784 foo
784 foo
785
785
786 diff -r cb9a9f314b8b a
786 diff -r cb9a9f314b8b a
787 --- a/a\t(?P<date>.*) (re)
787 --- a/a\t(?P<date>.*) (re)
788 \+\+\+ b/a\t(?P<date>.*) (re)
788 \+\+\+ b/a\t(?P<date>.*) (re)
789 @@ -1,1 +1,2 @@
789 @@ -1,1 +1,2 @@
790 a
790 a
791 +a
791 +a
792 diff -r cb9a9f314b8b b/f
792 diff -r cb9a9f314b8b b/f
793 --- /dev/null\t(?P<date>.*) (re)
793 --- /dev/null\t(?P<date>.*) (re)
794 \+\+\+ b/b/f\t(?P<date>.*) (re)
794 \+\+\+ b/b/f\t(?P<date>.*) (re)
795 @@ -0,0 +1,1 @@
795 @@ -0,0 +1,1 @@
796 +f
796 +f
797
797
798 hg qrefresh .
798 hg qrefresh .
799
799
800 $ hg qrefresh .
800 $ hg qrefresh .
801 $ cat ../.hg/patches/foo
801 $ cat ../.hg/patches/foo
802 foo
802 foo
803
803
804 diff -r cb9a9f314b8b b/f
804 diff -r cb9a9f314b8b b/f
805 --- /dev/null\t(?P<date>.*) (re)
805 --- /dev/null\t(?P<date>.*) (re)
806 \+\+\+ b/b/f\t(?P<date>.*) (re)
806 \+\+\+ b/b/f\t(?P<date>.*) (re)
807 @@ -0,0 +1,1 @@
807 @@ -0,0 +1,1 @@
808 +f
808 +f
809 $ hg status
809 $ hg status
810 M a
810 M a
811
811
812
812
813 qpush failure
813 qpush failure
814
814
815 $ cd ..
815 $ cd ..
816 $ hg qrefresh
816 $ hg qrefresh
817 $ hg qnew -mbar bar
817 $ hg qnew -mbar bar
818 $ echo foo > foo
818 $ echo foo > foo
819 $ echo bar > bar
819 $ echo bar > bar
820 $ hg add foo bar
820 $ hg add foo bar
821 $ hg qrefresh
821 $ hg qrefresh
822 $ hg qpop -a
822 $ hg qpop -a
823 popping bar
823 popping bar
824 popping foo
824 popping foo
825 patch queue now empty
825 patch queue now empty
826 $ echo bar > foo
826 $ echo bar > foo
827 $ hg qpush -a
827 $ hg qpush -a
828 applying foo
828 applying foo
829 applying bar
829 applying bar
830 file foo already exists
830 file foo already exists
831 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
831 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
832 patch failed, unable to continue (try -v)
832 patch failed, unable to continue (try -v)
833 patch failed, rejects left in working dir
833 patch failed, rejects left in working dir
834 errors during apply, please fix and refresh bar
834 errors during apply, please fix and refresh bar
835 [2]
835 [2]
836 $ hg st
836 $ hg st
837 ? foo
837 ? foo
838 ? foo.rej
838 ? foo.rej
839
839
840
840
841 mq tags
841 mq tags
842
842
843 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
843 $ hg log --template '{rev} {tags}\n' -r qparent:qtip
844 0 qparent
844 0 qparent
845 1 foo qbase
845 1 foo qbase
846 2 bar qtip tip
846 2 bar qtip tip
847
847
848 mq revset
848 mq revset
849
849
850 $ hg log -r 'mq()' --template '{rev}\n'
850 $ hg log -r 'mq()' --template '{rev}\n'
851 1
851 1
852 2
852 2
853 $ hg help revsets | grep -i mq
853 $ hg help revsets | grep -i mq
854 "mq()"
854 "mq()"
855 Changesets managed by MQ.
855 Changesets managed by MQ.
856
856
857 bad node in status
857 bad node in status
858
858
859 $ hg qpop
859 $ hg qpop
860 popping bar
860 popping bar
861 now at: foo
861 now at: foo
862 $ hg strip -qn tip
862 $ hg strip -qn tip
863 $ hg tip
863 $ hg tip
864 changeset: 0:cb9a9f314b8b
864 changeset: 0:cb9a9f314b8b
865 tag: tip
865 tag: tip
866 user: test
866 user: test
867 date: Thu Jan 01 00:00:00 1970 +0000
867 date: Thu Jan 01 00:00:00 1970 +0000
868 summary: a
868 summary: a
869
869
870 $ hg branches
870 $ hg branches
871 default 0:cb9a9f314b8b
871 default 0:cb9a9f314b8b
872 $ hg qpop
872 $ hg qpop
873 no patches applied
873 no patches applied
874 [1]
874 [1]
875
875
876 $ cat >>$HGRCPATH <<EOF
876 $ cat >>$HGRCPATH <<EOF
877 > [diff]
877 > [diff]
878 > git = True
878 > git = True
879 > EOF
879 > EOF
880 $ cd ..
880 $ cd ..
881 $ hg init git
881 $ hg init git
882 $ cd git
882 $ cd git
883 $ hg qinit
883 $ hg qinit
884
884
885 $ hg qnew -m'new file' new
885 $ hg qnew -m'new file' new
886 $ echo foo > new
886 $ echo foo > new
887 $ chmod +x new
887 $ chmod +x new
888 $ hg add new
888 $ hg add new
889 $ hg qrefresh
889 $ hg qrefresh
890 $ cat .hg/patches/new
890 $ cat .hg/patches/new
891 new file
891 new file
892
892
893 diff --git a/new b/new
893 diff --git a/new b/new
894 new file mode 100755
894 new file mode 100755
895 --- /dev/null
895 --- /dev/null
896 +++ b/new
896 +++ b/new
897 @@ -0,0 +1,1 @@
897 @@ -0,0 +1,1 @@
898 +foo
898 +foo
899
899
900 $ hg qnew -m'copy file' copy
900 $ hg qnew -m'copy file' copy
901 $ hg cp new copy
901 $ hg cp new copy
902 $ hg qrefresh
902 $ hg qrefresh
903 $ cat .hg/patches/copy
903 $ cat .hg/patches/copy
904 copy file
904 copy file
905
905
906 diff --git a/new b/copy
906 diff --git a/new b/copy
907 copy from new
907 copy from new
908 copy to copy
908 copy to copy
909
909
910 $ hg qpop
910 $ hg qpop
911 popping copy
911 popping copy
912 now at: new
912 now at: new
913 $ hg qpush
913 $ hg qpush
914 applying copy
914 applying copy
915 now at: copy
915 now at: copy
916 $ hg qdiff
916 $ hg qdiff
917 diff --git a/new b/copy
917 diff --git a/new b/copy
918 copy from new
918 copy from new
919 copy to copy
919 copy to copy
920 $ cat >>$HGRCPATH <<EOF
920 $ cat >>$HGRCPATH <<EOF
921 > [diff]
921 > [diff]
922 > git = False
922 > git = False
923 > EOF
923 > EOF
924 $ hg qdiff --git
924 $ hg qdiff --git
925 diff --git a/new b/copy
925 diff --git a/new b/copy
926 copy from new
926 copy from new
927 copy to copy
927 copy to copy
928 $ cd ..
928 $ cd ..
929
929
930 empty lines in status
930 empty lines in status
931
931
932 $ hg init emptystatus
932 $ hg init emptystatus
933 $ cd emptystatus
933 $ cd emptystatus
934 $ hg qinit
934 $ hg qinit
935 $ printf '\n\n' > .hg/patches/status
935 $ printf '\n\n' > .hg/patches/status
936 $ hg qser
936 $ hg qser
937 $ cd ..
937 $ cd ..
938
938
939 bad line in status (without ":")
939 bad line in status (without ":")
940
940
941 $ hg init badstatus
941 $ hg init badstatus
942 $ cd badstatus
942 $ cd badstatus
943 $ hg qinit
943 $ hg qinit
944 $ printf 'babar has no colon in this line\n' > .hg/patches/status
944 $ printf 'babar has no colon in this line\n' > .hg/patches/status
945 $ hg qser
945 $ hg qser
946 malformated mq status line: ['babar has no colon in this line']
946 malformated mq status line: ['babar has no colon in this line']
947 $ cd ..
947 $ cd ..
948
948
949
949
950 test file addition in slow path
950 test file addition in slow path
951
951
952 $ hg init slow
952 $ hg init slow
953 $ cd slow
953 $ cd slow
954 $ hg qinit
954 $ hg qinit
955 $ echo foo > foo
955 $ echo foo > foo
956 $ hg add foo
956 $ hg add foo
957 $ hg ci -m 'add foo'
957 $ hg ci -m 'add foo'
958 $ hg qnew bar
958 $ hg qnew bar
959 $ echo bar > bar
959 $ echo bar > bar
960 $ hg add bar
960 $ hg add bar
961 $ hg mv foo baz
961 $ hg mv foo baz
962 $ hg qrefresh --git
962 $ hg qrefresh --git
963 $ hg up -C 0
963 $ hg up -C 0
964 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
964 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
965 $ echo >> foo
965 $ echo >> foo
966 $ hg ci -m 'change foo'
966 $ hg ci -m 'change foo'
967 created new head
967 created new head
968 $ hg up -C 1
968 $ hg up -C 1
969 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
969 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
970 $ hg qrefresh --git
970 $ hg qrefresh --git
971 $ cat .hg/patches/bar
971 $ cat .hg/patches/bar
972 diff --git a/bar b/bar
972 diff --git a/bar b/bar
973 new file mode 100644
973 new file mode 100644
974 --- /dev/null
974 --- /dev/null
975 +++ b/bar
975 +++ b/bar
976 @@ -0,0 +1,1 @@
976 @@ -0,0 +1,1 @@
977 +bar
977 +bar
978 diff --git a/foo b/baz
978 diff --git a/foo b/baz
979 rename from foo
979 rename from foo
980 rename to baz
980 rename to baz
981 $ hg log -v --template '{rev} {file_copies}\n' -r .
981 $ hg log -v --template '{rev} {file_copies}\n' -r .
982 2 baz (foo)
982 2 baz (foo)
983 $ hg qrefresh --git
983 $ hg qrefresh --git
984 $ cat .hg/patches/bar
984 $ cat .hg/patches/bar
985 diff --git a/bar b/bar
985 diff --git a/bar b/bar
986 new file mode 100644
986 new file mode 100644
987 --- /dev/null
987 --- /dev/null
988 +++ b/bar
988 +++ b/bar
989 @@ -0,0 +1,1 @@
989 @@ -0,0 +1,1 @@
990 +bar
990 +bar
991 diff --git a/foo b/baz
991 diff --git a/foo b/baz
992 rename from foo
992 rename from foo
993 rename to baz
993 rename to baz
994 $ hg log -v --template '{rev} {file_copies}\n' -r .
994 $ hg log -v --template '{rev} {file_copies}\n' -r .
995 2 baz (foo)
995 2 baz (foo)
996 $ hg qrefresh
996 $ hg qrefresh
997 $ grep 'diff --git' .hg/patches/bar
997 $ grep 'diff --git' .hg/patches/bar
998 diff --git a/bar b/bar
998 diff --git a/bar b/bar
999 diff --git a/foo b/baz
999 diff --git a/foo b/baz
1000
1000
1001
1001
1002 test file move chains in the slow path
1002 test file move chains in the slow path
1003
1003
1004 $ hg up -C 1
1004 $ hg up -C 1
1005 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1005 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1006 $ echo >> foo
1006 $ echo >> foo
1007 $ hg ci -m 'change foo again'
1007 $ hg ci -m 'change foo again'
1008 $ hg up -C 2
1008 $ hg up -C 2
1009 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1009 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1010 $ hg mv bar quux
1010 $ hg mv bar quux
1011 $ hg mv baz bleh
1011 $ hg mv baz bleh
1012 $ hg qrefresh --git
1012 $ hg qrefresh --git
1013 $ cat .hg/patches/bar
1013 $ cat .hg/patches/bar
1014 diff --git a/foo b/bleh
1014 diff --git a/foo b/bleh
1015 rename from foo
1015 rename from foo
1016 rename to bleh
1016 rename to bleh
1017 diff --git a/quux b/quux
1017 diff --git a/quux b/quux
1018 new file mode 100644
1018 new file mode 100644
1019 --- /dev/null
1019 --- /dev/null
1020 +++ b/quux
1020 +++ b/quux
1021 @@ -0,0 +1,1 @@
1021 @@ -0,0 +1,1 @@
1022 +bar
1022 +bar
1023 $ hg log -v --template '{rev} {file_copies}\n' -r .
1023 $ hg log -v --template '{rev} {file_copies}\n' -r .
1024 3 bleh (foo)
1024 3 bleh (foo)
1025 $ hg mv quux fred
1025 $ hg mv quux fred
1026 $ hg mv bleh barney
1026 $ hg mv bleh barney
1027 $ hg qrefresh --git
1027 $ hg qrefresh --git
1028 $ cat .hg/patches/bar
1028 $ cat .hg/patches/bar
1029 diff --git a/foo b/barney
1029 diff --git a/foo b/barney
1030 rename from foo
1030 rename from foo
1031 rename to barney
1031 rename to barney
1032 diff --git a/fred b/fred
1032 diff --git a/fred b/fred
1033 new file mode 100644
1033 new file mode 100644
1034 --- /dev/null
1034 --- /dev/null
1035 +++ b/fred
1035 +++ b/fred
1036 @@ -0,0 +1,1 @@
1036 @@ -0,0 +1,1 @@
1037 +bar
1037 +bar
1038 $ hg log -v --template '{rev} {file_copies}\n' -r .
1038 $ hg log -v --template '{rev} {file_copies}\n' -r .
1039 3 barney (foo)
1039 3 barney (foo)
1040
1040
1041
1041
1042 refresh omitting an added file
1042 refresh omitting an added file
1043
1043
1044 $ hg qnew baz
1044 $ hg qnew baz
1045 $ echo newfile > newfile
1045 $ echo newfile > newfile
1046 $ hg add newfile
1046 $ hg add newfile
1047 $ hg qrefresh
1047 $ hg qrefresh
1048 $ hg st -A newfile
1048 $ hg st -A newfile
1049 C newfile
1049 C newfile
1050 $ hg qrefresh -X newfile
1050 $ hg qrefresh -X newfile
1051 $ hg st -A newfile
1051 $ hg st -A newfile
1052 A newfile
1052 A newfile
1053 $ hg revert newfile
1053 $ hg revert newfile
1054 $ rm newfile
1054 $ rm newfile
1055 $ hg qpop
1055 $ hg qpop
1056 popping baz
1056 popping baz
1057 now at: bar
1057 now at: bar
1058 $ hg qdel baz
1058 $ hg qdel baz
1059
1059
1060
1060
1061 create a git patch
1061 create a git patch
1062
1062
1063 $ echo a > alexander
1063 $ echo a > alexander
1064 $ hg add alexander
1064 $ hg add alexander
1065 $ hg qnew -f --git addalexander
1065 $ hg qnew -f --git addalexander
1066 $ grep diff .hg/patches/addalexander
1066 $ grep diff .hg/patches/addalexander
1067 diff --git a/alexander b/alexander
1067 diff --git a/alexander b/alexander
1068
1068
1069
1069
1070 create a git binary patch
1070 create a git binary patch
1071
1071
1072 $ cat > writebin.py <<EOF
1072 $ cat > writebin.py <<EOF
1073 > import sys
1073 > import sys
1074 > path = sys.argv[1]
1074 > path = sys.argv[1]
1075 > open(path, 'wb').write('BIN\x00ARY')
1075 > open(path, 'wb').write('BIN\x00ARY')
1076 > EOF
1076 > EOF
1077 $ python writebin.py bucephalus
1077 $ python writebin.py bucephalus
1078
1078
1079 $ python "$TESTDIR/md5sum.py" bucephalus
1079 $ python "$TESTDIR/md5sum.py" bucephalus
1080 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1080 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1081 $ hg add bucephalus
1081 $ hg add bucephalus
1082 $ hg qnew -f --git addbucephalus
1082 $ hg qnew -f --git addbucephalus
1083 $ grep diff .hg/patches/addbucephalus
1083 $ grep diff .hg/patches/addbucephalus
1084 diff --git a/bucephalus b/bucephalus
1084 diff --git a/bucephalus b/bucephalus
1085
1085
1086
1086
1087 check binary patches can be popped and pushed
1087 check binary patches can be popped and pushed
1088
1088
1089 $ hg qpop
1089 $ hg qpop
1090 popping addbucephalus
1090 popping addbucephalus
1091 now at: addalexander
1091 now at: addalexander
1092 $ test -f bucephalus && echo % bucephalus should not be there
1092 $ test -f bucephalus && echo % bucephalus should not be there
1093 [1]
1093 [1]
1094 $ hg qpush
1094 $ hg qpush
1095 applying addbucephalus
1095 applying addbucephalus
1096 now at: addbucephalus
1096 now at: addbucephalus
1097 $ test -f bucephalus
1097 $ test -f bucephalus
1098 $ python "$TESTDIR/md5sum.py" bucephalus
1098 $ python "$TESTDIR/md5sum.py" bucephalus
1099 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1099 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
1100
1100
1101
1101
1102
1102
1103 strip again
1103 strip again
1104
1104
1105 $ cd ..
1105 $ cd ..
1106 $ hg init strip
1106 $ hg init strip
1107 $ cd strip
1107 $ cd strip
1108 $ touch foo
1108 $ touch foo
1109 $ hg add foo
1109 $ hg add foo
1110 $ hg ci -m 'add foo'
1110 $ hg ci -m 'add foo'
1111 $ echo >> foo
1111 $ echo >> foo
1112 $ hg ci -m 'change foo 1'
1112 $ hg ci -m 'change foo 1'
1113 $ hg up -C 0
1113 $ hg up -C 0
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1114 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1115 $ echo 1 >> foo
1115 $ echo 1 >> foo
1116 $ hg ci -m 'change foo 2'
1116 $ hg ci -m 'change foo 2'
1117 created new head
1117 created new head
1118 $ HGMERGE=true hg merge
1118 $ HGMERGE=true hg merge
1119 merging foo
1119 merging foo
1120 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1120 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
1121 (branch merge, don't forget to commit)
1121 (branch merge, don't forget to commit)
1122 $ hg ci -m merge
1122 $ hg ci -m merge
1123 $ hg log
1123 $ hg log
1124 changeset: 3:99615015637b
1124 changeset: 3:99615015637b
1125 tag: tip
1125 tag: tip
1126 parent: 2:20cbbe65cff7
1126 parent: 2:20cbbe65cff7
1127 parent: 1:d2871fc282d4
1127 parent: 1:d2871fc282d4
1128 user: test
1128 user: test
1129 date: Thu Jan 01 00:00:00 1970 +0000
1129 date: Thu Jan 01 00:00:00 1970 +0000
1130 summary: merge
1130 summary: merge
1131
1131
1132 changeset: 2:20cbbe65cff7
1132 changeset: 2:20cbbe65cff7
1133 parent: 0:53245c60e682
1133 parent: 0:53245c60e682
1134 user: test
1134 user: test
1135 date: Thu Jan 01 00:00:00 1970 +0000
1135 date: Thu Jan 01 00:00:00 1970 +0000
1136 summary: change foo 2
1136 summary: change foo 2
1137
1137
1138 changeset: 1:d2871fc282d4
1138 changeset: 1:d2871fc282d4
1139 user: test
1139 user: test
1140 date: Thu Jan 01 00:00:00 1970 +0000
1140 date: Thu Jan 01 00:00:00 1970 +0000
1141 summary: change foo 1
1141 summary: change foo 1
1142
1142
1143 changeset: 0:53245c60e682
1143 changeset: 0:53245c60e682
1144 user: test
1144 user: test
1145 date: Thu Jan 01 00:00:00 1970 +0000
1145 date: Thu Jan 01 00:00:00 1970 +0000
1146 summary: add foo
1146 summary: add foo
1147
1147
1148 $ hg strip 1
1148 $ hg strip 1
1149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1149 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1150 saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
1150 saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob)
1151 $ checkundo strip
1151 $ checkundo strip
1152 $ hg log
1152 $ hg log
1153 changeset: 1:20cbbe65cff7
1153 changeset: 1:20cbbe65cff7
1154 tag: tip
1154 tag: tip
1155 user: test
1155 user: test
1156 date: Thu Jan 01 00:00:00 1970 +0000
1156 date: Thu Jan 01 00:00:00 1970 +0000
1157 summary: change foo 2
1157 summary: change foo 2
1158
1158
1159 changeset: 0:53245c60e682
1159 changeset: 0:53245c60e682
1160 user: test
1160 user: test
1161 date: Thu Jan 01 00:00:00 1970 +0000
1161 date: Thu Jan 01 00:00:00 1970 +0000
1162 summary: add foo
1162 summary: add foo
1163
1163
1164 $ cd ..
1164 $ cd ..
1165
1165
1166
1166
1167 qclone
1167 qclone
1168
1168
1169 $ qlog()
1169 $ qlog()
1170 > {
1170 > {
1171 > echo 'main repo:'
1171 > echo 'main repo:'
1172 > hg log --template ' rev {rev}: {desc}\n'
1172 > hg log --template ' rev {rev}: {desc}\n'
1173 > echo 'patch repo:'
1173 > echo 'patch repo:'
1174 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1174 > hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
1175 > }
1175 > }
1176 $ hg init qclonesource
1176 $ hg init qclonesource
1177 $ cd qclonesource
1177 $ cd qclonesource
1178 $ echo foo > foo
1178 $ echo foo > foo
1179 $ hg add foo
1179 $ hg add foo
1180 $ hg ci -m 'add foo'
1180 $ hg ci -m 'add foo'
1181 $ hg qinit
1181 $ hg qinit
1182 $ hg qnew patch1
1182 $ hg qnew patch1
1183 $ echo bar >> foo
1183 $ echo bar >> foo
1184 $ hg qrefresh -m 'change foo'
1184 $ hg qrefresh -m 'change foo'
1185 $ cd ..
1185 $ cd ..
1186
1186
1187
1187
1188 repo with unversioned patch dir
1188 repo with unversioned patch dir
1189
1189
1190 $ hg qclone qclonesource failure
1190 $ hg qclone qclonesource failure
1191 abort: versioned patch repository not found (see init --mq)
1191 abort: versioned patch repository not found (see init --mq)
1192 [255]
1192 [255]
1193
1193
1194 $ cd qclonesource
1194 $ cd qclonesource
1195 $ hg qinit -c
1195 $ hg qinit -c
1196 adding .hg/patches/patch1
1196 adding .hg/patches/patch1 (glob)
1197 $ hg qci -m checkpoint
1197 $ hg qci -m checkpoint
1198 $ qlog
1198 $ qlog
1199 main repo:
1199 main repo:
1200 rev 1: change foo
1200 rev 1: change foo
1201 rev 0: add foo
1201 rev 0: add foo
1202 patch repo:
1202 patch repo:
1203 rev 0: checkpoint
1203 rev 0: checkpoint
1204 $ cd ..
1204 $ cd ..
1205
1205
1206
1206
1207 repo with patches applied
1207 repo with patches applied
1208
1208
1209 $ hg qclone qclonesource qclonedest
1209 $ hg qclone qclonesource qclonedest
1210 updating to branch default
1210 updating to branch default
1211 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1211 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1212 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1213 $ cd qclonedest
1213 $ cd qclonedest
1214 $ qlog
1214 $ qlog
1215 main repo:
1215 main repo:
1216 rev 0: add foo
1216 rev 0: add foo
1217 patch repo:
1217 patch repo:
1218 rev 0: checkpoint
1218 rev 0: checkpoint
1219 $ cd ..
1219 $ cd ..
1220
1220
1221
1221
1222 repo with patches unapplied
1222 repo with patches unapplied
1223
1223
1224 $ cd qclonesource
1224 $ cd qclonesource
1225 $ hg qpop -a
1225 $ hg qpop -a
1226 popping patch1
1226 popping patch1
1227 patch queue now empty
1227 patch queue now empty
1228 $ qlog
1228 $ qlog
1229 main repo:
1229 main repo:
1230 rev 0: add foo
1230 rev 0: add foo
1231 patch repo:
1231 patch repo:
1232 rev 0: checkpoint
1232 rev 0: checkpoint
1233 $ cd ..
1233 $ cd ..
1234 $ hg qclone qclonesource qclonedest2
1234 $ hg qclone qclonesource qclonedest2
1235 updating to branch default
1235 updating to branch default
1236 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1236 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1238 $ cd qclonedest2
1238 $ cd qclonedest2
1239 $ qlog
1239 $ qlog
1240 main repo:
1240 main repo:
1241 rev 0: add foo
1241 rev 0: add foo
1242 patch repo:
1242 patch repo:
1243 rev 0: checkpoint
1243 rev 0: checkpoint
1244 $ cd ..
1244 $ cd ..
1245
1245
1246
1246
1247 Issue1033: test applying on an empty file
1247 Issue1033: test applying on an empty file
1248
1248
1249 $ hg init empty
1249 $ hg init empty
1250 $ cd empty
1250 $ cd empty
1251 $ touch a
1251 $ touch a
1252 $ hg ci -Am addempty
1252 $ hg ci -Am addempty
1253 adding a
1253 adding a
1254 $ echo a > a
1254 $ echo a > a
1255 $ hg qnew -f -e changea
1255 $ hg qnew -f -e changea
1256 $ hg qpop
1256 $ hg qpop
1257 popping changea
1257 popping changea
1258 patch queue now empty
1258 patch queue now empty
1259 $ hg qpush
1259 $ hg qpush
1260 applying changea
1260 applying changea
1261 now at: changea
1261 now at: changea
1262 $ cd ..
1262 $ cd ..
1263
1263
1264 test qpush with --force, issue1087
1264 test qpush with --force, issue1087
1265
1265
1266 $ hg init forcepush
1266 $ hg init forcepush
1267 $ cd forcepush
1267 $ cd forcepush
1268 $ echo hello > hello.txt
1268 $ echo hello > hello.txt
1269 $ echo bye > bye.txt
1269 $ echo bye > bye.txt
1270 $ hg ci -Ama
1270 $ hg ci -Ama
1271 adding bye.txt
1271 adding bye.txt
1272 adding hello.txt
1272 adding hello.txt
1273 $ hg qnew -d '0 0' empty
1273 $ hg qnew -d '0 0' empty
1274 $ hg qpop
1274 $ hg qpop
1275 popping empty
1275 popping empty
1276 patch queue now empty
1276 patch queue now empty
1277 $ echo world >> hello.txt
1277 $ echo world >> hello.txt
1278
1278
1279
1279
1280 qpush should fail, local changes
1280 qpush should fail, local changes
1281
1281
1282 $ hg qpush
1282 $ hg qpush
1283 abort: local changes found
1283 abort: local changes found
1284 [255]
1284 [255]
1285
1285
1286
1286
1287 apply force, should not discard changes with empty patch
1287 apply force, should not discard changes with empty patch
1288
1288
1289 $ hg qpush -f
1289 $ hg qpush -f
1290 applying empty
1290 applying empty
1291 patch empty is empty
1291 patch empty is empty
1292 now at: empty
1292 now at: empty
1293 $ hg diff --config diff.nodates=True
1293 $ hg diff --config diff.nodates=True
1294 diff -r d58265112590 hello.txt
1294 diff -r d58265112590 hello.txt
1295 --- a/hello.txt
1295 --- a/hello.txt
1296 +++ b/hello.txt
1296 +++ b/hello.txt
1297 @@ -1,1 +1,2 @@
1297 @@ -1,1 +1,2 @@
1298 hello
1298 hello
1299 +world
1299 +world
1300 $ hg qdiff --config diff.nodates=True
1300 $ hg qdiff --config diff.nodates=True
1301 diff -r 9ecee4f634e3 hello.txt
1301 diff -r 9ecee4f634e3 hello.txt
1302 --- a/hello.txt
1302 --- a/hello.txt
1303 +++ b/hello.txt
1303 +++ b/hello.txt
1304 @@ -1,1 +1,2 @@
1304 @@ -1,1 +1,2 @@
1305 hello
1305 hello
1306 +world
1306 +world
1307 $ hg log -l1 -p
1307 $ hg log -l1 -p
1308 changeset: 1:d58265112590
1308 changeset: 1:d58265112590
1309 tag: empty
1309 tag: empty
1310 tag: qbase
1310 tag: qbase
1311 tag: qtip
1311 tag: qtip
1312 tag: tip
1312 tag: tip
1313 user: test
1313 user: test
1314 date: Thu Jan 01 00:00:00 1970 +0000
1314 date: Thu Jan 01 00:00:00 1970 +0000
1315 summary: imported patch empty
1315 summary: imported patch empty
1316
1316
1317
1317
1318 $ hg qref -d '0 0'
1318 $ hg qref -d '0 0'
1319 $ hg qpop
1319 $ hg qpop
1320 popping empty
1320 popping empty
1321 patch queue now empty
1321 patch queue now empty
1322 $ echo universe >> hello.txt
1322 $ echo universe >> hello.txt
1323 $ echo universe >> bye.txt
1323 $ echo universe >> bye.txt
1324
1324
1325
1325
1326 qpush should fail, local changes
1326 qpush should fail, local changes
1327
1327
1328 $ hg qpush
1328 $ hg qpush
1329 abort: local changes found
1329 abort: local changes found
1330 [255]
1330 [255]
1331
1331
1332
1332
1333 apply force, should discard changes in hello, but not bye
1333 apply force, should discard changes in hello, but not bye
1334
1334
1335 $ hg qpush -f
1335 $ hg qpush -f
1336 applying empty
1336 applying empty
1337 now at: empty
1337 now at: empty
1338 $ hg st
1338 $ hg st
1339 M bye.txt
1339 M bye.txt
1340 $ hg diff --config diff.nodates=True
1340 $ hg diff --config diff.nodates=True
1341 diff -r ba252371dbc1 bye.txt
1341 diff -r ba252371dbc1 bye.txt
1342 --- a/bye.txt
1342 --- a/bye.txt
1343 +++ b/bye.txt
1343 +++ b/bye.txt
1344 @@ -1,1 +1,2 @@
1344 @@ -1,1 +1,2 @@
1345 bye
1345 bye
1346 +universe
1346 +universe
1347 $ hg qdiff --config diff.nodates=True
1347 $ hg qdiff --config diff.nodates=True
1348 diff -r 9ecee4f634e3 bye.txt
1348 diff -r 9ecee4f634e3 bye.txt
1349 --- a/bye.txt
1349 --- a/bye.txt
1350 +++ b/bye.txt
1350 +++ b/bye.txt
1351 @@ -1,1 +1,2 @@
1351 @@ -1,1 +1,2 @@
1352 bye
1352 bye
1353 +universe
1353 +universe
1354 diff -r 9ecee4f634e3 hello.txt
1354 diff -r 9ecee4f634e3 hello.txt
1355 --- a/hello.txt
1355 --- a/hello.txt
1356 +++ b/hello.txt
1356 +++ b/hello.txt
1357 @@ -1,1 +1,3 @@
1357 @@ -1,1 +1,3 @@
1358 hello
1358 hello
1359 +world
1359 +world
1360 +universe
1360 +universe
1361
1361
1362
1362
1363 test popping revisions not in working dir ancestry
1363 test popping revisions not in working dir ancestry
1364
1364
1365 $ hg qseries -v
1365 $ hg qseries -v
1366 0 A empty
1366 0 A empty
1367 $ hg up qparent
1367 $ hg up qparent
1368 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1368 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1369 $ hg qpop
1369 $ hg qpop
1370 popping empty
1370 popping empty
1371 patch queue now empty
1371 patch queue now empty
1372
1372
1373 $ cd ..
1373 $ cd ..
1374 $ hg init deletion-order
1374 $ hg init deletion-order
1375 $ cd deletion-order
1375 $ cd deletion-order
1376
1376
1377 $ touch a
1377 $ touch a
1378 $ hg ci -Aqm0
1378 $ hg ci -Aqm0
1379
1379
1380 $ hg qnew rename-dir
1380 $ hg qnew rename-dir
1381 $ hg rm a
1381 $ hg rm a
1382 $ hg qrefresh
1382 $ hg qrefresh
1383
1383
1384 $ mkdir a b
1384 $ mkdir a b
1385 $ touch a/a b/b
1385 $ touch a/a b/b
1386 $ hg add -q a b
1386 $ hg add -q a b
1387 $ hg qrefresh
1387 $ hg qrefresh
1388
1388
1389
1389
1390 test popping must remove files added in subdirectories first
1390 test popping must remove files added in subdirectories first
1391
1391
1392 $ hg qpop
1392 $ hg qpop
1393 popping rename-dir
1393 popping rename-dir
1394 patch queue now empty
1394 patch queue now empty
1395 $ cd ..
1395 $ cd ..
1396
1396
@@ -1,1344 +1,1344 b''
1
1
2 $ add()
2 $ add()
3 > {
3 > {
4 > echo $2 >> $1
4 > echo $2 >> $1
5 > }
5 > }
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8
8
9 set up a boring main branch
9 set up a boring main branch
10
10
11 $ add a a
11 $ add a a
12 $ hg add a
12 $ hg add a
13 $ mkdir x
13 $ mkdir x
14 $ add x/x x
14 $ add x/x x
15 $ hg add x/x
15 $ hg add x/x
16 $ hg ci -m0
16 $ hg ci -m0
17 $ add a m1
17 $ add a m1
18 $ hg ci -m1
18 $ hg ci -m1
19 $ add a m2
19 $ add a m2
20 $ add x/y y1
20 $ add x/y y1
21 $ hg add x/y
21 $ hg add x/y
22 $ hg ci -m2
22 $ hg ci -m2
23 $ cd ..
23 $ cd ..
24 $ show()
24 $ show()
25 > {
25 > {
26 > echo "- $2: $1"
26 > echo "- $2: $1"
27 > hg st -C $1
27 > hg st -C $1
28 > echo
28 > echo
29 > hg diff --git $1
29 > hg diff --git $1
30 > echo
30 > echo
31 > }
31 > }
32 $ count=0
32 $ count=0
33
33
34 make a new branch and get diff/status output
34 make a new branch and get diff/status output
35 $1 - first commit
35 $1 - first commit
36 $2 - second commit
36 $2 - second commit
37 $3 - working dir action
37 $3 - working dir action
38 $4 - test description
38 $4 - test description
39
39
40 $ tb()
40 $ tb()
41 > {
41 > {
42 > hg clone t t2 ; cd t2
42 > hg clone t t2 ; cd t2
43 > hg co -q -C 0
43 > hg co -q -C 0
44 >
44 >
45 > add a $count
45 > add a $count
46 > count=`expr $count + 1`
46 > count=`expr $count + 1`
47 > hg ci -m "t0"
47 > hg ci -m "t0"
48 > $1
48 > $1
49 > hg ci -m "t1"
49 > hg ci -m "t1"
50 > $2
50 > $2
51 > hg ci -m "t2"
51 > hg ci -m "t2"
52 > $3
52 > $3
53 >
53 >
54 > echo "** $4 **"
54 > echo "** $4 **"
55 > echo "** $1 / $2 / $3"
55 > echo "** $1 / $2 / $3"
56 > show "" "working to parent"
56 > show "" "working to parent"
57 > show "--rev 0" "working to root"
57 > show "--rev 0" "working to root"
58 > show "--rev 2" "working to branch"
58 > show "--rev 2" "working to branch"
59 > show "--rev 0 --rev ." "root to parent"
59 > show "--rev 0 --rev ." "root to parent"
60 > show "--rev . --rev 0" "parent to root"
60 > show "--rev . --rev 0" "parent to root"
61 > show "--rev 2 --rev ." "branch to parent"
61 > show "--rev 2 --rev ." "branch to parent"
62 > show "--rev . --rev 2" "parent to branch"
62 > show "--rev . --rev 2" "parent to branch"
63 > echo
63 > echo
64 > cd ..
64 > cd ..
65 > rm -rf t2
65 > rm -rf t2
66 > }
66 > }
67 $ tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
67 $ tb "add a a1" "add a a2" "hg mv a b" "rename in working dir"
68 updating to branch default
68 updating to branch default
69 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 created new head
70 created new head
71 ** rename in working dir **
71 ** rename in working dir **
72 ** add a a1 / add a a2 / hg mv a b
72 ** add a a1 / add a a2 / hg mv a b
73 - working to parent:
73 - working to parent:
74 A b
74 A b
75 a
75 a
76 R a
76 R a
77
77
78 diff --git a/a b/b
78 diff --git a/a b/b
79 rename from a
79 rename from a
80 rename to b
80 rename to b
81
81
82 - working to root: --rev 0
82 - working to root: --rev 0
83 A b
83 A b
84 a
84 a
85 R a
85 R a
86
86
87 diff --git a/a b/b
87 diff --git a/a b/b
88 rename from a
88 rename from a
89 rename to b
89 rename to b
90 --- a/a
90 --- a/a
91 +++ b/b
91 +++ b/b
92 @@ -1,1 +1,4 @@
92 @@ -1,1 +1,4 @@
93 a
93 a
94 +0
94 +0
95 +a1
95 +a1
96 +a2
96 +a2
97
97
98 - working to branch: --rev 2
98 - working to branch: --rev 2
99 A b
99 A b
100 a
100 a
101 R a
101 R a
102 R x/y
102 R x/y
103
103
104 diff --git a/a b/b
104 diff --git a/a b/b
105 rename from a
105 rename from a
106 rename to b
106 rename to b
107 --- a/a
107 --- a/a
108 +++ b/b
108 +++ b/b
109 @@ -1,3 +1,4 @@
109 @@ -1,3 +1,4 @@
110 a
110 a
111 -m1
111 -m1
112 -m2
112 -m2
113 +0
113 +0
114 +a1
114 +a1
115 +a2
115 +a2
116 diff --git a/x/y b/x/y
116 diff --git a/x/y b/x/y
117 deleted file mode 100644
117 deleted file mode 100644
118 --- a/x/y
118 --- a/x/y
119 +++ /dev/null
119 +++ /dev/null
120 @@ -1,1 +0,0 @@
120 @@ -1,1 +0,0 @@
121 -y1
121 -y1
122
122
123 - root to parent: --rev 0 --rev .
123 - root to parent: --rev 0 --rev .
124 M a
124 M a
125
125
126 diff --git a/a b/a
126 diff --git a/a b/a
127 --- a/a
127 --- a/a
128 +++ b/a
128 +++ b/a
129 @@ -1,1 +1,4 @@
129 @@ -1,1 +1,4 @@
130 a
130 a
131 +0
131 +0
132 +a1
132 +a1
133 +a2
133 +a2
134
134
135 - parent to root: --rev . --rev 0
135 - parent to root: --rev . --rev 0
136 M a
136 M a
137
137
138 diff --git a/a b/a
138 diff --git a/a b/a
139 --- a/a
139 --- a/a
140 +++ b/a
140 +++ b/a
141 @@ -1,4 +1,1 @@
141 @@ -1,4 +1,1 @@
142 a
142 a
143 -0
143 -0
144 -a1
144 -a1
145 -a2
145 -a2
146
146
147 - branch to parent: --rev 2 --rev .
147 - branch to parent: --rev 2 --rev .
148 M a
148 M a
149 R x/y
149 R x/y
150
150
151 diff --git a/a b/a
151 diff --git a/a b/a
152 --- a/a
152 --- a/a
153 +++ b/a
153 +++ b/a
154 @@ -1,3 +1,4 @@
154 @@ -1,3 +1,4 @@
155 a
155 a
156 -m1
156 -m1
157 -m2
157 -m2
158 +0
158 +0
159 +a1
159 +a1
160 +a2
160 +a2
161 diff --git a/x/y b/x/y
161 diff --git a/x/y b/x/y
162 deleted file mode 100644
162 deleted file mode 100644
163 --- a/x/y
163 --- a/x/y
164 +++ /dev/null
164 +++ /dev/null
165 @@ -1,1 +0,0 @@
165 @@ -1,1 +0,0 @@
166 -y1
166 -y1
167
167
168 - parent to branch: --rev . --rev 2
168 - parent to branch: --rev . --rev 2
169 M a
169 M a
170 A x/y
170 A x/y
171
171
172 diff --git a/a b/a
172 diff --git a/a b/a
173 --- a/a
173 --- a/a
174 +++ b/a
174 +++ b/a
175 @@ -1,4 +1,3 @@
175 @@ -1,4 +1,3 @@
176 a
176 a
177 -0
177 -0
178 -a1
178 -a1
179 -a2
179 -a2
180 +m1
180 +m1
181 +m2
181 +m2
182 diff --git a/x/y b/x/y
182 diff --git a/x/y b/x/y
183 new file mode 100644
183 new file mode 100644
184 --- /dev/null
184 --- /dev/null
185 +++ b/x/y
185 +++ b/x/y
186 @@ -0,0 +1,1 @@
186 @@ -0,0 +1,1 @@
187 +y1
187 +y1
188
188
189
189
190 $ tb "add a a1" "add a a2" "hg cp a b" "copy in working dir"
190 $ tb "add a a1" "add a a2" "hg cp a b" "copy in working dir"
191 updating to branch default
191 updating to branch default
192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 created new head
193 created new head
194 ** copy in working dir **
194 ** copy in working dir **
195 ** add a a1 / add a a2 / hg cp a b
195 ** add a a1 / add a a2 / hg cp a b
196 - working to parent:
196 - working to parent:
197 A b
197 A b
198 a
198 a
199
199
200 diff --git a/a b/b
200 diff --git a/a b/b
201 copy from a
201 copy from a
202 copy to b
202 copy to b
203
203
204 - working to root: --rev 0
204 - working to root: --rev 0
205 M a
205 M a
206 A b
206 A b
207 a
207 a
208
208
209 diff --git a/a b/a
209 diff --git a/a b/a
210 --- a/a
210 --- a/a
211 +++ b/a
211 +++ b/a
212 @@ -1,1 +1,4 @@
212 @@ -1,1 +1,4 @@
213 a
213 a
214 +1
214 +1
215 +a1
215 +a1
216 +a2
216 +a2
217 diff --git a/a b/b
217 diff --git a/a b/b
218 copy from a
218 copy from a
219 copy to b
219 copy to b
220 --- a/a
220 --- a/a
221 +++ b/b
221 +++ b/b
222 @@ -1,1 +1,4 @@
222 @@ -1,1 +1,4 @@
223 a
223 a
224 +1
224 +1
225 +a1
225 +a1
226 +a2
226 +a2
227
227
228 - working to branch: --rev 2
228 - working to branch: --rev 2
229 M a
229 M a
230 A b
230 A b
231 a
231 a
232 R x/y
232 R x/y
233
233
234 diff --git a/a b/a
234 diff --git a/a b/a
235 --- a/a
235 --- a/a
236 +++ b/a
236 +++ b/a
237 @@ -1,3 +1,4 @@
237 @@ -1,3 +1,4 @@
238 a
238 a
239 -m1
239 -m1
240 -m2
240 -m2
241 +1
241 +1
242 +a1
242 +a1
243 +a2
243 +a2
244 diff --git a/a b/b
244 diff --git a/a b/b
245 copy from a
245 copy from a
246 copy to b
246 copy to b
247 --- a/a
247 --- a/a
248 +++ b/b
248 +++ b/b
249 @@ -1,3 +1,4 @@
249 @@ -1,3 +1,4 @@
250 a
250 a
251 -m1
251 -m1
252 -m2
252 -m2
253 +1
253 +1
254 +a1
254 +a1
255 +a2
255 +a2
256 diff --git a/x/y b/x/y
256 diff --git a/x/y b/x/y
257 deleted file mode 100644
257 deleted file mode 100644
258 --- a/x/y
258 --- a/x/y
259 +++ /dev/null
259 +++ /dev/null
260 @@ -1,1 +0,0 @@
260 @@ -1,1 +0,0 @@
261 -y1
261 -y1
262
262
263 - root to parent: --rev 0 --rev .
263 - root to parent: --rev 0 --rev .
264 M a
264 M a
265
265
266 diff --git a/a b/a
266 diff --git a/a b/a
267 --- a/a
267 --- a/a
268 +++ b/a
268 +++ b/a
269 @@ -1,1 +1,4 @@
269 @@ -1,1 +1,4 @@
270 a
270 a
271 +1
271 +1
272 +a1
272 +a1
273 +a2
273 +a2
274
274
275 - parent to root: --rev . --rev 0
275 - parent to root: --rev . --rev 0
276 M a
276 M a
277
277
278 diff --git a/a b/a
278 diff --git a/a b/a
279 --- a/a
279 --- a/a
280 +++ b/a
280 +++ b/a
281 @@ -1,4 +1,1 @@
281 @@ -1,4 +1,1 @@
282 a
282 a
283 -1
283 -1
284 -a1
284 -a1
285 -a2
285 -a2
286
286
287 - branch to parent: --rev 2 --rev .
287 - branch to parent: --rev 2 --rev .
288 M a
288 M a
289 R x/y
289 R x/y
290
290
291 diff --git a/a b/a
291 diff --git a/a b/a
292 --- a/a
292 --- a/a
293 +++ b/a
293 +++ b/a
294 @@ -1,3 +1,4 @@
294 @@ -1,3 +1,4 @@
295 a
295 a
296 -m1
296 -m1
297 -m2
297 -m2
298 +1
298 +1
299 +a1
299 +a1
300 +a2
300 +a2
301 diff --git a/x/y b/x/y
301 diff --git a/x/y b/x/y
302 deleted file mode 100644
302 deleted file mode 100644
303 --- a/x/y
303 --- a/x/y
304 +++ /dev/null
304 +++ /dev/null
305 @@ -1,1 +0,0 @@
305 @@ -1,1 +0,0 @@
306 -y1
306 -y1
307
307
308 - parent to branch: --rev . --rev 2
308 - parent to branch: --rev . --rev 2
309 M a
309 M a
310 A x/y
310 A x/y
311
311
312 diff --git a/a b/a
312 diff --git a/a b/a
313 --- a/a
313 --- a/a
314 +++ b/a
314 +++ b/a
315 @@ -1,4 +1,3 @@
315 @@ -1,4 +1,3 @@
316 a
316 a
317 -1
317 -1
318 -a1
318 -a1
319 -a2
319 -a2
320 +m1
320 +m1
321 +m2
321 +m2
322 diff --git a/x/y b/x/y
322 diff --git a/x/y b/x/y
323 new file mode 100644
323 new file mode 100644
324 --- /dev/null
324 --- /dev/null
325 +++ b/x/y
325 +++ b/x/y
326 @@ -0,0 +1,1 @@
326 @@ -0,0 +1,1 @@
327 +y1
327 +y1
328
328
329
329
330 $ tb "hg mv a b" "add b b1" "add b w" "single rename"
330 $ tb "hg mv a b" "add b b1" "add b w" "single rename"
331 updating to branch default
331 updating to branch default
332 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
333 created new head
333 created new head
334 ** single rename **
334 ** single rename **
335 ** hg mv a b / add b b1 / add b w
335 ** hg mv a b / add b b1 / add b w
336 - working to parent:
336 - working to parent:
337 M b
337 M b
338
338
339 diff --git a/b b/b
339 diff --git a/b b/b
340 --- a/b
340 --- a/b
341 +++ b/b
341 +++ b/b
342 @@ -1,3 +1,4 @@
342 @@ -1,3 +1,4 @@
343 a
343 a
344 2
344 2
345 b1
345 b1
346 +w
346 +w
347
347
348 - working to root: --rev 0
348 - working to root: --rev 0
349 A b
349 A b
350 a
350 a
351 R a
351 R a
352
352
353 diff --git a/a b/b
353 diff --git a/a b/b
354 rename from a
354 rename from a
355 rename to b
355 rename to b
356 --- a/a
356 --- a/a
357 +++ b/b
357 +++ b/b
358 @@ -1,1 +1,4 @@
358 @@ -1,1 +1,4 @@
359 a
359 a
360 +2
360 +2
361 +b1
361 +b1
362 +w
362 +w
363
363
364 - working to branch: --rev 2
364 - working to branch: --rev 2
365 A b
365 A b
366 a
366 a
367 R a
367 R a
368 R x/y
368 R x/y
369
369
370 diff --git a/a b/b
370 diff --git a/a b/b
371 rename from a
371 rename from a
372 rename to b
372 rename to b
373 --- a/a
373 --- a/a
374 +++ b/b
374 +++ b/b
375 @@ -1,3 +1,4 @@
375 @@ -1,3 +1,4 @@
376 a
376 a
377 -m1
377 -m1
378 -m2
378 -m2
379 +2
379 +2
380 +b1
380 +b1
381 +w
381 +w
382 diff --git a/x/y b/x/y
382 diff --git a/x/y b/x/y
383 deleted file mode 100644
383 deleted file mode 100644
384 --- a/x/y
384 --- a/x/y
385 +++ /dev/null
385 +++ /dev/null
386 @@ -1,1 +0,0 @@
386 @@ -1,1 +0,0 @@
387 -y1
387 -y1
388
388
389 - root to parent: --rev 0 --rev .
389 - root to parent: --rev 0 --rev .
390 A b
390 A b
391 a
391 a
392 R a
392 R a
393
393
394 diff --git a/a b/b
394 diff --git a/a b/b
395 rename from a
395 rename from a
396 rename to b
396 rename to b
397 --- a/a
397 --- a/a
398 +++ b/b
398 +++ b/b
399 @@ -1,1 +1,3 @@
399 @@ -1,1 +1,3 @@
400 a
400 a
401 +2
401 +2
402 +b1
402 +b1
403
403
404 - parent to root: --rev . --rev 0
404 - parent to root: --rev . --rev 0
405 A a
405 A a
406 b
406 b
407 R b
407 R b
408
408
409 diff --git a/b b/a
409 diff --git a/b b/a
410 rename from b
410 rename from b
411 rename to a
411 rename to a
412 --- a/b
412 --- a/b
413 +++ b/a
413 +++ b/a
414 @@ -1,3 +1,1 @@
414 @@ -1,3 +1,1 @@
415 a
415 a
416 -2
416 -2
417 -b1
417 -b1
418
418
419 - branch to parent: --rev 2 --rev .
419 - branch to parent: --rev 2 --rev .
420 A b
420 A b
421 a
421 a
422 R a
422 R a
423 R x/y
423 R x/y
424
424
425 diff --git a/a b/b
425 diff --git a/a b/b
426 rename from a
426 rename from a
427 rename to b
427 rename to b
428 --- a/a
428 --- a/a
429 +++ b/b
429 +++ b/b
430 @@ -1,3 +1,3 @@
430 @@ -1,3 +1,3 @@
431 a
431 a
432 -m1
432 -m1
433 -m2
433 -m2
434 +2
434 +2
435 +b1
435 +b1
436 diff --git a/x/y b/x/y
436 diff --git a/x/y b/x/y
437 deleted file mode 100644
437 deleted file mode 100644
438 --- a/x/y
438 --- a/x/y
439 +++ /dev/null
439 +++ /dev/null
440 @@ -1,1 +0,0 @@
440 @@ -1,1 +0,0 @@
441 -y1
441 -y1
442
442
443 - parent to branch: --rev . --rev 2
443 - parent to branch: --rev . --rev 2
444 A a
444 A a
445 b
445 b
446 A x/y
446 A x/y
447 R b
447 R b
448
448
449 diff --git a/b b/a
449 diff --git a/b b/a
450 rename from b
450 rename from b
451 rename to a
451 rename to a
452 --- a/b
452 --- a/b
453 +++ b/a
453 +++ b/a
454 @@ -1,3 +1,3 @@
454 @@ -1,3 +1,3 @@
455 a
455 a
456 -2
456 -2
457 -b1
457 -b1
458 +m1
458 +m1
459 +m2
459 +m2
460 diff --git a/x/y b/x/y
460 diff --git a/x/y b/x/y
461 new file mode 100644
461 new file mode 100644
462 --- /dev/null
462 --- /dev/null
463 +++ b/x/y
463 +++ b/x/y
464 @@ -0,0 +1,1 @@
464 @@ -0,0 +1,1 @@
465 +y1
465 +y1
466
466
467
467
468 $ tb "hg cp a b" "add b b1" "add a w" "single copy"
468 $ tb "hg cp a b" "add b b1" "add a w" "single copy"
469 updating to branch default
469 updating to branch default
470 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
470 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
471 created new head
471 created new head
472 ** single copy **
472 ** single copy **
473 ** hg cp a b / add b b1 / add a w
473 ** hg cp a b / add b b1 / add a w
474 - working to parent:
474 - working to parent:
475 M a
475 M a
476
476
477 diff --git a/a b/a
477 diff --git a/a b/a
478 --- a/a
478 --- a/a
479 +++ b/a
479 +++ b/a
480 @@ -1,2 +1,3 @@
480 @@ -1,2 +1,3 @@
481 a
481 a
482 3
482 3
483 +w
483 +w
484
484
485 - working to root: --rev 0
485 - working to root: --rev 0
486 M a
486 M a
487 A b
487 A b
488 a
488 a
489
489
490 diff --git a/a b/a
490 diff --git a/a b/a
491 --- a/a
491 --- a/a
492 +++ b/a
492 +++ b/a
493 @@ -1,1 +1,3 @@
493 @@ -1,1 +1,3 @@
494 a
494 a
495 +3
495 +3
496 +w
496 +w
497 diff --git a/a b/b
497 diff --git a/a b/b
498 copy from a
498 copy from a
499 copy to b
499 copy to b
500 --- a/a
500 --- a/a
501 +++ b/b
501 +++ b/b
502 @@ -1,1 +1,3 @@
502 @@ -1,1 +1,3 @@
503 a
503 a
504 +3
504 +3
505 +b1
505 +b1
506
506
507 - working to branch: --rev 2
507 - working to branch: --rev 2
508 M a
508 M a
509 A b
509 A b
510 a
510 a
511 R x/y
511 R x/y
512
512
513 diff --git a/a b/a
513 diff --git a/a b/a
514 --- a/a
514 --- a/a
515 +++ b/a
515 +++ b/a
516 @@ -1,3 +1,3 @@
516 @@ -1,3 +1,3 @@
517 a
517 a
518 -m1
518 -m1
519 -m2
519 -m2
520 +3
520 +3
521 +w
521 +w
522 diff --git a/a b/b
522 diff --git a/a b/b
523 copy from a
523 copy from a
524 copy to b
524 copy to b
525 --- a/a
525 --- a/a
526 +++ b/b
526 +++ b/b
527 @@ -1,3 +1,3 @@
527 @@ -1,3 +1,3 @@
528 a
528 a
529 -m1
529 -m1
530 -m2
530 -m2
531 +3
531 +3
532 +b1
532 +b1
533 diff --git a/x/y b/x/y
533 diff --git a/x/y b/x/y
534 deleted file mode 100644
534 deleted file mode 100644
535 --- a/x/y
535 --- a/x/y
536 +++ /dev/null
536 +++ /dev/null
537 @@ -1,1 +0,0 @@
537 @@ -1,1 +0,0 @@
538 -y1
538 -y1
539
539
540 - root to parent: --rev 0 --rev .
540 - root to parent: --rev 0 --rev .
541 M a
541 M a
542 A b
542 A b
543 a
543 a
544
544
545 diff --git a/a b/a
545 diff --git a/a b/a
546 --- a/a
546 --- a/a
547 +++ b/a
547 +++ b/a
548 @@ -1,1 +1,2 @@
548 @@ -1,1 +1,2 @@
549 a
549 a
550 +3
550 +3
551 diff --git a/a b/b
551 diff --git a/a b/b
552 copy from a
552 copy from a
553 copy to b
553 copy to b
554 --- a/a
554 --- a/a
555 +++ b/b
555 +++ b/b
556 @@ -1,1 +1,3 @@
556 @@ -1,1 +1,3 @@
557 a
557 a
558 +3
558 +3
559 +b1
559 +b1
560
560
561 - parent to root: --rev . --rev 0
561 - parent to root: --rev . --rev 0
562 M a
562 M a
563 R b
563 R b
564
564
565 diff --git a/a b/a
565 diff --git a/a b/a
566 --- a/a
566 --- a/a
567 +++ b/a
567 +++ b/a
568 @@ -1,2 +1,1 @@
568 @@ -1,2 +1,1 @@
569 a
569 a
570 -3
570 -3
571 diff --git a/b b/b
571 diff --git a/b b/b
572 deleted file mode 100644
572 deleted file mode 100644
573 --- a/b
573 --- a/b
574 +++ /dev/null
574 +++ /dev/null
575 @@ -1,3 +0,0 @@
575 @@ -1,3 +0,0 @@
576 -a
576 -a
577 -3
577 -3
578 -b1
578 -b1
579
579
580 - branch to parent: --rev 2 --rev .
580 - branch to parent: --rev 2 --rev .
581 M a
581 M a
582 A b
582 A b
583 a
583 a
584 R x/y
584 R x/y
585
585
586 diff --git a/a b/a
586 diff --git a/a b/a
587 --- a/a
587 --- a/a
588 +++ b/a
588 +++ b/a
589 @@ -1,3 +1,2 @@
589 @@ -1,3 +1,2 @@
590 a
590 a
591 -m1
591 -m1
592 -m2
592 -m2
593 +3
593 +3
594 diff --git a/a b/b
594 diff --git a/a b/b
595 copy from a
595 copy from a
596 copy to b
596 copy to b
597 --- a/a
597 --- a/a
598 +++ b/b
598 +++ b/b
599 @@ -1,3 +1,3 @@
599 @@ -1,3 +1,3 @@
600 a
600 a
601 -m1
601 -m1
602 -m2
602 -m2
603 +3
603 +3
604 +b1
604 +b1
605 diff --git a/x/y b/x/y
605 diff --git a/x/y b/x/y
606 deleted file mode 100644
606 deleted file mode 100644
607 --- a/x/y
607 --- a/x/y
608 +++ /dev/null
608 +++ /dev/null
609 @@ -1,1 +0,0 @@
609 @@ -1,1 +0,0 @@
610 -y1
610 -y1
611
611
612 - parent to branch: --rev . --rev 2
612 - parent to branch: --rev . --rev 2
613 M a
613 M a
614 A x/y
614 A x/y
615 R b
615 R b
616
616
617 diff --git a/a b/a
617 diff --git a/a b/a
618 --- a/a
618 --- a/a
619 +++ b/a
619 +++ b/a
620 @@ -1,2 +1,3 @@
620 @@ -1,2 +1,3 @@
621 a
621 a
622 -3
622 -3
623 +m1
623 +m1
624 +m2
624 +m2
625 diff --git a/b b/b
625 diff --git a/b b/b
626 deleted file mode 100644
626 deleted file mode 100644
627 --- a/b
627 --- a/b
628 +++ /dev/null
628 +++ /dev/null
629 @@ -1,3 +0,0 @@
629 @@ -1,3 +0,0 @@
630 -a
630 -a
631 -3
631 -3
632 -b1
632 -b1
633 diff --git a/x/y b/x/y
633 diff --git a/x/y b/x/y
634 new file mode 100644
634 new file mode 100644
635 --- /dev/null
635 --- /dev/null
636 +++ b/x/y
636 +++ b/x/y
637 @@ -0,0 +1,1 @@
637 @@ -0,0 +1,1 @@
638 +y1
638 +y1
639
639
640
640
641 $ tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
641 $ tb "hg mv a b" "hg mv b c" "hg mv c d" "rename chain"
642 updating to branch default
642 updating to branch default
643 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
644 created new head
644 created new head
645 ** rename chain **
645 ** rename chain **
646 ** hg mv a b / hg mv b c / hg mv c d
646 ** hg mv a b / hg mv b c / hg mv c d
647 - working to parent:
647 - working to parent:
648 A d
648 A d
649 c
649 c
650 R c
650 R c
651
651
652 diff --git a/c b/d
652 diff --git a/c b/d
653 rename from c
653 rename from c
654 rename to d
654 rename to d
655
655
656 - working to root: --rev 0
656 - working to root: --rev 0
657 A d
657 A d
658 a
658 a
659 R a
659 R a
660
660
661 diff --git a/a b/d
661 diff --git a/a b/d
662 rename from a
662 rename from a
663 rename to d
663 rename to d
664 --- a/a
664 --- a/a
665 +++ b/d
665 +++ b/d
666 @@ -1,1 +1,2 @@
666 @@ -1,1 +1,2 @@
667 a
667 a
668 +4
668 +4
669
669
670 - working to branch: --rev 2
670 - working to branch: --rev 2
671 A d
671 A d
672 a
672 a
673 R a
673 R a
674 R x/y
674 R x/y
675
675
676 diff --git a/a b/d
676 diff --git a/a b/d
677 rename from a
677 rename from a
678 rename to d
678 rename to d
679 --- a/a
679 --- a/a
680 +++ b/d
680 +++ b/d
681 @@ -1,3 +1,2 @@
681 @@ -1,3 +1,2 @@
682 a
682 a
683 -m1
683 -m1
684 -m2
684 -m2
685 +4
685 +4
686 diff --git a/x/y b/x/y
686 diff --git a/x/y b/x/y
687 deleted file mode 100644
687 deleted file mode 100644
688 --- a/x/y
688 --- a/x/y
689 +++ /dev/null
689 +++ /dev/null
690 @@ -1,1 +0,0 @@
690 @@ -1,1 +0,0 @@
691 -y1
691 -y1
692
692
693 - root to parent: --rev 0 --rev .
693 - root to parent: --rev 0 --rev .
694 A c
694 A c
695 a
695 a
696 R a
696 R a
697
697
698 diff --git a/a b/c
698 diff --git a/a b/c
699 rename from a
699 rename from a
700 rename to c
700 rename to c
701 --- a/a
701 --- a/a
702 +++ b/c
702 +++ b/c
703 @@ -1,1 +1,2 @@
703 @@ -1,1 +1,2 @@
704 a
704 a
705 +4
705 +4
706
706
707 - parent to root: --rev . --rev 0
707 - parent to root: --rev . --rev 0
708 A a
708 A a
709 c
709 c
710 R c
710 R c
711
711
712 diff --git a/c b/a
712 diff --git a/c b/a
713 rename from c
713 rename from c
714 rename to a
714 rename to a
715 --- a/c
715 --- a/c
716 +++ b/a
716 +++ b/a
717 @@ -1,2 +1,1 @@
717 @@ -1,2 +1,1 @@
718 a
718 a
719 -4
719 -4
720
720
721 - branch to parent: --rev 2 --rev .
721 - branch to parent: --rev 2 --rev .
722 A c
722 A c
723 a
723 a
724 R a
724 R a
725 R x/y
725 R x/y
726
726
727 diff --git a/a b/c
727 diff --git a/a b/c
728 rename from a
728 rename from a
729 rename to c
729 rename to c
730 --- a/a
730 --- a/a
731 +++ b/c
731 +++ b/c
732 @@ -1,3 +1,2 @@
732 @@ -1,3 +1,2 @@
733 a
733 a
734 -m1
734 -m1
735 -m2
735 -m2
736 +4
736 +4
737 diff --git a/x/y b/x/y
737 diff --git a/x/y b/x/y
738 deleted file mode 100644
738 deleted file mode 100644
739 --- a/x/y
739 --- a/x/y
740 +++ /dev/null
740 +++ /dev/null
741 @@ -1,1 +0,0 @@
741 @@ -1,1 +0,0 @@
742 -y1
742 -y1
743
743
744 - parent to branch: --rev . --rev 2
744 - parent to branch: --rev . --rev 2
745 A a
745 A a
746 c
746 c
747 A x/y
747 A x/y
748 R c
748 R c
749
749
750 diff --git a/c b/a
750 diff --git a/c b/a
751 rename from c
751 rename from c
752 rename to a
752 rename to a
753 --- a/c
753 --- a/c
754 +++ b/a
754 +++ b/a
755 @@ -1,2 +1,3 @@
755 @@ -1,2 +1,3 @@
756 a
756 a
757 -4
757 -4
758 +m1
758 +m1
759 +m2
759 +m2
760 diff --git a/x/y b/x/y
760 diff --git a/x/y b/x/y
761 new file mode 100644
761 new file mode 100644
762 --- /dev/null
762 --- /dev/null
763 +++ b/x/y
763 +++ b/x/y
764 @@ -0,0 +1,1 @@
764 @@ -0,0 +1,1 @@
765 +y1
765 +y1
766
766
767
767
768 $ tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
768 $ tb "hg cp a b" "hg cp b c" "hg cp c d" "copy chain"
769 updating to branch default
769 updating to branch default
770 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
770 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
771 created new head
771 created new head
772 ** copy chain **
772 ** copy chain **
773 ** hg cp a b / hg cp b c / hg cp c d
773 ** hg cp a b / hg cp b c / hg cp c d
774 - working to parent:
774 - working to parent:
775 A d
775 A d
776 c
776 c
777
777
778 diff --git a/c b/d
778 diff --git a/c b/d
779 copy from c
779 copy from c
780 copy to d
780 copy to d
781
781
782 - working to root: --rev 0
782 - working to root: --rev 0
783 M a
783 M a
784 A b
784 A b
785 a
785 a
786 A c
786 A c
787 a
787 a
788 A d
788 A d
789 a
789 a
790
790
791 diff --git a/a b/a
791 diff --git a/a b/a
792 --- a/a
792 --- a/a
793 +++ b/a
793 +++ b/a
794 @@ -1,1 +1,2 @@
794 @@ -1,1 +1,2 @@
795 a
795 a
796 +5
796 +5
797 diff --git a/a b/b
797 diff --git a/a b/b
798 copy from a
798 copy from a
799 copy to b
799 copy to b
800 --- a/a
800 --- a/a
801 +++ b/b
801 +++ b/b
802 @@ -1,1 +1,2 @@
802 @@ -1,1 +1,2 @@
803 a
803 a
804 +5
804 +5
805 diff --git a/a b/c
805 diff --git a/a b/c
806 copy from a
806 copy from a
807 copy to c
807 copy to c
808 --- a/a
808 --- a/a
809 +++ b/c
809 +++ b/c
810 @@ -1,1 +1,2 @@
810 @@ -1,1 +1,2 @@
811 a
811 a
812 +5
812 +5
813 diff --git a/a b/d
813 diff --git a/a b/d
814 copy from a
814 copy from a
815 copy to d
815 copy to d
816 --- a/a
816 --- a/a
817 +++ b/d
817 +++ b/d
818 @@ -1,1 +1,2 @@
818 @@ -1,1 +1,2 @@
819 a
819 a
820 +5
820 +5
821
821
822 - working to branch: --rev 2
822 - working to branch: --rev 2
823 M a
823 M a
824 A b
824 A b
825 a
825 a
826 A c
826 A c
827 a
827 a
828 A d
828 A d
829 a
829 a
830 R x/y
830 R x/y
831
831
832 diff --git a/a b/a
832 diff --git a/a b/a
833 --- a/a
833 --- a/a
834 +++ b/a
834 +++ b/a
835 @@ -1,3 +1,2 @@
835 @@ -1,3 +1,2 @@
836 a
836 a
837 -m1
837 -m1
838 -m2
838 -m2
839 +5
839 +5
840 diff --git a/a b/b
840 diff --git a/a b/b
841 copy from a
841 copy from a
842 copy to b
842 copy to b
843 --- a/a
843 --- a/a
844 +++ b/b
844 +++ b/b
845 @@ -1,3 +1,2 @@
845 @@ -1,3 +1,2 @@
846 a
846 a
847 -m1
847 -m1
848 -m2
848 -m2
849 +5
849 +5
850 diff --git a/a b/c
850 diff --git a/a b/c
851 copy from a
851 copy from a
852 copy to c
852 copy to c
853 --- a/a
853 --- a/a
854 +++ b/c
854 +++ b/c
855 @@ -1,3 +1,2 @@
855 @@ -1,3 +1,2 @@
856 a
856 a
857 -m1
857 -m1
858 -m2
858 -m2
859 +5
859 +5
860 diff --git a/a b/d
860 diff --git a/a b/d
861 copy from a
861 copy from a
862 copy to d
862 copy to d
863 --- a/a
863 --- a/a
864 +++ b/d
864 +++ b/d
865 @@ -1,3 +1,2 @@
865 @@ -1,3 +1,2 @@
866 a
866 a
867 -m1
867 -m1
868 -m2
868 -m2
869 +5
869 +5
870 diff --git a/x/y b/x/y
870 diff --git a/x/y b/x/y
871 deleted file mode 100644
871 deleted file mode 100644
872 --- a/x/y
872 --- a/x/y
873 +++ /dev/null
873 +++ /dev/null
874 @@ -1,1 +0,0 @@
874 @@ -1,1 +0,0 @@
875 -y1
875 -y1
876
876
877 - root to parent: --rev 0 --rev .
877 - root to parent: --rev 0 --rev .
878 M a
878 M a
879 A b
879 A b
880 a
880 a
881 A c
881 A c
882 a
882 a
883
883
884 diff --git a/a b/a
884 diff --git a/a b/a
885 --- a/a
885 --- a/a
886 +++ b/a
886 +++ b/a
887 @@ -1,1 +1,2 @@
887 @@ -1,1 +1,2 @@
888 a
888 a
889 +5
889 +5
890 diff --git a/a b/b
890 diff --git a/a b/b
891 copy from a
891 copy from a
892 copy to b
892 copy to b
893 --- a/a
893 --- a/a
894 +++ b/b
894 +++ b/b
895 @@ -1,1 +1,2 @@
895 @@ -1,1 +1,2 @@
896 a
896 a
897 +5
897 +5
898 diff --git a/a b/c
898 diff --git a/a b/c
899 copy from a
899 copy from a
900 copy to c
900 copy to c
901 --- a/a
901 --- a/a
902 +++ b/c
902 +++ b/c
903 @@ -1,1 +1,2 @@
903 @@ -1,1 +1,2 @@
904 a
904 a
905 +5
905 +5
906
906
907 - parent to root: --rev . --rev 0
907 - parent to root: --rev . --rev 0
908 M a
908 M a
909 R b
909 R b
910 R c
910 R c
911
911
912 diff --git a/a b/a
912 diff --git a/a b/a
913 --- a/a
913 --- a/a
914 +++ b/a
914 +++ b/a
915 @@ -1,2 +1,1 @@
915 @@ -1,2 +1,1 @@
916 a
916 a
917 -5
917 -5
918 diff --git a/b b/b
918 diff --git a/b b/b
919 deleted file mode 100644
919 deleted file mode 100644
920 --- a/b
920 --- a/b
921 +++ /dev/null
921 +++ /dev/null
922 @@ -1,2 +0,0 @@
922 @@ -1,2 +0,0 @@
923 -a
923 -a
924 -5
924 -5
925 diff --git a/c b/c
925 diff --git a/c b/c
926 deleted file mode 100644
926 deleted file mode 100644
927 --- a/c
927 --- a/c
928 +++ /dev/null
928 +++ /dev/null
929 @@ -1,2 +0,0 @@
929 @@ -1,2 +0,0 @@
930 -a
930 -a
931 -5
931 -5
932
932
933 - branch to parent: --rev 2 --rev .
933 - branch to parent: --rev 2 --rev .
934 M a
934 M a
935 A b
935 A b
936 a
936 a
937 A c
937 A c
938 a
938 a
939 R x/y
939 R x/y
940
940
941 diff --git a/a b/a
941 diff --git a/a b/a
942 --- a/a
942 --- a/a
943 +++ b/a
943 +++ b/a
944 @@ -1,3 +1,2 @@
944 @@ -1,3 +1,2 @@
945 a
945 a
946 -m1
946 -m1
947 -m2
947 -m2
948 +5
948 +5
949 diff --git a/a b/b
949 diff --git a/a b/b
950 copy from a
950 copy from a
951 copy to b
951 copy to b
952 --- a/a
952 --- a/a
953 +++ b/b
953 +++ b/b
954 @@ -1,3 +1,2 @@
954 @@ -1,3 +1,2 @@
955 a
955 a
956 -m1
956 -m1
957 -m2
957 -m2
958 +5
958 +5
959 diff --git a/a b/c
959 diff --git a/a b/c
960 copy from a
960 copy from a
961 copy to c
961 copy to c
962 --- a/a
962 --- a/a
963 +++ b/c
963 +++ b/c
964 @@ -1,3 +1,2 @@
964 @@ -1,3 +1,2 @@
965 a
965 a
966 -m1
966 -m1
967 -m2
967 -m2
968 +5
968 +5
969 diff --git a/x/y b/x/y
969 diff --git a/x/y b/x/y
970 deleted file mode 100644
970 deleted file mode 100644
971 --- a/x/y
971 --- a/x/y
972 +++ /dev/null
972 +++ /dev/null
973 @@ -1,1 +0,0 @@
973 @@ -1,1 +0,0 @@
974 -y1
974 -y1
975
975
976 - parent to branch: --rev . --rev 2
976 - parent to branch: --rev . --rev 2
977 M a
977 M a
978 A x/y
978 A x/y
979 R b
979 R b
980 R c
980 R c
981
981
982 diff --git a/a b/a
982 diff --git a/a b/a
983 --- a/a
983 --- a/a
984 +++ b/a
984 +++ b/a
985 @@ -1,2 +1,3 @@
985 @@ -1,2 +1,3 @@
986 a
986 a
987 -5
987 -5
988 +m1
988 +m1
989 +m2
989 +m2
990 diff --git a/b b/b
990 diff --git a/b b/b
991 deleted file mode 100644
991 deleted file mode 100644
992 --- a/b
992 --- a/b
993 +++ /dev/null
993 +++ /dev/null
994 @@ -1,2 +0,0 @@
994 @@ -1,2 +0,0 @@
995 -a
995 -a
996 -5
996 -5
997 diff --git a/c b/c
997 diff --git a/c b/c
998 deleted file mode 100644
998 deleted file mode 100644
999 --- a/c
999 --- a/c
1000 +++ /dev/null
1000 +++ /dev/null
1001 @@ -1,2 +0,0 @@
1001 @@ -1,2 +0,0 @@
1002 -a
1002 -a
1003 -5
1003 -5
1004 diff --git a/x/y b/x/y
1004 diff --git a/x/y b/x/y
1005 new file mode 100644
1005 new file mode 100644
1006 --- /dev/null
1006 --- /dev/null
1007 +++ b/x/y
1007 +++ b/x/y
1008 @@ -0,0 +1,1 @@
1008 @@ -0,0 +1,1 @@
1009 +y1
1009 +y1
1010
1010
1011
1011
1012 $ tb "add a a1" "hg mv a b" "hg mv b a" "circular rename"
1012 $ tb "add a a1" "hg mv a b" "hg mv b a" "circular rename"
1013 updating to branch default
1013 updating to branch default
1014 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1014 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1015 created new head
1015 created new head
1016 ** circular rename **
1016 ** circular rename **
1017 ** add a a1 / hg mv a b / hg mv b a
1017 ** add a a1 / hg mv a b / hg mv b a
1018 - working to parent:
1018 - working to parent:
1019 A a
1019 A a
1020 b
1020 b
1021 R b
1021 R b
1022
1022
1023 diff --git a/b b/a
1023 diff --git a/b b/a
1024 rename from b
1024 rename from b
1025 rename to a
1025 rename to a
1026
1026
1027 - working to root: --rev 0
1027 - working to root: --rev 0
1028 M a
1028 M a
1029
1029
1030 diff --git a/a b/a
1030 diff --git a/a b/a
1031 --- a/a
1031 --- a/a
1032 +++ b/a
1032 +++ b/a
1033 @@ -1,1 +1,3 @@
1033 @@ -1,1 +1,3 @@
1034 a
1034 a
1035 +6
1035 +6
1036 +a1
1036 +a1
1037
1037
1038 - working to branch: --rev 2
1038 - working to branch: --rev 2
1039 M a
1039 M a
1040 R x/y
1040 R x/y
1041
1041
1042 diff --git a/a b/a
1042 diff --git a/a b/a
1043 --- a/a
1043 --- a/a
1044 +++ b/a
1044 +++ b/a
1045 @@ -1,3 +1,3 @@
1045 @@ -1,3 +1,3 @@
1046 a
1046 a
1047 -m1
1047 -m1
1048 -m2
1048 -m2
1049 +6
1049 +6
1050 +a1
1050 +a1
1051 diff --git a/x/y b/x/y
1051 diff --git a/x/y b/x/y
1052 deleted file mode 100644
1052 deleted file mode 100644
1053 --- a/x/y
1053 --- a/x/y
1054 +++ /dev/null
1054 +++ /dev/null
1055 @@ -1,1 +0,0 @@
1055 @@ -1,1 +0,0 @@
1056 -y1
1056 -y1
1057
1057
1058 - root to parent: --rev 0 --rev .
1058 - root to parent: --rev 0 --rev .
1059 A b
1059 A b
1060 a
1060 a
1061 R a
1061 R a
1062
1062
1063 diff --git a/a b/b
1063 diff --git a/a b/b
1064 rename from a
1064 rename from a
1065 rename to b
1065 rename to b
1066 --- a/a
1066 --- a/a
1067 +++ b/b
1067 +++ b/b
1068 @@ -1,1 +1,3 @@
1068 @@ -1,1 +1,3 @@
1069 a
1069 a
1070 +6
1070 +6
1071 +a1
1071 +a1
1072
1072
1073 - parent to root: --rev . --rev 0
1073 - parent to root: --rev . --rev 0
1074 A a
1074 A a
1075 b
1075 b
1076 R b
1076 R b
1077
1077
1078 diff --git a/b b/a
1078 diff --git a/b b/a
1079 rename from b
1079 rename from b
1080 rename to a
1080 rename to a
1081 --- a/b
1081 --- a/b
1082 +++ b/a
1082 +++ b/a
1083 @@ -1,3 +1,1 @@
1083 @@ -1,3 +1,1 @@
1084 a
1084 a
1085 -6
1085 -6
1086 -a1
1086 -a1
1087
1087
1088 - branch to parent: --rev 2 --rev .
1088 - branch to parent: --rev 2 --rev .
1089 A b
1089 A b
1090 a
1090 a
1091 R a
1091 R a
1092 R x/y
1092 R x/y
1093
1093
1094 diff --git a/a b/b
1094 diff --git a/a b/b
1095 rename from a
1095 rename from a
1096 rename to b
1096 rename to b
1097 --- a/a
1097 --- a/a
1098 +++ b/b
1098 +++ b/b
1099 @@ -1,3 +1,3 @@
1099 @@ -1,3 +1,3 @@
1100 a
1100 a
1101 -m1
1101 -m1
1102 -m2
1102 -m2
1103 +6
1103 +6
1104 +a1
1104 +a1
1105 diff --git a/x/y b/x/y
1105 diff --git a/x/y b/x/y
1106 deleted file mode 100644
1106 deleted file mode 100644
1107 --- a/x/y
1107 --- a/x/y
1108 +++ /dev/null
1108 +++ /dev/null
1109 @@ -1,1 +0,0 @@
1109 @@ -1,1 +0,0 @@
1110 -y1
1110 -y1
1111
1111
1112 - parent to branch: --rev . --rev 2
1112 - parent to branch: --rev . --rev 2
1113 A a
1113 A a
1114 b
1114 b
1115 A x/y
1115 A x/y
1116 R b
1116 R b
1117
1117
1118 diff --git a/b b/a
1118 diff --git a/b b/a
1119 rename from b
1119 rename from b
1120 rename to a
1120 rename to a
1121 --- a/b
1121 --- a/b
1122 +++ b/a
1122 +++ b/a
1123 @@ -1,3 +1,3 @@
1123 @@ -1,3 +1,3 @@
1124 a
1124 a
1125 -6
1125 -6
1126 -a1
1126 -a1
1127 +m1
1127 +m1
1128 +m2
1128 +m2
1129 diff --git a/x/y b/x/y
1129 diff --git a/x/y b/x/y
1130 new file mode 100644
1130 new file mode 100644
1131 --- /dev/null
1131 --- /dev/null
1132 +++ b/x/y
1132 +++ b/x/y
1133 @@ -0,0 +1,1 @@
1133 @@ -0,0 +1,1 @@
1134 +y1
1134 +y1
1135
1135
1136
1136
1137 $ tb "hg mv x y" "add y/x x1" "add y/x x2" "directory move"
1137 $ tb "hg mv x y" "add y/x x1" "add y/x x2" "directory move"
1138 updating to branch default
1138 updating to branch default
1139 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1139 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1140 created new head
1140 created new head
1141 moving x/x to y/x
1141 moving x/x to y/x (glob)
1142 ** directory move **
1142 ** directory move **
1143 ** hg mv x y / add y/x x1 / add y/x x2
1143 ** hg mv x y / add y/x x1 / add y/x x2
1144 - working to parent:
1144 - working to parent:
1145 M y/x
1145 M y/x
1146
1146
1147 diff --git a/y/x b/y/x
1147 diff --git a/y/x b/y/x
1148 --- a/y/x
1148 --- a/y/x
1149 +++ b/y/x
1149 +++ b/y/x
1150 @@ -1,2 +1,3 @@
1150 @@ -1,2 +1,3 @@
1151 x
1151 x
1152 x1
1152 x1
1153 +x2
1153 +x2
1154
1154
1155 - working to root: --rev 0
1155 - working to root: --rev 0
1156 M a
1156 M a
1157 A y/x
1157 A y/x
1158 x/x
1158 x/x
1159 R x/x
1159 R x/x
1160
1160
1161 diff --git a/a b/a
1161 diff --git a/a b/a
1162 --- a/a
1162 --- a/a
1163 +++ b/a
1163 +++ b/a
1164 @@ -1,1 +1,2 @@
1164 @@ -1,1 +1,2 @@
1165 a
1165 a
1166 +7
1166 +7
1167 diff --git a/x/x b/y/x
1167 diff --git a/x/x b/y/x
1168 rename from x/x
1168 rename from x/x
1169 rename to y/x
1169 rename to y/x
1170 --- a/x/x
1170 --- a/x/x
1171 +++ b/y/x
1171 +++ b/y/x
1172 @@ -1,1 +1,3 @@
1172 @@ -1,1 +1,3 @@
1173 x
1173 x
1174 +x1
1174 +x1
1175 +x2
1175 +x2
1176
1176
1177 - working to branch: --rev 2
1177 - working to branch: --rev 2
1178 M a
1178 M a
1179 A y/x
1179 A y/x
1180 x/x
1180 x/x
1181 R x/x
1181 R x/x
1182 R x/y
1182 R x/y
1183
1183
1184 diff --git a/a b/a
1184 diff --git a/a b/a
1185 --- a/a
1185 --- a/a
1186 +++ b/a
1186 +++ b/a
1187 @@ -1,3 +1,2 @@
1187 @@ -1,3 +1,2 @@
1188 a
1188 a
1189 -m1
1189 -m1
1190 -m2
1190 -m2
1191 +7
1191 +7
1192 diff --git a/x/y b/x/y
1192 diff --git a/x/y b/x/y
1193 deleted file mode 100644
1193 deleted file mode 100644
1194 --- a/x/y
1194 --- a/x/y
1195 +++ /dev/null
1195 +++ /dev/null
1196 @@ -1,1 +0,0 @@
1196 @@ -1,1 +0,0 @@
1197 -y1
1197 -y1
1198 diff --git a/x/x b/y/x
1198 diff --git a/x/x b/y/x
1199 rename from x/x
1199 rename from x/x
1200 rename to y/x
1200 rename to y/x
1201 --- a/x/x
1201 --- a/x/x
1202 +++ b/y/x
1202 +++ b/y/x
1203 @@ -1,1 +1,3 @@
1203 @@ -1,1 +1,3 @@
1204 x
1204 x
1205 +x1
1205 +x1
1206 +x2
1206 +x2
1207
1207
1208 - root to parent: --rev 0 --rev .
1208 - root to parent: --rev 0 --rev .
1209 M a
1209 M a
1210 A y/x
1210 A y/x
1211 x/x
1211 x/x
1212 R x/x
1212 R x/x
1213
1213
1214 diff --git a/a b/a
1214 diff --git a/a b/a
1215 --- a/a
1215 --- a/a
1216 +++ b/a
1216 +++ b/a
1217 @@ -1,1 +1,2 @@
1217 @@ -1,1 +1,2 @@
1218 a
1218 a
1219 +7
1219 +7
1220 diff --git a/x/x b/y/x
1220 diff --git a/x/x b/y/x
1221 rename from x/x
1221 rename from x/x
1222 rename to y/x
1222 rename to y/x
1223 --- a/x/x
1223 --- a/x/x
1224 +++ b/y/x
1224 +++ b/y/x
1225 @@ -1,1 +1,2 @@
1225 @@ -1,1 +1,2 @@
1226 x
1226 x
1227 +x1
1227 +x1
1228
1228
1229 - parent to root: --rev . --rev 0
1229 - parent to root: --rev . --rev 0
1230 M a
1230 M a
1231 A x/x
1231 A x/x
1232 y/x
1232 y/x
1233 R y/x
1233 R y/x
1234
1234
1235 diff --git a/a b/a
1235 diff --git a/a b/a
1236 --- a/a
1236 --- a/a
1237 +++ b/a
1237 +++ b/a
1238 @@ -1,2 +1,1 @@
1238 @@ -1,2 +1,1 @@
1239 a
1239 a
1240 -7
1240 -7
1241 diff --git a/y/x b/x/x
1241 diff --git a/y/x b/x/x
1242 rename from y/x
1242 rename from y/x
1243 rename to x/x
1243 rename to x/x
1244 --- a/y/x
1244 --- a/y/x
1245 +++ b/x/x
1245 +++ b/x/x
1246 @@ -1,2 +1,1 @@
1246 @@ -1,2 +1,1 @@
1247 x
1247 x
1248 -x1
1248 -x1
1249
1249
1250 - branch to parent: --rev 2 --rev .
1250 - branch to parent: --rev 2 --rev .
1251 M a
1251 M a
1252 A y/x
1252 A y/x
1253 x/x
1253 x/x
1254 R x/x
1254 R x/x
1255 R x/y
1255 R x/y
1256
1256
1257 diff --git a/a b/a
1257 diff --git a/a b/a
1258 --- a/a
1258 --- a/a
1259 +++ b/a
1259 +++ b/a
1260 @@ -1,3 +1,2 @@
1260 @@ -1,3 +1,2 @@
1261 a
1261 a
1262 -m1
1262 -m1
1263 -m2
1263 -m2
1264 +7
1264 +7
1265 diff --git a/x/y b/x/y
1265 diff --git a/x/y b/x/y
1266 deleted file mode 100644
1266 deleted file mode 100644
1267 --- a/x/y
1267 --- a/x/y
1268 +++ /dev/null
1268 +++ /dev/null
1269 @@ -1,1 +0,0 @@
1269 @@ -1,1 +0,0 @@
1270 -y1
1270 -y1
1271 diff --git a/x/x b/y/x
1271 diff --git a/x/x b/y/x
1272 rename from x/x
1272 rename from x/x
1273 rename to y/x
1273 rename to y/x
1274 --- a/x/x
1274 --- a/x/x
1275 +++ b/y/x
1275 +++ b/y/x
1276 @@ -1,1 +1,2 @@
1276 @@ -1,1 +1,2 @@
1277 x
1277 x
1278 +x1
1278 +x1
1279
1279
1280 - parent to branch: --rev . --rev 2
1280 - parent to branch: --rev . --rev 2
1281 M a
1281 M a
1282 A x/x
1282 A x/x
1283 y/x
1283 y/x
1284 A x/y
1284 A x/y
1285 R y/x
1285 R y/x
1286
1286
1287 diff --git a/a b/a
1287 diff --git a/a b/a
1288 --- a/a
1288 --- a/a
1289 +++ b/a
1289 +++ b/a
1290 @@ -1,2 +1,3 @@
1290 @@ -1,2 +1,3 @@
1291 a
1291 a
1292 -7
1292 -7
1293 +m1
1293 +m1
1294 +m2
1294 +m2
1295 diff --git a/y/x b/x/x
1295 diff --git a/y/x b/x/x
1296 rename from y/x
1296 rename from y/x
1297 rename to x/x
1297 rename to x/x
1298 --- a/y/x
1298 --- a/y/x
1299 +++ b/x/x
1299 +++ b/x/x
1300 @@ -1,2 +1,1 @@
1300 @@ -1,2 +1,1 @@
1301 x
1301 x
1302 -x1
1302 -x1
1303 diff --git a/x/y b/x/y
1303 diff --git a/x/y b/x/y
1304 new file mode 100644
1304 new file mode 100644
1305 --- /dev/null
1305 --- /dev/null
1306 +++ b/x/y
1306 +++ b/x/y
1307 @@ -0,0 +1,1 @@
1307 @@ -0,0 +1,1 @@
1308 +y1
1308 +y1
1309
1309
1310
1310
1311
1311
1312 Cannot implement unrelated branch with tb
1312 Cannot implement unrelated branch with tb
1313 testing copies with unrelated branch
1313 testing copies with unrelated branch
1314
1314
1315 $ hg init unrelated
1315 $ hg init unrelated
1316 $ cd unrelated
1316 $ cd unrelated
1317 $ add a a
1317 $ add a a
1318 $ hg ci -Am adda
1318 $ hg ci -Am adda
1319 adding a
1319 adding a
1320 $ hg mv a b
1320 $ hg mv a b
1321 $ hg ci -m movea
1321 $ hg ci -m movea
1322 $ hg up -C null
1322 $ hg up -C null
1323 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1323 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1324 $ add a a
1324 $ add a a
1325 $ hg ci -Am addunrelateda
1325 $ hg ci -Am addunrelateda
1326 adding a
1326 adding a
1327 created new head
1327 created new head
1328
1328
1329 unrelated branch diff
1329 unrelated branch diff
1330
1330
1331 $ hg diff --git -r 2 -r 1
1331 $ hg diff --git -r 2 -r 1
1332 diff --git a/a b/a
1332 diff --git a/a b/a
1333 deleted file mode 100644
1333 deleted file mode 100644
1334 --- a/a
1334 --- a/a
1335 +++ /dev/null
1335 +++ /dev/null
1336 @@ -1,1 +0,0 @@
1336 @@ -1,1 +0,0 @@
1337 -a
1337 -a
1338 diff --git a/b b/b
1338 diff --git a/b b/b
1339 new file mode 100644
1339 new file mode 100644
1340 --- /dev/null
1340 --- /dev/null
1341 +++ b/b
1341 +++ b/b
1342 @@ -0,0 +1,1 @@
1342 @@ -0,0 +1,1 @@
1343 +a
1343 +a
1344 $ cd ..
1344 $ cd ..
@@ -1,40 +1,40 b''
1 $ hg init a
1 $ hg init a
2 $ cd a
2 $ cd a
3 $ hg init b
3 $ hg init b
4 $ echo x > b/x
4 $ echo x > b/x
5
5
6 Should print nothing:
6 Should print nothing:
7
7
8 $ hg add b
8 $ hg add b
9 $ hg st
9 $ hg st
10
10
11 Should fail:
11 Should fail:
12
12
13 $ hg st b/x
13 $ hg st b/x
14 abort: path 'b/x' is inside nested repo 'b'
14 abort: path 'b/x' is inside nested repo 'b' (glob)
15 [255]
15 [255]
16 $ hg add b/x
16 $ hg add b/x
17 abort: path 'b/x' is inside nested repo 'b'
17 abort: path 'b/x' is inside nested repo 'b' (glob)
18 [255]
18 [255]
19
19
20 Should fail:
20 Should fail:
21
21
22 $ hg add b b/x
22 $ hg add b b/x
23 abort: path 'b/x' is inside nested repo 'b'
23 abort: path 'b/x' is inside nested repo 'b' (glob)
24 [255]
24 [255]
25 $ hg st
25 $ hg st
26
26
27 Should arguably print nothing:
27 Should arguably print nothing:
28
28
29 $ hg st b
29 $ hg st b
30
30
31 $ echo a > a
31 $ echo a > a
32 $ hg ci -Ama a
32 $ hg ci -Ama a
33
33
34 Should fail:
34 Should fail:
35
35
36 $ hg mv a b
36 $ hg mv a b
37 abort: path 'b/a' is inside nested repo 'b'
37 abort: path 'b/a' is inside nested repo 'b' (glob)
38 [255]
38 [255]
39 $ hg st
39 $ hg st
40
40
@@ -1,126 +1,126 b''
1
1
2 $ cat <<EOF >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 > [extensions]
3 > [extensions]
4 > notify=
4 > notify=
5 >
5 >
6 > [hooks]
6 > [hooks]
7 > changegroup.notify = python:hgext.notify.hook
7 > changegroup.notify = python:hgext.notify.hook
8 >
8 >
9 > [notify]
9 > [notify]
10 > sources = push
10 > sources = push
11 > diffstat = False
11 > diffstat = False
12 > maxsubject = 10
12 > maxsubject = 10
13 >
13 >
14 > [usersubs]
14 > [usersubs]
15 > foo@bar = *
15 > foo@bar = *
16 >
16 >
17 > [reposubs]
17 > [reposubs]
18 > * = baz
18 > * = baz
19 > EOF
19 > EOF
20 $ hg init a
20 $ hg init a
21
21
22 clone
22 clone
23
23
24 $ hg --traceback clone a b
24 $ hg --traceback clone a b
25 updating to branch default
25 updating to branch default
26 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 $ echo a > b/a
27 $ echo a > b/a
28
28
29 commit
29 commit
30
30
31 $ hg --traceback --cwd b commit -Ama
31 $ hg --traceback --cwd b commit -Ama
32 adding a
32 adding a
33 $ echo a >> b/a
33 $ echo a >> b/a
34
34
35 commit
35 commit
36
36
37 $ hg --traceback --cwd b commit -Amb
37 $ hg --traceback --cwd b commit -Amb
38
38
39 push
39 push
40
40
41 $ hg --traceback --cwd b push ../a 2>&1 |
41 $ hg --traceback --cwd b push ../a 2>&1 |
42 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
42 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
43 pushing to ../a
43 pushing to ../a
44 searching for changes
44 searching for changes
45 adding changesets
45 adding changesets
46 adding manifests
46 adding manifests
47 adding file changes
47 adding file changes
48 added 2 changesets with 2 changes to 1 files
48 added 2 changesets with 2 changes to 1 files
49 Content-Type: text/plain; charset="us-ascii"
49 Content-Type: text/plain; charset="us-ascii"
50 MIME-Version: 1.0
50 MIME-Version: 1.0
51 Content-Transfer-Encoding: 7bit
51 Content-Transfer-Encoding: 7bit
52 Date: * (glob)
52 Date: * (glob)
53 Subject: * (glob)
53 Subject: * (glob)
54 From: test
54 From: test
55 X-Hg-Notification: changeset cb9a9f314b8b
55 X-Hg-Notification: changeset cb9a9f314b8b
56 Message-Id: <*> (glob)
56 Message-Id: <*> (glob)
57 To: baz, foo@bar
57 To: baz, foo@bar
58
58
59 changeset cb9a9f314b8b in $TESTTMP/a
59 changeset cb9a9f314b8b in $TESTTMP/a (glob)
60 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
60 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
61 summary: a
61 summary: a
62
62
63 changeset ba677d0156c1 in $TESTTMP/a
63 changeset ba677d0156c1 in $TESTTMP/a (glob)
64 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
64 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
65 summary: b
65 summary: b
66
66
67 diffs (6 lines):
67 diffs (6 lines):
68
68
69 diff -r 000000000000 -r ba677d0156c1 a
69 diff -r 000000000000 -r ba677d0156c1 a
70 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
70 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
71 +++ b/a Thu Jan 01 00:00:00 1970 +0000
71 +++ b/a Thu Jan 01 00:00:00 1970 +0000
72 @@ -0,0 +1,2 @@
72 @@ -0,0 +1,2 @@
73 +a
73 +a
74 +a
74 +a
75 $ hg --cwd a rollback
75 $ hg --cwd a rollback
76 repository tip rolled back to revision -1 (undo push)
76 repository tip rolled back to revision -1 (undo push)
77
77
78 unbundle with unrelated source
78 unbundle with unrelated source
79
79
80 $ hg --cwd b bundle ../test.hg ../a
80 $ hg --cwd b bundle ../test.hg ../a
81 searching for changes
81 searching for changes
82 2 changesets found
82 2 changesets found
83 $ hg --cwd a unbundle ../test.hg
83 $ hg --cwd a unbundle ../test.hg
84 adding changesets
84 adding changesets
85 adding manifests
85 adding manifests
86 adding file changes
86 adding file changes
87 added 2 changesets with 2 changes to 1 files
87 added 2 changesets with 2 changes to 1 files
88 (run 'hg update' to get a working copy)
88 (run 'hg update' to get a working copy)
89 $ hg --cwd a rollback
89 $ hg --cwd a rollback
90 repository tip rolled back to revision -1 (undo unbundle)
90 repository tip rolled back to revision -1 (undo unbundle)
91
91
92 unbundle with correct source
92 unbundle with correct source
93
93
94 $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
94 $ hg --config notify.sources=unbundle --cwd a unbundle ../test.hg 2>&1 |
95 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
95 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
96 adding changesets
96 adding changesets
97 adding manifests
97 adding manifests
98 adding file changes
98 adding file changes
99 added 2 changesets with 2 changes to 1 files
99 added 2 changesets with 2 changes to 1 files
100 Content-Type: text/plain; charset="us-ascii"
100 Content-Type: text/plain; charset="us-ascii"
101 MIME-Version: 1.0
101 MIME-Version: 1.0
102 Content-Transfer-Encoding: 7bit
102 Content-Transfer-Encoding: 7bit
103 Date: * (glob)
103 Date: * (glob)
104 Subject: * (glob)
104 Subject: * (glob)
105 From: test
105 From: test
106 X-Hg-Notification: changeset cb9a9f314b8b
106 X-Hg-Notification: changeset cb9a9f314b8b
107 Message-Id: <*> (glob)
107 Message-Id: <*> (glob)
108 To: baz, foo@bar
108 To: baz, foo@bar
109
109
110 changeset cb9a9f314b8b in $TESTTMP/a
110 changeset cb9a9f314b8b in $TESTTMP/a (glob)
111 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
111 details: $TESTTMP/a?cmd=changeset;node=cb9a9f314b8b
112 summary: a
112 summary: a
113
113
114 changeset ba677d0156c1 in $TESTTMP/a
114 changeset ba677d0156c1 in $TESTTMP/a (glob)
115 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
115 details: $TESTTMP/a?cmd=changeset;node=ba677d0156c1
116 summary: b
116 summary: b
117
117
118 diffs (6 lines):
118 diffs (6 lines):
119
119
120 diff -r 000000000000 -r ba677d0156c1 a
120 diff -r 000000000000 -r ba677d0156c1 a
121 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
121 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
122 +++ b/a Thu Jan 01 00:00:00 1970 +0000
122 +++ b/a Thu Jan 01 00:00:00 1970 +0000
123 @@ -0,0 +1,2 @@
123 @@ -0,0 +1,2 @@
124 +a
124 +a
125 +a
125 +a
126 (run 'hg update' to get a working copy)
126 (run 'hg update' to get a working copy)
@@ -1,397 +1,397 b''
1
1
2 $ cat <<EOF >> $HGRCPATH
2 $ cat <<EOF >> $HGRCPATH
3 > [extensions]
3 > [extensions]
4 > notify=
4 > notify=
5 >
5 >
6 > [hooks]
6 > [hooks]
7 > incoming.notify = python:hgext.notify.hook
7 > incoming.notify = python:hgext.notify.hook
8 >
8 >
9 > [notify]
9 > [notify]
10 > sources = pull
10 > sources = pull
11 > diffstat = False
11 > diffstat = False
12 >
12 >
13 > [usersubs]
13 > [usersubs]
14 > foo@bar = *
14 > foo@bar = *
15 >
15 >
16 > [reposubs]
16 > [reposubs]
17 > * = baz
17 > * = baz
18 > EOF
18 > EOF
19 $ hg help notify
19 $ hg help notify
20 notify extension - hooks for sending email push notifications
20 notify extension - hooks for sending email push notifications
21
21
22 This extension let you run hooks sending email notifications when changesets
22 This extension let you run hooks sending email notifications when changesets
23 are being pushed, from the sending or receiving side.
23 are being pushed, from the sending or receiving side.
24
24
25 First, enable the extension as explained in "hg help extensions", and register
25 First, enable the extension as explained in "hg help extensions", and register
26 the hook you want to run. "incoming" and "outgoing" hooks are run by the
26 the hook you want to run. "incoming" and "outgoing" hooks are run by the
27 changesets receiver while the "outgoing" one is for the sender:
27 changesets receiver while the "outgoing" one is for the sender:
28
28
29 [hooks]
29 [hooks]
30 # one email for each incoming changeset
30 # one email for each incoming changeset
31 incoming.notify = python:hgext.notify.hook
31 incoming.notify = python:hgext.notify.hook
32 # one email for all incoming changesets
32 # one email for all incoming changesets
33 changegroup.notify = python:hgext.notify.hook
33 changegroup.notify = python:hgext.notify.hook
34
34
35 # one email for all outgoing changesets
35 # one email for all outgoing changesets
36 outgoing.notify = python:hgext.notify.hook
36 outgoing.notify = python:hgext.notify.hook
37
37
38 Now the hooks are running, subscribers must be assigned to repositories. Use
38 Now the hooks are running, subscribers must be assigned to repositories. Use
39 the "[usersubs]" section to map repositories to a given email or the
39 the "[usersubs]" section to map repositories to a given email or the
40 "[reposubs]" section to map emails to a single repository:
40 "[reposubs]" section to map emails to a single repository:
41
41
42 [usersubs]
42 [usersubs]
43 # key is subscriber email, value is a comma-separated list of glob
43 # key is subscriber email, value is a comma-separated list of glob
44 # patterns
44 # patterns
45 user@host = pattern
45 user@host = pattern
46
46
47 [reposubs]
47 [reposubs]
48 # key is glob pattern, value is a comma-separated list of subscriber
48 # key is glob pattern, value is a comma-separated list of subscriber
49 # emails
49 # emails
50 pattern = user@host
50 pattern = user@host
51
51
52 Glob patterns are matched against absolute path to repository root. The
52 Glob patterns are matched against absolute path to repository root. The
53 subscriptions can be defined in their own file and referenced with:
53 subscriptions can be defined in their own file and referenced with:
54
54
55 [notify]
55 [notify]
56 config = /path/to/subscriptionsfile
56 config = /path/to/subscriptionsfile
57
57
58 Alternatively, they can be added to Mercurial configuration files by setting
58 Alternatively, they can be added to Mercurial configuration files by setting
59 the previous entry to an empty value.
59 the previous entry to an empty value.
60
60
61 At this point, notifications should be generated but will not be sent until
61 At this point, notifications should be generated but will not be sent until
62 you set the "notify.test" entry to "False".
62 you set the "notify.test" entry to "False".
63
63
64 Notifications content can be tweaked with the following configuration entries:
64 Notifications content can be tweaked with the following configuration entries:
65
65
66 notify.test
66 notify.test
67 If "True", print messages to stdout instead of sending them. Default: True.
67 If "True", print messages to stdout instead of sending them. Default: True.
68
68
69 notify.sources
69 notify.sources
70 Space separated list of change sources. Notifications are sent only if it
70 Space separated list of change sources. Notifications are sent only if it
71 includes the incoming or outgoing changes source. Incoming sources can be
71 includes the incoming or outgoing changes source. Incoming sources can be
72 "serve" for changes coming from http or ssh, "pull" for pulled changes,
72 "serve" for changes coming from http or ssh, "pull" for pulled changes,
73 "unbundle" for changes added by "hg unbundle" or "push" for changes being
73 "unbundle" for changes added by "hg unbundle" or "push" for changes being
74 pushed locally. Outgoing sources are the same except for "unbundle" which is
74 pushed locally. Outgoing sources are the same except for "unbundle" which is
75 replaced by "bundle". Default: serve.
75 replaced by "bundle". Default: serve.
76
76
77 notify.strip
77 notify.strip
78 Number of leading slashes to strip from url paths. By default, notifications
78 Number of leading slashes to strip from url paths. By default, notifications
79 references repositories with their absolute path. "notify.strip" let you
79 references repositories with their absolute path. "notify.strip" let you
80 turn them into relative paths. For example, "notify.strip=3" will change
80 turn them into relative paths. For example, "notify.strip=3" will change
81 "/long/path/repository" into "repository". Default: 0.
81 "/long/path/repository" into "repository". Default: 0.
82
82
83 notify.domain
83 notify.domain
84 If subscribers emails or the from email have no domain set, complete them
84 If subscribers emails or the from email have no domain set, complete them
85 with this value.
85 with this value.
86
86
87 notify.style
87 notify.style
88 Style file to use when formatting emails.
88 Style file to use when formatting emails.
89
89
90 notify.template
90 notify.template
91 Template to use when formatting emails.
91 Template to use when formatting emails.
92
92
93 notify.incoming
93 notify.incoming
94 Template to use when run as incoming hook, override "notify.template".
94 Template to use when run as incoming hook, override "notify.template".
95
95
96 notify.outgoing
96 notify.outgoing
97 Template to use when run as outgoing hook, override "notify.template".
97 Template to use when run as outgoing hook, override "notify.template".
98
98
99 notify.changegroup
99 notify.changegroup
100 Template to use when running as changegroup hook, override
100 Template to use when running as changegroup hook, override
101 "notify.template".
101 "notify.template".
102
102
103 notify.maxdiff
103 notify.maxdiff
104 Maximum number of diff lines to include in notification email. Set to 0 to
104 Maximum number of diff lines to include in notification email. Set to 0 to
105 disable the diff, -1 to include all of it. Default: 300.
105 disable the diff, -1 to include all of it. Default: 300.
106
106
107 notify.maxsubject
107 notify.maxsubject
108 Maximum number of characters in emails subject line. Default: 67.
108 Maximum number of characters in emails subject line. Default: 67.
109
109
110 notify.diffstat
110 notify.diffstat
111 Set to True to include a diffstat before diff content. Default: True.
111 Set to True to include a diffstat before diff content. Default: True.
112
112
113 notify.merge
113 notify.merge
114 If True, send notifications for merge changesets. Default: True.
114 If True, send notifications for merge changesets. Default: True.
115
115
116 If set, the following entries will also be used to customize the
116 If set, the following entries will also be used to customize the
117 notifications:
117 notifications:
118
118
119 email.from
119 email.from
120 Email "From" address to use if none can be found in generated email content.
120 Email "From" address to use if none can be found in generated email content.
121
121
122 web.baseurl
122 web.baseurl
123 Root repository browsing URL to combine with repository paths when making
123 Root repository browsing URL to combine with repository paths when making
124 references. See also "notify.strip".
124 references. See also "notify.strip".
125
125
126 no commands defined
126 no commands defined
127 $ hg init a
127 $ hg init a
128 $ echo a > a/a
128 $ echo a > a/a
129
129
130 commit
130 commit
131
131
132 $ hg --cwd a commit -Ama -d '0 0'
132 $ hg --cwd a commit -Ama -d '0 0'
133 adding a
133 adding a
134
134
135
135
136 clone
136 clone
137
137
138 $ hg --traceback clone a b
138 $ hg --traceback clone a b
139 updating to branch default
139 updating to branch default
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 $ echo a >> a/a
141 $ echo a >> a/a
142
142
143 commit
143 commit
144
144
145 $ hg --traceback --cwd a commit -Amb -d '1 0'
145 $ hg --traceback --cwd a commit -Amb -d '1 0'
146
146
147 on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
147 on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line
148
148
149 $ cat <<EOF >> $HGRCPATH
149 $ cat <<EOF >> $HGRCPATH
150 > [notify]
150 > [notify]
151 > maxsubject = 200
151 > maxsubject = 200
152 > EOF
152 > EOF
153
153
154 the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
154 the python call below wraps continuation lines, which appear on Mac OS X 10.5 because
155 of the very long subject line
155 of the very long subject line
156 pull (minimal config)
156 pull (minimal config)
157
157
158 $ hg --traceback --cwd b pull ../a | \
158 $ hg --traceback --cwd b pull ../a | \
159 > python -c 'import sys,re; print re.sub("\n[\t ]", " ", sys.stdin.read()),'
159 > python -c 'import sys,re; print re.sub("\n[\t ]", " ", sys.stdin.read()),'
160 pulling from ../a
160 pulling from ../a
161 searching for changes
161 searching for changes
162 adding changesets
162 adding changesets
163 adding manifests
163 adding manifests
164 adding file changes
164 adding file changes
165 added 1 changesets with 1 changes to 1 files
165 added 1 changesets with 1 changes to 1 files
166 Content-Type: text/plain; charset="us-ascii"
166 Content-Type: text/plain; charset="us-ascii"
167 MIME-Version: 1.0
167 MIME-Version: 1.0
168 Content-Transfer-Encoding: 7bit
168 Content-Transfer-Encoding: 7bit
169 Date: * (glob)
169 Date: * (glob)
170 Subject: changeset in $TESTTMP/b: b
170 Subject: changeset in $TESTTMP/b: b
171 From: test
171 From: test
172 X-Hg-Notification: changeset 0647d048b600
172 X-Hg-Notification: changeset 0647d048b600
173 Message-Id: <*> (glob)
173 Message-Id: <*> (glob)
174 To: baz, foo@bar
174 To: baz, foo@bar
175
175
176 changeset 0647d048b600 in $TESTTMP/b
176 changeset 0647d048b600 in $TESTTMP/b (glob)
177 details: $TESTTMP/b?cmd=changeset;node=0647d048b600
177 details: $TESTTMP/b?cmd=changeset;node=0647d048b600
178 description: b
178 description: b
179
179
180 diffs (6 lines):
180 diffs (6 lines):
181
181
182 diff -r cb9a9f314b8b -r 0647d048b600 a
182 diff -r cb9a9f314b8b -r 0647d048b600 a
183 --- a/a Thu Jan 01 00:00:00 1970 +0000
183 --- a/a Thu Jan 01 00:00:00 1970 +0000
184 +++ b/a Thu Jan 01 00:00:01 1970 +0000
184 +++ b/a Thu Jan 01 00:00:01 1970 +0000
185 @@ -1,1 +1,2 @@ a
185 @@ -1,1 +1,2 @@ a
186 +a
186 +a
187 (run 'hg update' to get a working copy)
187 (run 'hg update' to get a working copy)
188 $ cat <<EOF >> $HGRCPATH
188 $ cat <<EOF >> $HGRCPATH
189 > [notify]
189 > [notify]
190 > config = `pwd`/.notify.conf
190 > config = `pwd`/.notify.conf
191 > domain = test.com
191 > domain = test.com
192 > strip = 42
192 > strip = 42
193 > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
193 > template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
194 >
194 >
195 > [web]
195 > [web]
196 > baseurl = http://test/
196 > baseurl = http://test/
197 > EOF
197 > EOF
198
198
199 fail for config file is missing
199 fail for config file is missing
200
200
201 $ hg --cwd b rollback
201 $ hg --cwd b rollback
202 repository tip rolled back to revision 0 (undo pull)
202 repository tip rolled back to revision 0 (undo pull)
203 $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
203 $ hg --cwd b pull ../a 2>&1 | grep 'error.*\.notify\.conf' > /dev/null && echo pull failed
204 pull failed
204 pull failed
205 $ touch ".notify.conf"
205 $ touch ".notify.conf"
206
206
207 pull
207 pull
208
208
209 $ hg --cwd b rollback
209 $ hg --cwd b rollback
210 repository tip rolled back to revision 0 (undo pull)
210 repository tip rolled back to revision 0 (undo pull)
211 $ hg --traceback --cwd b pull ../a | \
211 $ hg --traceback --cwd b pull ../a | \
212 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
212 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
213 pulling from ../a
213 pulling from ../a
214 searching for changes
214 searching for changes
215 adding changesets
215 adding changesets
216 adding manifests
216 adding manifests
217 adding file changes
217 adding file changes
218 added 1 changesets with 1 changes to 1 files
218 added 1 changesets with 1 changes to 1 files
219 Content-Type: text/plain; charset="us-ascii"
219 Content-Type: text/plain; charset="us-ascii"
220 MIME-Version: 1.0
220 MIME-Version: 1.0
221 Content-Transfer-Encoding: 7bit
221 Content-Transfer-Encoding: 7bit
222 X-Test: foo
222 X-Test: foo
223 Date: * (glob)
223 Date: * (glob)
224 Subject: b
224 Subject: b
225 From: test@test.com
225 From: test@test.com
226 X-Hg-Notification: changeset 0647d048b600
226 X-Hg-Notification: changeset 0647d048b600
227 Message-Id: <*> (glob)
227 Message-Id: <*> (glob)
228 To: baz@test.com, foo@bar
228 To: baz@test.com, foo@bar
229
229
230 changeset 0647d048b600 in b
230 changeset 0647d048b600 in b
231 description: b
231 description: b
232 diffs (6 lines):
232 diffs (6 lines):
233
233
234 diff -r cb9a9f314b8b -r 0647d048b600 a
234 diff -r cb9a9f314b8b -r 0647d048b600 a
235 --- a/a Thu Jan 01 00:00:00 1970 +0000
235 --- a/a Thu Jan 01 00:00:00 1970 +0000
236 +++ b/a Thu Jan 01 00:00:01 1970 +0000
236 +++ b/a Thu Jan 01 00:00:01 1970 +0000
237 @@ -1,1 +1,2 @@
237 @@ -1,1 +1,2 @@
238 a
238 a
239 +a
239 +a
240 (run 'hg update' to get a working copy)
240 (run 'hg update' to get a working copy)
241
241
242 $ cat << EOF >> $HGRCPATH
242 $ cat << EOF >> $HGRCPATH
243 > [hooks]
243 > [hooks]
244 > incoming.notify = python:hgext.notify.hook
244 > incoming.notify = python:hgext.notify.hook
245 >
245 >
246 > [notify]
246 > [notify]
247 > sources = pull
247 > sources = pull
248 > diffstat = True
248 > diffstat = True
249 > EOF
249 > EOF
250
250
251 pull
251 pull
252
252
253 $ hg --cwd b rollback
253 $ hg --cwd b rollback
254 repository tip rolled back to revision 0 (undo pull)
254 repository tip rolled back to revision 0 (undo pull)
255 $ hg --traceback --cwd b pull ../a | \
255 $ hg --traceback --cwd b pull ../a | \
256 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
256 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
257 pulling from ../a
257 pulling from ../a
258 searching for changes
258 searching for changes
259 adding changesets
259 adding changesets
260 adding manifests
260 adding manifests
261 adding file changes
261 adding file changes
262 added 1 changesets with 1 changes to 1 files
262 added 1 changesets with 1 changes to 1 files
263 Content-Type: text/plain; charset="us-ascii"
263 Content-Type: text/plain; charset="us-ascii"
264 MIME-Version: 1.0
264 MIME-Version: 1.0
265 Content-Transfer-Encoding: 7bit
265 Content-Transfer-Encoding: 7bit
266 X-Test: foo
266 X-Test: foo
267 Date: * (glob)
267 Date: * (glob)
268 Subject: b
268 Subject: b
269 From: test@test.com
269 From: test@test.com
270 X-Hg-Notification: changeset 0647d048b600
270 X-Hg-Notification: changeset 0647d048b600
271 Message-Id: <*> (glob)
271 Message-Id: <*> (glob)
272 To: baz@test.com, foo@bar
272 To: baz@test.com, foo@bar
273
273
274 changeset 0647d048b600 in b
274 changeset 0647d048b600 in b
275 description: b
275 description: b
276 diffstat:
276 diffstat:
277
277
278 a | 1 +
278 a | 1 +
279 1 files changed, 1 insertions(+), 0 deletions(-)
279 1 files changed, 1 insertions(+), 0 deletions(-)
280
280
281 diffs (6 lines):
281 diffs (6 lines):
282
282
283 diff -r cb9a9f314b8b -r 0647d048b600 a
283 diff -r cb9a9f314b8b -r 0647d048b600 a
284 --- a/a Thu Jan 01 00:00:00 1970 +0000
284 --- a/a Thu Jan 01 00:00:00 1970 +0000
285 +++ b/a Thu Jan 01 00:00:01 1970 +0000
285 +++ b/a Thu Jan 01 00:00:01 1970 +0000
286 @@ -1,1 +1,2 @@
286 @@ -1,1 +1,2 @@
287 a
287 a
288 +a
288 +a
289 (run 'hg update' to get a working copy)
289 (run 'hg update' to get a working copy)
290
290
291 test merge
291 test merge
292
292
293 $ cd a
293 $ cd a
294 $ hg up -C 0
294 $ hg up -C 0
295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 $ echo a >> a
296 $ echo a >> a
297 $ hg ci -Am adda2 -d '2 0'
297 $ hg ci -Am adda2 -d '2 0'
298 created new head
298 created new head
299 $ hg merge
299 $ hg merge
300 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
300 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 (branch merge, don't forget to commit)
301 (branch merge, don't forget to commit)
302 $ hg ci -m merge -d '3 0'
302 $ hg ci -m merge -d '3 0'
303 $ cd ..
303 $ cd ..
304 $ hg --traceback --cwd b pull ../a | \
304 $ hg --traceback --cwd b pull ../a | \
305 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
305 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
306 pulling from ../a
306 pulling from ../a
307 searching for changes
307 searching for changes
308 adding changesets
308 adding changesets
309 adding manifests
309 adding manifests
310 adding file changes
310 adding file changes
311 added 2 changesets with 0 changes to 0 files
311 added 2 changesets with 0 changes to 0 files
312 Content-Type: text/plain; charset="us-ascii"
312 Content-Type: text/plain; charset="us-ascii"
313 MIME-Version: 1.0
313 MIME-Version: 1.0
314 Content-Transfer-Encoding: 7bit
314 Content-Transfer-Encoding: 7bit
315 X-Test: foo
315 X-Test: foo
316 Date: * (glob)
316 Date: * (glob)
317 Subject: adda2
317 Subject: adda2
318 From: test@test.com
318 From: test@test.com
319 X-Hg-Notification: changeset 0a184ce6067f
319 X-Hg-Notification: changeset 0a184ce6067f
320 Message-Id: <*> (glob)
320 Message-Id: <*> (glob)
321 To: baz@test.com, foo@bar
321 To: baz@test.com, foo@bar
322
322
323 changeset 0a184ce6067f in b
323 changeset 0a184ce6067f in b
324 description: adda2
324 description: adda2
325 diffstat:
325 diffstat:
326
326
327 a | 1 +
327 a | 1 +
328 1 files changed, 1 insertions(+), 0 deletions(-)
328 1 files changed, 1 insertions(+), 0 deletions(-)
329
329
330 diffs (6 lines):
330 diffs (6 lines):
331
331
332 diff -r cb9a9f314b8b -r 0a184ce6067f a
332 diff -r cb9a9f314b8b -r 0a184ce6067f a
333 --- a/a Thu Jan 01 00:00:00 1970 +0000
333 --- a/a Thu Jan 01 00:00:00 1970 +0000
334 +++ b/a Thu Jan 01 00:00:02 1970 +0000
334 +++ b/a Thu Jan 01 00:00:02 1970 +0000
335 @@ -1,1 +1,2 @@
335 @@ -1,1 +1,2 @@
336 a
336 a
337 +a
337 +a
338 Content-Type: text/plain; charset="us-ascii"
338 Content-Type: text/plain; charset="us-ascii"
339 MIME-Version: 1.0
339 MIME-Version: 1.0
340 Content-Transfer-Encoding: 7bit
340 Content-Transfer-Encoding: 7bit
341 X-Test: foo
341 X-Test: foo
342 Date: * (glob)
342 Date: * (glob)
343 Subject: merge
343 Subject: merge
344 From: test@test.com
344 From: test@test.com
345 X-Hg-Notification: changeset 6a0cf76b2701
345 X-Hg-Notification: changeset 6a0cf76b2701
346 Message-Id: <*> (glob)
346 Message-Id: <*> (glob)
347 To: baz@test.com, foo@bar
347 To: baz@test.com, foo@bar
348
348
349 changeset 6a0cf76b2701 in b
349 changeset 6a0cf76b2701 in b
350 description: merge
350 description: merge
351 (run 'hg update' to get a working copy)
351 (run 'hg update' to get a working copy)
352
352
353 truncate multi-byte subject
353 truncate multi-byte subject
354
354
355 $ cat <<EOF >> $HGRCPATH
355 $ cat <<EOF >> $HGRCPATH
356 > [notify]
356 > [notify]
357 > maxsubject = 4
357 > maxsubject = 4
358 > EOF
358 > EOF
359 $ echo a >> a/a
359 $ echo a >> a/a
360 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
360 $ hg --cwd a --encoding utf-8 commit -A -d '0 0' \
361 > -m `python -c 'print "\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4"'`
361 > -m `python -c 'print "\xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4"'`
362 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
362 $ hg --traceback --cwd b --encoding utf-8 pull ../a | \
363 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
363 > python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),'
364 pulling from ../a
364 pulling from ../a
365 searching for changes
365 searching for changes
366 adding changesets
366 adding changesets
367 adding manifests
367 adding manifests
368 adding file changes
368 adding file changes
369 added 1 changesets with 1 changes to 1 files
369 added 1 changesets with 1 changes to 1 files
370 Content-Type: text/plain; charset="us-ascii"
370 Content-Type: text/plain; charset="us-ascii"
371 MIME-Version: 1.0
371 MIME-Version: 1.0
372 Content-Transfer-Encoding: 8bit
372 Content-Transfer-Encoding: 8bit
373 X-Test: foo
373 X-Test: foo
374 Date: * (glob)
374 Date: * (glob)
375 Subject: \xc3\xa0... (esc)
375 Subject: \xc3\xa0... (esc)
376 From: test@test.com
376 From: test@test.com
377 X-Hg-Notification: changeset 7ea05ad269dc
377 X-Hg-Notification: changeset 7ea05ad269dc
378 Message-Id: <*> (glob)
378 Message-Id: <*> (glob)
379 To: baz@test.com, foo@bar
379 To: baz@test.com, foo@bar
380
380
381 changeset 7ea05ad269dc in b
381 changeset 7ea05ad269dc in b
382 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
382 description: \xc3\xa0\xc3\xa1\xc3\xa2\xc3\xa3\xc3\xa4 (esc)
383 diffstat:
383 diffstat:
384
384
385 a | 1 +
385 a | 1 +
386 1 files changed, 1 insertions(+), 0 deletions(-)
386 1 files changed, 1 insertions(+), 0 deletions(-)
387
387
388 diffs (7 lines):
388 diffs (7 lines):
389
389
390 diff -r 6a0cf76b2701 -r 7ea05ad269dc a
390 diff -r 6a0cf76b2701 -r 7ea05ad269dc a
391 --- a/a Thu Jan 01 00:00:03 1970 +0000
391 --- a/a Thu Jan 01 00:00:03 1970 +0000
392 +++ b/a Thu Jan 01 00:00:00 1970 +0000
392 +++ b/a Thu Jan 01 00:00:00 1970 +0000
393 @@ -1,2 +1,3 @@
393 @@ -1,2 +1,3 @@
394 a
394 a
395 a
395 a
396 +a
396 +a
397 (run 'hg update' to get a working copy)
397 (run 'hg update' to get a working copy)
@@ -1,58 +1,58 b''
1 $ hg init a
1 $ hg init a
2 $ hg clone a b
2 $ hg clone a b
3 updating to branch default
3 updating to branch default
4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
5 $ cd a
5 $ cd a
6 $ echo '[paths]' >> .hg/hgrc
6 $ echo '[paths]' >> .hg/hgrc
7 $ echo 'dupe = ../b' >> .hg/hgrc
7 $ echo 'dupe = ../b' >> .hg/hgrc
8 $ echo 'expand = $SOMETHING/bar' >> .hg/hgrc
8 $ echo 'expand = $SOMETHING/bar' >> .hg/hgrc
9 $ hg in dupe
9 $ hg in dupe
10 comparing with $TESTTMP/b
10 comparing with $TESTTMP/b (glob)
11 no changes found
11 no changes found
12 [1]
12 [1]
13 $ cd ..
13 $ cd ..
14 $ hg -R a in dupe
14 $ hg -R a in dupe
15 comparing with $TESTTMP/b
15 comparing with $TESTTMP/b (glob)
16 no changes found
16 no changes found
17 [1]
17 [1]
18 $ cd a
18 $ cd a
19 $ hg paths
19 $ hg paths
20 dupe = $TESTTMP/b
20 dupe = $TESTTMP/b (glob)
21 expand = $TESTTMP/a/$SOMETHING/bar
21 expand = $TESTTMP/a/$SOMETHING/bar (glob)
22 $ SOMETHING=foo hg paths
22 $ SOMETHING=foo hg paths
23 dupe = $TESTTMP/b
23 dupe = $TESTTMP/b (glob)
24 expand = $TESTTMP/a/foo/bar
24 expand = $TESTTMP/a/foo/bar (glob)
25 $ SOMETHING=/foo hg paths
25 $ SOMETHING=/foo hg paths
26 dupe = $TESTTMP/b
26 dupe = $TESTTMP/b (glob)
27 expand = /foo/bar
27 expand = /foo/bar
28 $ hg paths -q
28 $ hg paths -q
29 dupe
29 dupe
30 expand
30 expand
31 $ hg paths dupe
31 $ hg paths dupe
32 $TESTTMP/b
32 $TESTTMP/b (glob)
33 $ hg paths -q dupe
33 $ hg paths -q dupe
34 $ hg paths unknown
34 $ hg paths unknown
35 not found!
35 not found!
36 [1]
36 [1]
37 $ hg paths -q unknown
37 $ hg paths -q unknown
38 [1]
38 [1]
39 $ cd ..
39 $ cd ..
40
40
41 'file:' disables [paths] entries for clone destination
41 'file:' disables [paths] entries for clone destination
42
42
43 $ cat >> $HGRCPATH <<EOF
43 $ cat >> $HGRCPATH <<EOF
44 > [paths]
44 > [paths]
45 > gpath1 = http://hg.example.com
45 > gpath1 = http://hg.example.com
46 > EOF
46 > EOF
47
47
48 $ hg clone a gpath1
48 $ hg clone a gpath1
49 abort: cannot create new http repository
49 abort: cannot create new http repository
50 [255]
50 [255]
51
51
52 $ hg clone a file:gpath1
52 $ hg clone a file:gpath1
53 updating to branch default
53 updating to branch default
54 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 $ cd gpath1
55 $ cd gpath1
56 $ hg -q id
56 $ hg -q id
57 000000000000
57 000000000000
58
58
@@ -1,103 +1,103 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ echo foo > foo
3 $ echo foo > foo
4 $ hg ci -qAm 'add foo'
4 $ hg ci -qAm 'add foo'
5 $ echo >> foo
5 $ echo >> foo
6 $ hg ci -m 'change foo'
6 $ hg ci -m 'change foo'
7 $ hg up -qC 0
7 $ hg up -qC 0
8 $ echo bar > bar
8 $ echo bar > bar
9 $ hg ci -qAm 'add bar'
9 $ hg ci -qAm 'add bar'
10
10
11 $ hg log
11 $ hg log
12 changeset: 2:effea6de0384
12 changeset: 2:effea6de0384
13 tag: tip
13 tag: tip
14 parent: 0:bbd179dfa0a7
14 parent: 0:bbd179dfa0a7
15 user: test
15 user: test
16 date: Thu Jan 01 00:00:00 1970 +0000
16 date: Thu Jan 01 00:00:00 1970 +0000
17 summary: add bar
17 summary: add bar
18
18
19 changeset: 1:ed1b79f46b9a
19 changeset: 1:ed1b79f46b9a
20 user: test
20 user: test
21 date: Thu Jan 01 00:00:00 1970 +0000
21 date: Thu Jan 01 00:00:00 1970 +0000
22 summary: change foo
22 summary: change foo
23
23
24 changeset: 0:bbd179dfa0a7
24 changeset: 0:bbd179dfa0a7
25 user: test
25 user: test
26 date: Thu Jan 01 00:00:00 1970 +0000
26 date: Thu Jan 01 00:00:00 1970 +0000
27 summary: add foo
27 summary: add foo
28
28
29 $ cd ..
29 $ cd ..
30
30
31 don't show "(+1 heads)" message when pulling closed head
31 don't show "(+1 heads)" message when pulling closed head
32
32
33 $ hg clone -q repo repo2
33 $ hg clone -q repo repo2
34 $ hg clone -q repo2 repo3
34 $ hg clone -q repo2 repo3
35 $ cd repo2
35 $ cd repo2
36 $ hg up -q 0
36 $ hg up -q 0
37 $ echo hello >> foo
37 $ echo hello >> foo
38 $ hg ci -mx1
38 $ hg ci -mx1
39 created new head
39 created new head
40 $ hg ci -mx2 --close-branch
40 $ hg ci -mx2 --close-branch
41 $ cd ../repo3
41 $ cd ../repo3
42 $ hg heads -q --closed
42 $ hg heads -q --closed
43 2:effea6de0384
43 2:effea6de0384
44 1:ed1b79f46b9a
44 1:ed1b79f46b9a
45 $ hg pull
45 $ hg pull
46 pulling from $TESTTMP/repo2
46 pulling from $TESTTMP/repo2 (glob)
47 searching for changes
47 searching for changes
48 adding changesets
48 adding changesets
49 adding manifests
49 adding manifests
50 adding file changes
50 adding file changes
51 added 2 changesets with 1 changes to 1 files
51 added 2 changesets with 1 changes to 1 files
52 (run 'hg update' to get a working copy)
52 (run 'hg update' to get a working copy)
53 $ hg heads -q --closed
53 $ hg heads -q --closed
54 4:00cfe9073916
54 4:00cfe9073916
55 2:effea6de0384
55 2:effea6de0384
56 1:ed1b79f46b9a
56 1:ed1b79f46b9a
57
57
58 $ cd ..
58 $ cd ..
59
59
60 $ hg init copy
60 $ hg init copy
61 $ cd copy
61 $ cd copy
62
62
63 Pull a missing revision:
63 Pull a missing revision:
64
64
65 $ hg pull -qr missing ../repo
65 $ hg pull -qr missing ../repo
66 abort: unknown revision 'missing'!
66 abort: unknown revision 'missing'!
67 [255]
67 [255]
68
68
69 Pull multiple revisions with update:
69 Pull multiple revisions with update:
70
70
71 $ hg pull -qu -r 0 -r 1 ../repo
71 $ hg pull -qu -r 0 -r 1 ../repo
72 $ hg -q parents
72 $ hg -q parents
73 0:bbd179dfa0a7
73 0:bbd179dfa0a7
74 $ hg rollback
74 $ hg rollback
75 repository tip rolled back to revision -1 (undo pull)
75 repository tip rolled back to revision -1 (undo pull)
76 working directory now based on revision -1
76 working directory now based on revision -1
77
77
78 $ hg pull -qr 0 ../repo
78 $ hg pull -qr 0 ../repo
79 $ hg log
79 $ hg log
80 changeset: 0:bbd179dfa0a7
80 changeset: 0:bbd179dfa0a7
81 tag: tip
81 tag: tip
82 user: test
82 user: test
83 date: Thu Jan 01 00:00:00 1970 +0000
83 date: Thu Jan 01 00:00:00 1970 +0000
84 summary: add foo
84 summary: add foo
85
85
86 $ hg pull -qr 1 ../repo
86 $ hg pull -qr 1 ../repo
87 $ hg log
87 $ hg log
88 changeset: 1:ed1b79f46b9a
88 changeset: 1:ed1b79f46b9a
89 tag: tip
89 tag: tip
90 user: test
90 user: test
91 date: Thu Jan 01 00:00:00 1970 +0000
91 date: Thu Jan 01 00:00:00 1970 +0000
92 summary: change foo
92 summary: change foo
93
93
94 changeset: 0:bbd179dfa0a7
94 changeset: 0:bbd179dfa0a7
95 user: test
95 user: test
96 date: Thu Jan 01 00:00:00 1970 +0000
96 date: Thu Jan 01 00:00:00 1970 +0000
97 summary: add foo
97 summary: add foo
98
98
99
99
100 This used to abort: received changelog group is empty:
100 This used to abort: received changelog group is empty:
101
101
102 $ hg pull -qr 1 ../repo
102 $ hg pull -qr 1 ../repo
103
103
@@ -1,52 +1,52 b''
1 $ hg init test
1 $ hg init test
2 $ cd test
2 $ cd test
3
3
4 $ cat > .hg/hgrc <<EOF
4 $ cat > .hg/hgrc <<EOF
5 > [server]
5 > [server]
6 > validate=1
6 > validate=1
7 > EOF
7 > EOF
8
8
9 $ echo alpha > alpha
9 $ echo alpha > alpha
10 $ echo beta > beta
10 $ echo beta > beta
11 $ hg addr
11 $ hg addr
12 adding alpha
12 adding alpha
13 adding beta
13 adding beta
14 $ hg ci -m 1
14 $ hg ci -m 1
15
15
16 $ cd ..
16 $ cd ..
17 $ hg clone test test-clone
17 $ hg clone test test-clone
18 updating to branch default
18 updating to branch default
19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
20
20
21 $ cd test-clone
21 $ cd test-clone
22 $ cp .hg/store/data/beta.i tmp
22 $ cp .hg/store/data/beta.i tmp
23 $ echo blah >> beta
23 $ echo blah >> beta
24 $ hg ci -m '2 (corrupt)'
24 $ hg ci -m '2 (corrupt)'
25 $ mv tmp .hg/store/data/beta.i
25 $ mv tmp .hg/store/data/beta.i
26
26
27 Expected to fail:
27 Expected to fail:
28
28
29 $ hg verify
29 $ hg verify
30 checking changesets
30 checking changesets
31 checking manifests
31 checking manifests
32 crosschecking files in changesets and manifests
32 crosschecking files in changesets and manifests
33 checking files
33 checking files
34 beta@1: dddc47b3ba30 in manifests not found
34 beta@1: dddc47b3ba30 in manifests not found
35 2 files, 2 changesets, 2 total revisions
35 2 files, 2 changesets, 2 total revisions
36 1 integrity errors encountered!
36 1 integrity errors encountered!
37 (first damaged changeset appears to be 1)
37 (first damaged changeset appears to be 1)
38 [1]
38 [1]
39
39
40 Expected to fail:
40 Expected to fail:
41
41
42 $ hg push
42 $ hg push
43 pushing to $TESTTMP/test
43 pushing to $TESTTMP/test (glob)
44 searching for changes
44 searching for changes
45 adding changesets
45 adding changesets
46 adding manifests
46 adding manifests
47 adding file changes
47 adding file changes
48 transaction abort!
48 transaction abort!
49 rollback completed
49 rollback completed
50 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
50 abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
51 [255]
51 [255]
52
52
@@ -1,305 +1,305 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 >
5 >
6 > [alias]
6 > [alias]
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 > EOF
8 > EOF
9
9
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 adding changesets
14 adding changesets
15 adding manifests
15 adding manifests
16 adding file changes
16 adding file changes
17 added 8 changesets with 7 changes to 7 files (+2 heads)
17 added 8 changesets with 7 changes to 7 files (+2 heads)
18 (run 'hg heads' to see heads, 'hg merge' to merge)
18 (run 'hg heads' to see heads, 'hg merge' to merge)
19 $ hg up tip
19 $ hg up tip
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21
21
22 $ cd ..
22 $ cd ..
23
23
24
24
25 Rebasing D onto H detaching from C:
25 Rebasing D onto H detaching from C:
26
26
27 $ hg clone -q -u . a a1
27 $ hg clone -q -u . a a1
28 $ cd a1
28 $ cd a1
29
29
30 $ hg tglog
30 $ hg tglog
31 @ 7: 'H'
31 @ 7: 'H'
32 |
32 |
33 | o 6: 'G'
33 | o 6: 'G'
34 |/|
34 |/|
35 o | 5: 'F'
35 o | 5: 'F'
36 | |
36 | |
37 | o 4: 'E'
37 | o 4: 'E'
38 |/
38 |/
39 | o 3: 'D'
39 | o 3: 'D'
40 | |
40 | |
41 | o 2: 'C'
41 | o 2: 'C'
42 | |
42 | |
43 | o 1: 'B'
43 | o 1: 'B'
44 |/
44 |/
45 o 0: 'A'
45 o 0: 'A'
46
46
47 $ hg rebase --detach -s 3 -d 7
47 $ hg rebase --detach -s 3 -d 7
48 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
48 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
49
49
50 $ hg tglog
50 $ hg tglog
51 @ 7: 'D'
51 @ 7: 'D'
52 |
52 |
53 o 6: 'H'
53 o 6: 'H'
54 |
54 |
55 | o 5: 'G'
55 | o 5: 'G'
56 |/|
56 |/|
57 o | 4: 'F'
57 o | 4: 'F'
58 | |
58 | |
59 | o 3: 'E'
59 | o 3: 'E'
60 |/
60 |/
61 | o 2: 'C'
61 | o 2: 'C'
62 | |
62 | |
63 | o 1: 'B'
63 | o 1: 'B'
64 |/
64 |/
65 o 0: 'A'
65 o 0: 'A'
66
66
67 $ hg manifest
67 $ hg manifest
68 A
68 A
69 D
69 D
70 F
70 F
71 H
71 H
72
72
73 $ cd ..
73 $ cd ..
74
74
75
75
76 Rebasing C onto H detaching from B:
76 Rebasing C onto H detaching from B:
77
77
78 $ hg clone -q -u . a a2
78 $ hg clone -q -u . a a2
79 $ cd a2
79 $ cd a2
80
80
81 $ hg tglog
81 $ hg tglog
82 @ 7: 'H'
82 @ 7: 'H'
83 |
83 |
84 | o 6: 'G'
84 | o 6: 'G'
85 |/|
85 |/|
86 o | 5: 'F'
86 o | 5: 'F'
87 | |
87 | |
88 | o 4: 'E'
88 | o 4: 'E'
89 |/
89 |/
90 | o 3: 'D'
90 | o 3: 'D'
91 | |
91 | |
92 | o 2: 'C'
92 | o 2: 'C'
93 | |
93 | |
94 | o 1: 'B'
94 | o 1: 'B'
95 |/
95 |/
96 o 0: 'A'
96 o 0: 'A'
97
97
98 $ hg rebase --detach -s 2 -d 7
98 $ hg rebase --detach -s 2 -d 7
99 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
99 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
100
100
101 $ hg tglog
101 $ hg tglog
102 @ 7: 'D'
102 @ 7: 'D'
103 |
103 |
104 o 6: 'C'
104 o 6: 'C'
105 |
105 |
106 o 5: 'H'
106 o 5: 'H'
107 |
107 |
108 | o 4: 'G'
108 | o 4: 'G'
109 |/|
109 |/|
110 o | 3: 'F'
110 o | 3: 'F'
111 | |
111 | |
112 | o 2: 'E'
112 | o 2: 'E'
113 |/
113 |/
114 | o 1: 'B'
114 | o 1: 'B'
115 |/
115 |/
116 o 0: 'A'
116 o 0: 'A'
117
117
118 $ hg manifest
118 $ hg manifest
119 A
119 A
120 C
120 C
121 D
121 D
122 F
122 F
123 H
123 H
124
124
125 $ cd ..
125 $ cd ..
126
126
127
127
128 Rebasing B onto H using detach (same as not using it):
128 Rebasing B onto H using detach (same as not using it):
129
129
130 $ hg clone -q -u . a a3
130 $ hg clone -q -u . a a3
131 $ cd a3
131 $ cd a3
132
132
133 $ hg tglog
133 $ hg tglog
134 @ 7: 'H'
134 @ 7: 'H'
135 |
135 |
136 | o 6: 'G'
136 | o 6: 'G'
137 |/|
137 |/|
138 o | 5: 'F'
138 o | 5: 'F'
139 | |
139 | |
140 | o 4: 'E'
140 | o 4: 'E'
141 |/
141 |/
142 | o 3: 'D'
142 | o 3: 'D'
143 | |
143 | |
144 | o 2: 'C'
144 | o 2: 'C'
145 | |
145 | |
146 | o 1: 'B'
146 | o 1: 'B'
147 |/
147 |/
148 o 0: 'A'
148 o 0: 'A'
149
149
150 $ hg rebase --detach -s 1 -d 7
150 $ hg rebase --detach -s 1 -d 7
151 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
151 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
152
152
153 $ hg tglog
153 $ hg tglog
154 @ 7: 'D'
154 @ 7: 'D'
155 |
155 |
156 o 6: 'C'
156 o 6: 'C'
157 |
157 |
158 o 5: 'B'
158 o 5: 'B'
159 |
159 |
160 o 4: 'H'
160 o 4: 'H'
161 |
161 |
162 | o 3: 'G'
162 | o 3: 'G'
163 |/|
163 |/|
164 o | 2: 'F'
164 o | 2: 'F'
165 | |
165 | |
166 | o 1: 'E'
166 | o 1: 'E'
167 |/
167 |/
168 o 0: 'A'
168 o 0: 'A'
169
169
170 $ hg manifest
170 $ hg manifest
171 A
171 A
172 B
172 B
173 C
173 C
174 D
174 D
175 F
175 F
176 H
176 H
177
177
178 $ cd ..
178 $ cd ..
179
179
180
180
181 Rebasing C onto H detaching from B and collapsing:
181 Rebasing C onto H detaching from B and collapsing:
182
182
183 $ hg clone -q -u . a a4
183 $ hg clone -q -u . a a4
184 $ cd a4
184 $ cd a4
185
185
186 $ hg tglog
186 $ hg tglog
187 @ 7: 'H'
187 @ 7: 'H'
188 |
188 |
189 | o 6: 'G'
189 | o 6: 'G'
190 |/|
190 |/|
191 o | 5: 'F'
191 o | 5: 'F'
192 | |
192 | |
193 | o 4: 'E'
193 | o 4: 'E'
194 |/
194 |/
195 | o 3: 'D'
195 | o 3: 'D'
196 | |
196 | |
197 | o 2: 'C'
197 | o 2: 'C'
198 | |
198 | |
199 | o 1: 'B'
199 | o 1: 'B'
200 |/
200 |/
201 o 0: 'A'
201 o 0: 'A'
202
202
203 $ hg rebase --detach --collapse -s 2 -d 7
203 $ hg rebase --detach --collapse -s 2 -d 7
204 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
204 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
205
205
206 $ hg tglog
206 $ hg tglog
207 @ 6: 'Collapsed revision
207 @ 6: 'Collapsed revision
208 | * C
208 | * C
209 | * D'
209 | * D'
210 o 5: 'H'
210 o 5: 'H'
211 |
211 |
212 | o 4: 'G'
212 | o 4: 'G'
213 |/|
213 |/|
214 o | 3: 'F'
214 o | 3: 'F'
215 | |
215 | |
216 | o 2: 'E'
216 | o 2: 'E'
217 |/
217 |/
218 | o 1: 'B'
218 | o 1: 'B'
219 |/
219 |/
220 o 0: 'A'
220 o 0: 'A'
221
221
222 $ hg manifest
222 $ hg manifest
223 A
223 A
224 C
224 C
225 D
225 D
226 F
226 F
227 H
227 H
228
228
229 $ cd ..
229 $ cd ..
230
230
231 Rebasing across null as ancestor
231 Rebasing across null as ancestor
232 $ hg clone -q -U a a5
232 $ hg clone -q -U a a5
233
233
234 $ cd a5
234 $ cd a5
235
235
236 $ echo x > x
236 $ echo x > x
237
237
238 $ hg add x
238 $ hg add x
239
239
240 $ hg ci -m "extra branch"
240 $ hg ci -m "extra branch"
241 created new head
241 created new head
242
242
243 $ hg tglog
243 $ hg tglog
244 @ 8: 'extra branch'
244 @ 8: 'extra branch'
245
245
246 o 7: 'H'
246 o 7: 'H'
247 |
247 |
248 | o 6: 'G'
248 | o 6: 'G'
249 |/|
249 |/|
250 o | 5: 'F'
250 o | 5: 'F'
251 | |
251 | |
252 | o 4: 'E'
252 | o 4: 'E'
253 |/
253 |/
254 | o 3: 'D'
254 | o 3: 'D'
255 | |
255 | |
256 | o 2: 'C'
256 | o 2: 'C'
257 | |
257 | |
258 | o 1: 'B'
258 | o 1: 'B'
259 |/
259 |/
260 o 0: 'A'
260 o 0: 'A'
261
261
262 $ hg rebase --detach -s 1 -d tip
262 $ hg rebase --detach -s 1 -d tip
263 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
263 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
264
264
265 $ hg tglog
265 $ hg tglog
266 @ 8: 'D'
266 @ 8: 'D'
267 |
267 |
268 o 7: 'C'
268 o 7: 'C'
269 |
269 |
270 o 6: 'B'
270 o 6: 'B'
271 |
271 |
272 o 5: 'extra branch'
272 o 5: 'extra branch'
273
273
274 o 4: 'H'
274 o 4: 'H'
275 |
275 |
276 | o 3: 'G'
276 | o 3: 'G'
277 |/|
277 |/|
278 o | 2: 'F'
278 o | 2: 'F'
279 | |
279 | |
280 | o 1: 'E'
280 | o 1: 'E'
281 |/
281 |/
282 o 0: 'A'
282 o 0: 'A'
283
283
284
284
285 $ hg rebase -d 5 -s 7
285 $ hg rebase -d 5 -s 7
286 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg
286 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg (glob)
287 $ hg tglog
287 $ hg tglog
288 @ 8: 'D'
288 @ 8: 'D'
289 |
289 |
290 o 7: 'C'
290 o 7: 'C'
291 |
291 |
292 | o 6: 'B'
292 | o 6: 'B'
293 |/
293 |/
294 o 5: 'extra branch'
294 o 5: 'extra branch'
295
295
296 o 4: 'H'
296 o 4: 'H'
297 |
297 |
298 | o 3: 'G'
298 | o 3: 'G'
299 |/|
299 |/|
300 o | 2: 'F'
300 o | 2: 'F'
301 | |
301 | |
302 | o 1: 'E'
302 | o 1: 'E'
303 |/
303 |/
304 o 0: 'A'
304 o 0: 'A'
305
305
@@ -1,113 +1,113 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 >
5 >
6 > [alias]
6 > [alias]
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 > EOF
8 > EOF
9
9
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13
14 $ echo C1 > C1
14 $ echo C1 > C1
15 $ hg ci -Am C1
15 $ hg ci -Am C1
16 adding C1
16 adding C1
17
17
18 $ echo C2 > C2
18 $ echo C2 > C2
19 $ hg ci -Am C2
19 $ hg ci -Am C2
20 adding C2
20 adding C2
21
21
22 $ cd ..
22 $ cd ..
23
23
24 $ hg clone a b
24 $ hg clone a b
25 updating to branch default
25 updating to branch default
26 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
26 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
27
27
28 $ hg clone a c
28 $ hg clone a c
29 updating to branch default
29 updating to branch default
30 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
31
31
32 $ cd b
32 $ cd b
33
33
34 $ echo L1 > L1
34 $ echo L1 > L1
35 $ hg ci -Am L1
35 $ hg ci -Am L1
36 adding L1
36 adding L1
37
37
38
38
39 $ cd ../a
39 $ cd ../a
40
40
41 $ echo R1 > R1
41 $ echo R1 > R1
42 $ hg ci -Am R1
42 $ hg ci -Am R1
43 adding R1
43 adding R1
44
44
45
45
46 $ cd ../b
46 $ cd ../b
47
47
48 Now b has one revision to be pulled from a:
48 Now b has one revision to be pulled from a:
49
49
50 $ hg pull --rebase
50 $ hg pull --rebase
51 pulling from $TESTTMP/a
51 pulling from $TESTTMP/a (glob)
52 searching for changes
52 searching for changes
53 adding changesets
53 adding changesets
54 adding manifests
54 adding manifests
55 adding file changes
55 adding file changes
56 added 1 changesets with 1 changes to 1 files (+1 heads)
56 added 1 changesets with 1 changes to 1 files (+1 heads)
57 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
57 saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob)
58
58
59 $ hg tglog
59 $ hg tglog
60 @ 3: 'L1'
60 @ 3: 'L1'
61 |
61 |
62 o 2: 'R1'
62 o 2: 'R1'
63 |
63 |
64 o 1: 'C2'
64 o 1: 'C2'
65 |
65 |
66 o 0: 'C1'
66 o 0: 'C1'
67
67
68 Re-run:
68 Re-run:
69
69
70 $ hg pull --rebase
70 $ hg pull --rebase
71 pulling from $TESTTMP/a
71 pulling from $TESTTMP/a (glob)
72 searching for changes
72 searching for changes
73 no changes found
73 no changes found
74
74
75
75
76 Invoke pull --rebase and nothing to rebase:
76 Invoke pull --rebase and nothing to rebase:
77
77
78 $ cd ../c
78 $ cd ../c
79
79
80 $ hg pull --rebase
80 $ hg pull --rebase
81 pulling from $TESTTMP/a
81 pulling from $TESTTMP/a (glob)
82 searching for changes
82 searching for changes
83 adding changesets
83 adding changesets
84 adding manifests
84 adding manifests
85 adding file changes
85 adding file changes
86 added 1 changesets with 1 changes to 1 files
86 added 1 changesets with 1 changes to 1 files
87 nothing to rebase
87 nothing to rebase
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
89
89
90 $ hg tglog -l 1
90 $ hg tglog -l 1
91 @ 2: 'R1'
91 @ 2: 'R1'
92 |
92 |
93
93
94 pull --rebase --update should ignore --update:
94 pull --rebase --update should ignore --update:
95
95
96 $ hg pull --rebase --update
96 $ hg pull --rebase --update
97 pulling from $TESTTMP/a
97 pulling from $TESTTMP/a (glob)
98 searching for changes
98 searching for changes
99 no changes found
99 no changes found
100
100
101 pull --rebase doesn't update if nothing has been pulled:
101 pull --rebase doesn't update if nothing has been pulled:
102
102
103 $ hg up -q 1
103 $ hg up -q 1
104
104
105 $ hg pull --rebase
105 $ hg pull --rebase
106 pulling from $TESTTMP/a
106 pulling from $TESTTMP/a (glob)
107 searching for changes
107 searching for changes
108 no changes found
108 no changes found
109
109
110 $ hg tglog -l 1
110 $ hg tglog -l 1
111 o 2: 'R1'
111 o 2: 'R1'
112 |
112 |
113
113
@@ -1,508 +1,508 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 >
5 >
6 > [alias]
6 > [alias]
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
7 > tglog = log -G --template "{rev}: '{desc}' {branches}\n"
8 > EOF
8 > EOF
9
9
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
13 $ hg unbundle $TESTDIR/bundles/rebase.hg
14 adding changesets
14 adding changesets
15 adding manifests
15 adding manifests
16 adding file changes
16 adding file changes
17 added 8 changesets with 7 changes to 7 files (+2 heads)
17 added 8 changesets with 7 changes to 7 files (+2 heads)
18 (run 'hg heads' to see heads, 'hg merge' to merge)
18 (run 'hg heads' to see heads, 'hg merge' to merge)
19 $ hg up tip
19 $ hg up tip
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
20 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 $ cd ..
21 $ cd ..
22
22
23
23
24 Rebasing
24 Rebasing
25 D onto H - simple rebase:
25 D onto H - simple rebase:
26
26
27 $ hg clone -q -u . a a1
27 $ hg clone -q -u . a a1
28 $ cd a1
28 $ cd a1
29
29
30 $ hg tglog
30 $ hg tglog
31 @ 7: 'H'
31 @ 7: 'H'
32 |
32 |
33 | o 6: 'G'
33 | o 6: 'G'
34 |/|
34 |/|
35 o | 5: 'F'
35 o | 5: 'F'
36 | |
36 | |
37 | o 4: 'E'
37 | o 4: 'E'
38 |/
38 |/
39 | o 3: 'D'
39 | o 3: 'D'
40 | |
40 | |
41 | o 2: 'C'
41 | o 2: 'C'
42 | |
42 | |
43 | o 1: 'B'
43 | o 1: 'B'
44 |/
44 |/
45 o 0: 'A'
45 o 0: 'A'
46
46
47
47
48 $ hg rebase -s 3 -d 7
48 $ hg rebase -s 3 -d 7
49 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
49 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
50
50
51 $ hg tglog
51 $ hg tglog
52 @ 7: 'D'
52 @ 7: 'D'
53 |\
53 |\
54 | o 6: 'H'
54 | o 6: 'H'
55 | |
55 | |
56 | | o 5: 'G'
56 | | o 5: 'G'
57 | |/|
57 | |/|
58 | o | 4: 'F'
58 | o | 4: 'F'
59 | | |
59 | | |
60 | | o 3: 'E'
60 | | o 3: 'E'
61 | |/
61 | |/
62 o | 2: 'C'
62 o | 2: 'C'
63 | |
63 | |
64 o | 1: 'B'
64 o | 1: 'B'
65 |/
65 |/
66 o 0: 'A'
66 o 0: 'A'
67
67
68 $ cd ..
68 $ cd ..
69
69
70
70
71 D onto F - intermediate point:
71 D onto F - intermediate point:
72
72
73 $ hg clone -q -u . a a2
73 $ hg clone -q -u . a a2
74 $ cd a2
74 $ cd a2
75
75
76 $ hg rebase -s 3 -d 5
76 $ hg rebase -s 3 -d 5
77 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
77 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
78
78
79 $ hg tglog
79 $ hg tglog
80 @ 7: 'D'
80 @ 7: 'D'
81 |\
81 |\
82 | | o 6: 'H'
82 | | o 6: 'H'
83 | |/
83 | |/
84 | | o 5: 'G'
84 | | o 5: 'G'
85 | |/|
85 | |/|
86 | o | 4: 'F'
86 | o | 4: 'F'
87 | | |
87 | | |
88 | | o 3: 'E'
88 | | o 3: 'E'
89 | |/
89 | |/
90 o | 2: 'C'
90 o | 2: 'C'
91 | |
91 | |
92 o | 1: 'B'
92 o | 1: 'B'
93 |/
93 |/
94 o 0: 'A'
94 o 0: 'A'
95
95
96 $ cd ..
96 $ cd ..
97
97
98
98
99 E onto H - skip of G:
99 E onto H - skip of G:
100
100
101 $ hg clone -q -u . a a3
101 $ hg clone -q -u . a a3
102 $ cd a3
102 $ cd a3
103
103
104 $ hg rebase -s 4 -d 7
104 $ hg rebase -s 4 -d 7
105 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
105 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
106
106
107 $ hg tglog
107 $ hg tglog
108 @ 6: 'E'
108 @ 6: 'E'
109 |
109 |
110 o 5: 'H'
110 o 5: 'H'
111 |
111 |
112 o 4: 'F'
112 o 4: 'F'
113 |
113 |
114 | o 3: 'D'
114 | o 3: 'D'
115 | |
115 | |
116 | o 2: 'C'
116 | o 2: 'C'
117 | |
117 | |
118 | o 1: 'B'
118 | o 1: 'B'
119 |/
119 |/
120 o 0: 'A'
120 o 0: 'A'
121
121
122 $ cd ..
122 $ cd ..
123
123
124
124
125 F onto E - rebase of a branching point (skip G):
125 F onto E - rebase of a branching point (skip G):
126
126
127 $ hg clone -q -u . a a4
127 $ hg clone -q -u . a a4
128 $ cd a4
128 $ cd a4
129
129
130 $ hg rebase -s 5 -d 4
130 $ hg rebase -s 5 -d 4
131 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
131 saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
132
132
133 $ hg tglog
133 $ hg tglog
134 @ 6: 'H'
134 @ 6: 'H'
135 |
135 |
136 o 5: 'F'
136 o 5: 'F'
137 |
137 |
138 o 4: 'E'
138 o 4: 'E'
139 |
139 |
140 | o 3: 'D'
140 | o 3: 'D'
141 | |
141 | |
142 | o 2: 'C'
142 | o 2: 'C'
143 | |
143 | |
144 | o 1: 'B'
144 | o 1: 'B'
145 |/
145 |/
146 o 0: 'A'
146 o 0: 'A'
147
147
148 $ cd ..
148 $ cd ..
149
149
150
150
151 G onto H - merged revision having a parent in ancestors of target:
151 G onto H - merged revision having a parent in ancestors of target:
152
152
153 $ hg clone -q -u . a a5
153 $ hg clone -q -u . a a5
154 $ cd a5
154 $ cd a5
155
155
156 $ hg rebase -s 6 -d 7
156 $ hg rebase -s 6 -d 7
157 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
157 saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
158
158
159 $ hg tglog
159 $ hg tglog
160 @ 7: 'G'
160 @ 7: 'G'
161 |\
161 |\
162 | o 6: 'H'
162 | o 6: 'H'
163 | |
163 | |
164 | o 5: 'F'
164 | o 5: 'F'
165 | |
165 | |
166 o | 4: 'E'
166 o | 4: 'E'
167 |/
167 |/
168 | o 3: 'D'
168 | o 3: 'D'
169 | |
169 | |
170 | o 2: 'C'
170 | o 2: 'C'
171 | |
171 | |
172 | o 1: 'B'
172 | o 1: 'B'
173 |/
173 |/
174 o 0: 'A'
174 o 0: 'A'
175
175
176 $ cd ..
176 $ cd ..
177
177
178
178
179 F onto B - G maintains E as parent:
179 F onto B - G maintains E as parent:
180
180
181 $ hg clone -q -u . a a6
181 $ hg clone -q -u . a a6
182 $ cd a6
182 $ cd a6
183
183
184 $ hg rebase -s 5 -d 1
184 $ hg rebase -s 5 -d 1
185 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
185 saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
186
186
187 $ hg tglog
187 $ hg tglog
188 @ 7: 'H'
188 @ 7: 'H'
189 |
189 |
190 | o 6: 'G'
190 | o 6: 'G'
191 |/|
191 |/|
192 o | 5: 'F'
192 o | 5: 'F'
193 | |
193 | |
194 | o 4: 'E'
194 | o 4: 'E'
195 | |
195 | |
196 | | o 3: 'D'
196 | | o 3: 'D'
197 | | |
197 | | |
198 +---o 2: 'C'
198 +---o 2: 'C'
199 | |
199 | |
200 o | 1: 'B'
200 o | 1: 'B'
201 |/
201 |/
202 o 0: 'A'
202 o 0: 'A'
203
203
204 $ cd ..
204 $ cd ..
205
205
206
206
207 These will fail (using --source):
207 These will fail (using --source):
208
208
209 G onto F - rebase onto an ancestor:
209 G onto F - rebase onto an ancestor:
210
210
211 $ hg clone -q -u . a a7
211 $ hg clone -q -u . a a7
212 $ cd a7
212 $ cd a7
213
213
214 $ hg rebase -s 6 -d 5
214 $ hg rebase -s 6 -d 5
215 nothing to rebase
215 nothing to rebase
216 [1]
216 [1]
217
217
218 F onto G - rebase onto a descendant:
218 F onto G - rebase onto a descendant:
219
219
220 $ hg rebase -s 5 -d 6
220 $ hg rebase -s 5 -d 6
221 abort: source is ancestor of destination
221 abort: source is ancestor of destination
222 [255]
222 [255]
223
223
224 G onto B - merge revision with both parents not in ancestors of target:
224 G onto B - merge revision with both parents not in ancestors of target:
225
225
226 $ hg rebase -s 6 -d 1
226 $ hg rebase -s 6 -d 1
227 abort: cannot use revision 6 as base, result would have 3 parents
227 abort: cannot use revision 6 as base, result would have 3 parents
228 [255]
228 [255]
229
229
230
230
231 These will abort gracefully (using --base):
231 These will abort gracefully (using --base):
232
232
233 G onto G - rebase onto same changeset:
233 G onto G - rebase onto same changeset:
234
234
235 $ hg rebase -b 6 -d 6
235 $ hg rebase -b 6 -d 6
236 nothing to rebase
236 nothing to rebase
237 [1]
237 [1]
238
238
239 G onto F - rebase onto an ancestor:
239 G onto F - rebase onto an ancestor:
240
240
241 $ hg rebase -b 6 -d 5
241 $ hg rebase -b 6 -d 5
242 nothing to rebase
242 nothing to rebase
243 [1]
243 [1]
244
244
245 F onto G - rebase onto a descendant:
245 F onto G - rebase onto a descendant:
246
246
247 $ hg rebase -b 5 -d 6
247 $ hg rebase -b 5 -d 6
248 nothing to rebase
248 nothing to rebase
249 [1]
249 [1]
250
250
251 C onto A - rebase onto an ancestor:
251 C onto A - rebase onto an ancestor:
252
252
253 $ hg rebase -d 0 -s 2
253 $ hg rebase -d 0 -s 2
254 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg
254 saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
255 $ hg tglog
255 $ hg tglog
256 @ 7: 'D'
256 @ 7: 'D'
257 |
257 |
258 o 6: 'C'
258 o 6: 'C'
259 |
259 |
260 | o 5: 'H'
260 | o 5: 'H'
261 | |
261 | |
262 | | o 4: 'G'
262 | | o 4: 'G'
263 | |/|
263 | |/|
264 | o | 3: 'F'
264 | o | 3: 'F'
265 |/ /
265 |/ /
266 | o 2: 'E'
266 | o 2: 'E'
267 |/
267 |/
268 | o 1: 'B'
268 | o 1: 'B'
269 |/
269 |/
270 o 0: 'A'
270 o 0: 'A'
271
271
272 $ cd ..
272 $ cd ..
273
273
274 Test for revset
274 Test for revset
275
275
276 We need a bit different graph
276 We need a bit different graph
277 All destination are B
277 All destination are B
278
278
279 $ hg init ah
279 $ hg init ah
280 $ cd ah
280 $ cd ah
281 $ hg unbundle $TESTDIR/bundles/rebase-revset.hg
281 $ hg unbundle $TESTDIR/bundles/rebase-revset.hg
282 adding changesets
282 adding changesets
283 adding manifests
283 adding manifests
284 adding file changes
284 adding file changes
285 added 9 changesets with 9 changes to 9 files (+2 heads)
285 added 9 changesets with 9 changes to 9 files (+2 heads)
286 (run 'hg heads' to see heads, 'hg merge' to merge)
286 (run 'hg heads' to see heads, 'hg merge' to merge)
287 $ hg tglog
287 $ hg tglog
288 o 8: 'I'
288 o 8: 'I'
289 |
289 |
290 o 7: 'H'
290 o 7: 'H'
291 |
291 |
292 o 6: 'G'
292 o 6: 'G'
293 |
293 |
294 | o 5: 'F'
294 | o 5: 'F'
295 | |
295 | |
296 | o 4: 'E'
296 | o 4: 'E'
297 |/
297 |/
298 o 3: 'D'
298 o 3: 'D'
299 |
299 |
300 o 2: 'C'
300 o 2: 'C'
301 |
301 |
302 | o 1: 'B'
302 | o 1: 'B'
303 |/
303 |/
304 o 0: 'A'
304 o 0: 'A'
305
305
306 $ cd ..
306 $ cd ..
307
307
308
308
309 Simple case with keep:
309 Simple case with keep:
310
310
311 Source on have two descendant heads but ask for one
311 Source on have two descendant heads but ask for one
312
312
313 $ hg clone -q -u . ah ah1
313 $ hg clone -q -u . ah ah1
314 $ cd ah1
314 $ cd ah1
315 $ hg rebase -r '2::8' -d 1
315 $ hg rebase -r '2::8' -d 1
316 abort: can't remove original changesets with unrebased descendants
316 abort: can't remove original changesets with unrebased descendants
317 (use --keep to keep original changesets)
317 (use --keep to keep original changesets)
318 [255]
318 [255]
319 $ hg rebase -r '2::8' -d 1 --keep
319 $ hg rebase -r '2::8' -d 1 --keep
320 $ hg tglog
320 $ hg tglog
321 @ 13: 'I'
321 @ 13: 'I'
322 |
322 |
323 o 12: 'H'
323 o 12: 'H'
324 |
324 |
325 o 11: 'G'
325 o 11: 'G'
326 |
326 |
327 o 10: 'D'
327 o 10: 'D'
328 |
328 |
329 o 9: 'C'
329 o 9: 'C'
330 |
330 |
331 | o 8: 'I'
331 | o 8: 'I'
332 | |
332 | |
333 | o 7: 'H'
333 | o 7: 'H'
334 | |
334 | |
335 | o 6: 'G'
335 | o 6: 'G'
336 | |
336 | |
337 | | o 5: 'F'
337 | | o 5: 'F'
338 | | |
338 | | |
339 | | o 4: 'E'
339 | | o 4: 'E'
340 | |/
340 | |/
341 | o 3: 'D'
341 | o 3: 'D'
342 | |
342 | |
343 | o 2: 'C'
343 | o 2: 'C'
344 | |
344 | |
345 o | 1: 'B'
345 o | 1: 'B'
346 |/
346 |/
347 o 0: 'A'
347 o 0: 'A'
348
348
349
349
350 $ cd ..
350 $ cd ..
351
351
352 Base on have one descendant heads we ask for but common ancestor have two
352 Base on have one descendant heads we ask for but common ancestor have two
353
353
354 $ hg clone -q -u . ah ah2
354 $ hg clone -q -u . ah ah2
355 $ cd ah2
355 $ cd ah2
356 $ hg rebase -r '3::8' -d 1
356 $ hg rebase -r '3::8' -d 1
357 abort: can't remove original changesets with unrebased descendants
357 abort: can't remove original changesets with unrebased descendants
358 (use --keep to keep original changesets)
358 (use --keep to keep original changesets)
359 [255]
359 [255]
360 $ hg rebase -r '3::8' -d 1 --keep
360 $ hg rebase -r '3::8' -d 1 --keep
361 $ hg tglog
361 $ hg tglog
362 @ 12: 'I'
362 @ 12: 'I'
363 |
363 |
364 o 11: 'H'
364 o 11: 'H'
365 |
365 |
366 o 10: 'G'
366 o 10: 'G'
367 |
367 |
368 o 9: 'D'
368 o 9: 'D'
369 |\
369 |\
370 | | o 8: 'I'
370 | | o 8: 'I'
371 | | |
371 | | |
372 | | o 7: 'H'
372 | | o 7: 'H'
373 | | |
373 | | |
374 | | o 6: 'G'
374 | | o 6: 'G'
375 | | |
375 | | |
376 | | | o 5: 'F'
376 | | | o 5: 'F'
377 | | | |
377 | | | |
378 | | | o 4: 'E'
378 | | | o 4: 'E'
379 | | |/
379 | | |/
380 | | o 3: 'D'
380 | | o 3: 'D'
381 | |/
381 | |/
382 | o 2: 'C'
382 | o 2: 'C'
383 | |
383 | |
384 o | 1: 'B'
384 o | 1: 'B'
385 |/
385 |/
386 o 0: 'A'
386 o 0: 'A'
387
387
388
388
389 $ cd ..
389 $ cd ..
390
390
391 rebase subset
391 rebase subset
392
392
393 $ hg clone -q -u . ah ah3
393 $ hg clone -q -u . ah ah3
394 $ cd ah3
394 $ cd ah3
395 $ hg rebase -r '3::7' -d 1
395 $ hg rebase -r '3::7' -d 1
396 abort: can't remove original changesets with unrebased descendants
396 abort: can't remove original changesets with unrebased descendants
397 (use --keep to keep original changesets)
397 (use --keep to keep original changesets)
398 [255]
398 [255]
399 $ hg rebase -r '3::7' -d 1 --keep
399 $ hg rebase -r '3::7' -d 1 --keep
400 $ hg tglog
400 $ hg tglog
401 @ 11: 'H'
401 @ 11: 'H'
402 |
402 |
403 o 10: 'G'
403 o 10: 'G'
404 |
404 |
405 o 9: 'D'
405 o 9: 'D'
406 |\
406 |\
407 | | o 8: 'I'
407 | | o 8: 'I'
408 | | |
408 | | |
409 | | o 7: 'H'
409 | | o 7: 'H'
410 | | |
410 | | |
411 | | o 6: 'G'
411 | | o 6: 'G'
412 | | |
412 | | |
413 | | | o 5: 'F'
413 | | | o 5: 'F'
414 | | | |
414 | | | |
415 | | | o 4: 'E'
415 | | | o 4: 'E'
416 | | |/
416 | | |/
417 | | o 3: 'D'
417 | | o 3: 'D'
418 | |/
418 | |/
419 | o 2: 'C'
419 | o 2: 'C'
420 | |
420 | |
421 o | 1: 'B'
421 o | 1: 'B'
422 |/
422 |/
423 o 0: 'A'
423 o 0: 'A'
424
424
425
425
426 $ cd ..
426 $ cd ..
427
427
428 rebase subset with multiple head
428 rebase subset with multiple head
429
429
430 $ hg clone -q -u . ah ah4
430 $ hg clone -q -u . ah ah4
431 $ cd ah4
431 $ cd ah4
432 $ hg rebase -r '3::(7+5)' -d 1
432 $ hg rebase -r '3::(7+5)' -d 1
433 abort: can't remove original changesets with unrebased descendants
433 abort: can't remove original changesets with unrebased descendants
434 (use --keep to keep original changesets)
434 (use --keep to keep original changesets)
435 [255]
435 [255]
436 $ hg rebase -r '3::(7+5)' -d 1 --keep
436 $ hg rebase -r '3::(7+5)' -d 1 --keep
437 $ hg tglog
437 $ hg tglog
438 @ 13: 'H'
438 @ 13: 'H'
439 |
439 |
440 o 12: 'G'
440 o 12: 'G'
441 |
441 |
442 | o 11: 'F'
442 | o 11: 'F'
443 | |
443 | |
444 | o 10: 'E'
444 | o 10: 'E'
445 |/
445 |/
446 o 9: 'D'
446 o 9: 'D'
447 |\
447 |\
448 | | o 8: 'I'
448 | | o 8: 'I'
449 | | |
449 | | |
450 | | o 7: 'H'
450 | | o 7: 'H'
451 | | |
451 | | |
452 | | o 6: 'G'
452 | | o 6: 'G'
453 | | |
453 | | |
454 | | | o 5: 'F'
454 | | | o 5: 'F'
455 | | | |
455 | | | |
456 | | | o 4: 'E'
456 | | | o 4: 'E'
457 | | |/
457 | | |/
458 | | o 3: 'D'
458 | | o 3: 'D'
459 | |/
459 | |/
460 | o 2: 'C'
460 | o 2: 'C'
461 | |
461 | |
462 o | 1: 'B'
462 o | 1: 'B'
463 |/
463 |/
464 o 0: 'A'
464 o 0: 'A'
465
465
466
466
467 $ cd ..
467 $ cd ..
468
468
469 More advanced tests
469 More advanced tests
470
470
471 rebase on ancestor with revset
471 rebase on ancestor with revset
472
472
473 $ hg clone -q -u . ah ah5
473 $ hg clone -q -u . ah ah5
474 $ cd ah5
474 $ cd ah5
475 $ hg rebase -r '6::' -d 2
475 $ hg rebase -r '6::' -d 2
476 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg
476 saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
477 $ hg tglog
477 $ hg tglog
478 @ 8: 'I'
478 @ 8: 'I'
479 |
479 |
480 o 7: 'H'
480 o 7: 'H'
481 |
481 |
482 o 6: 'G'
482 o 6: 'G'
483 |
483 |
484 | o 5: 'F'
484 | o 5: 'F'
485 | |
485 | |
486 | o 4: 'E'
486 | o 4: 'E'
487 | |
487 | |
488 | o 3: 'D'
488 | o 3: 'D'
489 |/
489 |/
490 o 2: 'C'
490 o 2: 'C'
491 |
491 |
492 | o 1: 'B'
492 | o 1: 'B'
493 |/
493 |/
494 o 0: 'A'
494 o 0: 'A'
495
495
496 $ cd ..
496 $ cd ..
497
497
498
498
499 rebase with multiple root.
499 rebase with multiple root.
500 We rebase E and G on B
500 We rebase E and G on B
501 We would expect heads are I, F if it was supported
501 We would expect heads are I, F if it was supported
502
502
503 $ hg clone -q -u . ah ah6
503 $ hg clone -q -u . ah ah6
504 $ cd ah6
504 $ cd ah6
505 $ hg rebase -r '(4+6)::' -d 1
505 $ hg rebase -r '(4+6)::' -d 1
506 abort: can't rebase multiple roots
506 abort: can't rebase multiple roots
507 [255]
507 [255]
508 $ cd ..
508 $ cd ..
@@ -1,98 +1,98 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "relink=" >> $HGRCPATH
2 $ echo "relink=" >> $HGRCPATH
3
3
4 $ fix_path() {
4 $ fix_path() {
5 > tr '\\' /
5 > tr '\\' /
6 > }
6 > }
7
7
8 $ cat > arelinked.py <<EOF
8 $ cat > arelinked.py <<EOF
9 > import sys, os
9 > import sys, os
10 > from mercurial import util
10 > from mercurial import util
11 > path1, path2 = sys.argv[1:3]
11 > path1, path2 = sys.argv[1:3]
12 > if util.samefile(path1, path2):
12 > if util.samefile(path1, path2):
13 > print '%s == %s' % (path1, path2)
13 > print '%s == %s' % (path1, path2)
14 > else:
14 > else:
15 > print '%s != %s' % (path1, path2)
15 > print '%s != %s' % (path1, path2)
16 > EOF
16 > EOF
17
17
18
18
19 create source repository
19 create source repository
20
20
21 $ hg init repo
21 $ hg init repo
22 $ cd repo
22 $ cd repo
23 $ echo a > a
23 $ echo a > a
24 $ echo b > b
24 $ echo b > b
25 $ hg ci -Am addfile
25 $ hg ci -Am addfile
26 adding a
26 adding a
27 adding b
27 adding b
28 $ cat $TESTDIR/binfile.bin >> a
28 $ cat $TESTDIR/binfile.bin >> a
29 $ cat $TESTDIR/binfile.bin >> b
29 $ cat $TESTDIR/binfile.bin >> b
30 $ hg ci -Am changefiles
30 $ hg ci -Am changefiles
31
31
32 make another commit to create files larger than 1 KB to test
32 make another commit to create files larger than 1 KB to test
33 formatting of final byte count
33 formatting of final byte count
34
34
35 $ cat $TESTDIR/binfile.bin >> a
35 $ cat $TESTDIR/binfile.bin >> a
36 $ cat $TESTDIR/binfile.bin >> b
36 $ cat $TESTDIR/binfile.bin >> b
37 $ hg ci -m anotherchange
37 $ hg ci -m anotherchange
38
38
39 don't sit forever trying to double-lock the source repo
39 don't sit forever trying to double-lock the source repo
40
40
41 $ hg relink .
41 $ hg relink .
42 relinking $TESTTMP/repo/.hg/store to $TESTTMP/repo/.hg/store
42 relinking $TESTTMP/repo/.hg/store to $TESTTMP/repo/.hg/store (glob)
43 there is nothing to relink
43 there is nothing to relink
44
44
45
45
46 Test files are read in binary mode
46 Test files are read in binary mode
47
47
48 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
48 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\r\nb\n')"
49 $ cd ..
49 $ cd ..
50
50
51
51
52 clone and pull to break links
52 clone and pull to break links
53
53
54 $ hg clone --pull -r0 repo clone
54 $ hg clone --pull -r0 repo clone
55 adding changesets
55 adding changesets
56 adding manifests
56 adding manifests
57 adding file changes
57 adding file changes
58 added 1 changesets with 2 changes to 2 files
58 added 1 changesets with 2 changes to 2 files
59 updating to branch default
59 updating to branch default
60 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
60 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
61 $ cd clone
61 $ cd clone
62 $ hg pull -q
62 $ hg pull -q
63 $ echo b >> b
63 $ echo b >> b
64 $ hg ci -m changeb
64 $ hg ci -m changeb
65 created new head
65 created new head
66 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
66 $ python -c "file('.hg/store/data/dummy.i', 'wb').write('a\nb\r\n')"
67
67
68
68
69 relink
69 relink
70
70
71 $ hg relink --debug | fix_path
71 $ hg relink --debug | fix_path
72 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
72 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
73 tip has 2 files, estimated total number of files: 3
73 tip has 2 files, estimated total number of files: 3
74 collecting: 00changelog.i 1/3 files (33.33%)
74 collecting: 00changelog.i 1/3 files (33.33%)
75 collecting: 00manifest.i 2/3 files (66.67%)
75 collecting: 00manifest.i 2/3 files (66.67%)
76 collecting: a.i 3/3 files (100.00%)
76 collecting: a.i 3/3 files (100.00%)
77 collecting: b.i 4/3 files (133.33%)
77 collecting: b.i 4/3 files (133.33%)
78 collecting: dummy.i 5/3 files (166.67%)
78 collecting: dummy.i 5/3 files (166.67%)
79 collected 5 candidate storage files
79 collected 5 candidate storage files
80 not linkable: 00changelog.i
80 not linkable: 00changelog.i
81 not linkable: 00manifest.i
81 not linkable: 00manifest.i
82 pruning: data/a.i 3/5 files (60.00%)
82 pruning: data/a.i 3/5 files (60.00%)
83 not linkable: data/b.i
83 not linkable: data/b.i
84 pruning: data/dummy.i 5/5 files (100.00%)
84 pruning: data/dummy.i 5/5 files (100.00%)
85 pruned down to 2 probably relinkable files
85 pruned down to 2 probably relinkable files
86 relinking: data/a.i 1/2 files (50.00%)
86 relinking: data/a.i 1/2 files (50.00%)
87 not linkable: data/dummy.i
87 not linkable: data/dummy.i
88 relinked 1 files (1.37 KB reclaimed)
88 relinked 1 files (1.37 KB reclaimed)
89 $ cd ..
89 $ cd ..
90
90
91
91
92 check hardlinks
92 check hardlinks
93
93
94 $ python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
94 $ python arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
95 repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
95 repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
96 $ python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
96 $ python arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
97 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
97 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
98
98
@@ -1,256 +1,256 b''
1 $ remove() {
1 $ remove() {
2 > hg rm $@
2 > hg rm $@
3 > echo "exit code: $?" # no-check-code
3 > echo "exit code: $?" # no-check-code
4 > hg st
4 > hg st
5 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
5 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
6 > find . -name .hg -prune -o -type f -print | sort
6 > find . -name .hg -prune -o -type f -print | sort
7 > hg up -C
7 > hg up -C
8 > }
8 > }
9
9
10 $ hg init a
10 $ hg init a
11 $ cd a
11 $ cd a
12 $ echo a > foo
12 $ echo a > foo
13
13
14 file not managed
14 file not managed
15
15
16 $ remove foo
16 $ remove foo
17 not removing foo: file is untracked
17 not removing foo: file is untracked
18 exit code: 1
18 exit code: 1
19 ? foo
19 ? foo
20 ./foo
20 ./foo
21 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
21 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
22
22
23 $ hg add foo
23 $ hg add foo
24 $ hg commit -m1
24 $ hg commit -m1
25
25
26 the table cases
26 the table cases
27 00 state added, options none
27 00 state added, options none
28
28
29 $ echo b > bar
29 $ echo b > bar
30 $ hg add bar
30 $ hg add bar
31 $ remove bar
31 $ remove bar
32 not removing bar: file has been marked for add (use forget to undo)
32 not removing bar: file has been marked for add (use forget to undo)
33 exit code: 1
33 exit code: 1
34 A bar
34 A bar
35 ./bar
35 ./bar
36 ./foo
36 ./foo
37 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
38
38
39 01 state clean, options none
39 01 state clean, options none
40
40
41 $ remove foo
41 $ remove foo
42 exit code: 0
42 exit code: 0
43 R foo
43 R foo
44 ? bar
44 ? bar
45 ./bar
45 ./bar
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
47
48 02 state modified, options none
48 02 state modified, options none
49
49
50 $ echo b >> foo
50 $ echo b >> foo
51 $ remove foo
51 $ remove foo
52 not removing foo: file is modified (use -f to force removal)
52 not removing foo: file is modified (use -f to force removal)
53 exit code: 1
53 exit code: 1
54 M foo
54 M foo
55 ? bar
55 ? bar
56 ./bar
56 ./bar
57 ./foo
57 ./foo
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
59
60 03 state missing, options none
60 03 state missing, options none
61
61
62 $ rm foo
62 $ rm foo
63 $ remove foo
63 $ remove foo
64 exit code: 0
64 exit code: 0
65 R foo
65 R foo
66 ? bar
66 ? bar
67 ./bar
67 ./bar
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69
69
70 10 state added, options -f
70 10 state added, options -f
71
71
72 $ echo b > bar
72 $ echo b > bar
73 $ hg add bar
73 $ hg add bar
74 $ remove -f bar
74 $ remove -f bar
75 exit code: 0
75 exit code: 0
76 ? bar
76 ? bar
77 ./bar
77 ./bar
78 ./foo
78 ./foo
79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 $ rm bar
80 $ rm bar
81
81
82 11 state clean, options -f
82 11 state clean, options -f
83
83
84 $ remove -f foo
84 $ remove -f foo
85 exit code: 0
85 exit code: 0
86 R foo
86 R foo
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
88
88
89 12 state modified, options -f
89 12 state modified, options -f
90
90
91 $ echo b >> foo
91 $ echo b >> foo
92 $ remove -f foo
92 $ remove -f foo
93 exit code: 0
93 exit code: 0
94 R foo
94 R foo
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
96
96
97 13 state missing, options -f
97 13 state missing, options -f
98
98
99 $ rm foo
99 $ rm foo
100 $ remove -f foo
100 $ remove -f foo
101 exit code: 0
101 exit code: 0
102 R foo
102 R foo
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
104
104
105 20 state added, options -A
105 20 state added, options -A
106
106
107 $ echo b > bar
107 $ echo b > bar
108 $ hg add bar
108 $ hg add bar
109 $ remove -A bar
109 $ remove -A bar
110 not removing bar: file still exists (use -f to force removal)
110 not removing bar: file still exists (use -f to force removal)
111 exit code: 1
111 exit code: 1
112 A bar
112 A bar
113 ./bar
113 ./bar
114 ./foo
114 ./foo
115 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
116
116
117 21 state clean, options -A
117 21 state clean, options -A
118
118
119 $ remove -A foo
119 $ remove -A foo
120 not removing foo: file still exists (use -f to force removal)
120 not removing foo: file still exists (use -f to force removal)
121 exit code: 1
121 exit code: 1
122 ? bar
122 ? bar
123 ./bar
123 ./bar
124 ./foo
124 ./foo
125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
126
126
127 22 state modified, options -A
127 22 state modified, options -A
128
128
129 $ echo b >> foo
129 $ echo b >> foo
130 $ remove -A foo
130 $ remove -A foo
131 not removing foo: file still exists (use -f to force removal)
131 not removing foo: file still exists (use -f to force removal)
132 exit code: 1
132 exit code: 1
133 M foo
133 M foo
134 ? bar
134 ? bar
135 ./bar
135 ./bar
136 ./foo
136 ./foo
137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
138
138
139 23 state missing, options -A
139 23 state missing, options -A
140
140
141 $ rm foo
141 $ rm foo
142 $ remove -A foo
142 $ remove -A foo
143 exit code: 0
143 exit code: 0
144 R foo
144 R foo
145 ? bar
145 ? bar
146 ./bar
146 ./bar
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148
148
149 30 state added, options -Af
149 30 state added, options -Af
150
150
151 $ echo b > bar
151 $ echo b > bar
152 $ hg add bar
152 $ hg add bar
153 $ remove -Af bar
153 $ remove -Af bar
154 exit code: 0
154 exit code: 0
155 ? bar
155 ? bar
156 ./bar
156 ./bar
157 ./foo
157 ./foo
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 $ rm bar
159 $ rm bar
160
160
161 31 state clean, options -Af
161 31 state clean, options -Af
162
162
163 $ remove -Af foo
163 $ remove -Af foo
164 exit code: 0
164 exit code: 0
165 R foo
165 R foo
166 ./foo
166 ./foo
167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
168
168
169 32 state modified, options -Af
169 32 state modified, options -Af
170
170
171 $ echo b >> foo
171 $ echo b >> foo
172 $ remove -Af foo
172 $ remove -Af foo
173 exit code: 0
173 exit code: 0
174 R foo
174 R foo
175 ./foo
175 ./foo
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
177
177
178 33 state missing, options -Af
178 33 state missing, options -Af
179
179
180 $ rm foo
180 $ rm foo
181 $ remove -Af foo
181 $ remove -Af foo
182 exit code: 0
182 exit code: 0
183 R foo
183 R foo
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
184 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
185
185
186 test some directory stuff
186 test some directory stuff
187
187
188 $ mkdir test
188 $ mkdir test
189 $ echo a > test/foo
189 $ echo a > test/foo
190 $ echo b > test/bar
190 $ echo b > test/bar
191 $ hg ci -Am2
191 $ hg ci -Am2
192 adding test/bar
192 adding test/bar
193 adding test/foo
193 adding test/foo
194
194
195 dir, options none
195 dir, options none
196
196
197 $ rm test/bar
197 $ rm test/bar
198 $ remove test
198 $ remove test
199 removing test/bar
199 removing test/bar (glob)
200 removing test/foo
200 removing test/foo (glob)
201 exit code: 0
201 exit code: 0
202 R test/bar
202 R test/bar
203 R test/foo
203 R test/foo
204 ./foo
204 ./foo
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
206
206
207 dir, options -f
207 dir, options -f
208
208
209 $ rm test/bar
209 $ rm test/bar
210 $ remove -f test
210 $ remove -f test
211 removing test/bar
211 removing test/bar (glob)
212 removing test/foo
212 removing test/foo (glob)
213 exit code: 0
213 exit code: 0
214 R test/bar
214 R test/bar
215 R test/foo
215 R test/foo
216 ./foo
216 ./foo
217 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
217 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
218
218
219 dir, options -A
219 dir, options -A
220
220
221 $ rm test/bar
221 $ rm test/bar
222 $ remove -A test
222 $ remove -A test
223 not removing test/foo: file still exists (use -f to force removal)
223 not removing test/foo: file still exists (use -f to force removal) (glob)
224 removing test/bar
224 removing test/bar (glob)
225 exit code: 1
225 exit code: 1
226 R test/bar
226 R test/bar
227 ./foo
227 ./foo
228 ./test/foo
228 ./test/foo
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
230
230
231 dir, options -Af
231 dir, options -Af
232
232
233 $ rm test/bar
233 $ rm test/bar
234 $ remove -Af test
234 $ remove -Af test
235 removing test/bar
235 removing test/bar (glob)
236 removing test/foo
236 removing test/foo (glob)
237 exit code: 0
237 exit code: 0
238 R test/bar
238 R test/bar
239 R test/foo
239 R test/foo
240 ./foo
240 ./foo
241 ./test/foo
241 ./test/foo
242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
243
243
244 test remove dropping empty trees (issue1861)
244 test remove dropping empty trees (issue1861)
245
245
246 $ mkdir -p issue1861/b/c
246 $ mkdir -p issue1861/b/c
247 $ echo x > issue1861/x
247 $ echo x > issue1861/x
248 $ echo y > issue1861/b/c/y
248 $ echo y > issue1861/b/c/y
249 $ hg ci -Am add
249 $ hg ci -Am add
250 adding issue1861/b/c/y
250 adding issue1861/b/c/y
251 adding issue1861/x
251 adding issue1861/x
252 $ hg rm issue1861/b
252 $ hg rm issue1861/b
253 removing issue1861/b/c/y
253 removing issue1861/b/c/y (glob)
254 $ hg ci -m remove
254 $ hg ci -m remove
255 $ ls issue1861
255 $ ls issue1861
256 x
256 x
@@ -1,163 +1,163 b''
1 $ hg init t
1 $ hg init t
2 $ cd t
2 $ cd t
3
3
4 $ mkdir a
4 $ mkdir a
5 $ echo foo > a/a
5 $ echo foo > a/a
6 $ echo bar > a/b
6 $ echo bar > a/b
7 $ hg ci -Am "0"
7 $ hg ci -Am "0"
8 adding a/a
8 adding a/a
9 adding a/b
9 adding a/b
10
10
11 $ hg co -C 0
11 $ hg co -C 0
12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
12 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
13 $ hg mv a b
13 $ hg mv a b
14 moving a/a to b/a
14 moving a/a to b/a (glob)
15 moving a/b to b/b
15 moving a/b to b/b (glob)
16 $ hg ci -m "1 mv a/ b/"
16 $ hg ci -m "1 mv a/ b/"
17
17
18 $ hg co -C 0
18 $ hg co -C 0
19 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
19 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
20 $ echo baz > a/c
20 $ echo baz > a/c
21 $ echo quux > a/d
21 $ echo quux > a/d
22 $ hg add a/c
22 $ hg add a/c
23 $ hg ci -m "2 add a/c"
23 $ hg ci -m "2 add a/c"
24 created new head
24 created new head
25
25
26 $ hg merge --debug 1
26 $ hg merge --debug 1
27 searching for copies back to rev 1
27 searching for copies back to rev 1
28 unmatched files in local:
28 unmatched files in local:
29 a/c
29 a/c
30 a/d
30 a/d
31 unmatched files in other:
31 unmatched files in other:
32 b/a
32 b/a
33 b/b
33 b/b
34 all copies found (* = to merge, ! = divergent):
34 all copies found (* = to merge, ! = divergent):
35 b/a -> a/a
35 b/a -> a/a
36 b/b -> a/b
36 b/b -> a/b
37 checking for directory renames
37 checking for directory renames
38 dir a/ -> b/
38 dir a/ -> b/
39 file a/c -> b/c
39 file a/c -> b/c
40 file a/d -> b/d
40 file a/d -> b/d
41 resolving manifests
41 resolving manifests
42 overwrite None partial False
42 overwrite None partial False
43 ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
43 ancestor f9b20c0d4c51 local ce36d17b18fb+ remote 397f8b00a740
44 a/d: remote renamed directory to b/d -> d
44 a/d: remote renamed directory to b/d -> d
45 a/c: remote renamed directory to b/c -> d
45 a/c: remote renamed directory to b/c -> d
46 a/b: other deleted -> r
46 a/b: other deleted -> r
47 a/a: other deleted -> r
47 a/a: other deleted -> r
48 b/a: remote created -> g
48 b/a: remote created -> g
49 b/b: remote created -> g
49 b/b: remote created -> g
50 updating: a/a 1/6 files (16.67%)
50 updating: a/a 1/6 files (16.67%)
51 removing a/a
51 removing a/a
52 updating: a/b 2/6 files (33.33%)
52 updating: a/b 2/6 files (33.33%)
53 removing a/b
53 removing a/b
54 updating: a/c 3/6 files (50.00%)
54 updating: a/c 3/6 files (50.00%)
55 moving a/c to b/c
55 moving a/c to b/c
56 updating: a/d 4/6 files (66.67%)
56 updating: a/d 4/6 files (66.67%)
57 moving a/d to b/d
57 moving a/d to b/d
58 updating: b/a 5/6 files (83.33%)
58 updating: b/a 5/6 files (83.33%)
59 getting b/a
59 getting b/a
60 updating: b/b 6/6 files (100.00%)
60 updating: b/b 6/6 files (100.00%)
61 getting b/b
61 getting b/b
62 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
62 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
63 (branch merge, don't forget to commit)
63 (branch merge, don't forget to commit)
64
64
65 $ echo a/* b/*
65 $ echo a/* b/*
66 a/* b/a b/b b/c b/d
66 a/* b/a b/b b/c b/d
67 $ hg st -C
67 $ hg st -C
68 M b/a
68 M b/a
69 M b/b
69 M b/b
70 A b/c
70 A b/c
71 a/c
71 a/c
72 R a/a
72 R a/a
73 R a/b
73 R a/b
74 R a/c
74 R a/c
75 ? b/d
75 ? b/d
76 $ hg ci -m "3 merge 2+1"
76 $ hg ci -m "3 merge 2+1"
77 $ hg debugrename b/c
77 $ hg debugrename b/c
78 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
78 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
79
79
80 $ hg co -C 1
80 $ hg co -C 1
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 $ hg merge --debug 2
82 $ hg merge --debug 2
83 searching for copies back to rev 1
83 searching for copies back to rev 1
84 unmatched files in local:
84 unmatched files in local:
85 b/a
85 b/a
86 b/b
86 b/b
87 b/d
87 b/d
88 unmatched files in other:
88 unmatched files in other:
89 a/c
89 a/c
90 all copies found (* = to merge, ! = divergent):
90 all copies found (* = to merge, ! = divergent):
91 b/a -> a/a
91 b/a -> a/a
92 b/b -> a/b
92 b/b -> a/b
93 checking for directory renames
93 checking for directory renames
94 dir a/ -> b/
94 dir a/ -> b/
95 file a/c -> b/c
95 file a/c -> b/c
96 resolving manifests
96 resolving manifests
97 overwrite None partial False
97 overwrite None partial False
98 ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
98 ancestor f9b20c0d4c51 local 397f8b00a740+ remote ce36d17b18fb
99 None: local renamed directory to b/c -> d
99 None: local renamed directory to b/c -> d
100 updating:None 1/1 files (100.00%)
100 updating:None 1/1 files (100.00%)
101 getting a/c to b/c
101 getting a/c to b/c
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 (branch merge, don't forget to commit)
103 (branch merge, don't forget to commit)
104
104
105 $ echo a/* b/*
105 $ echo a/* b/*
106 a/* b/a b/b b/c b/d
106 a/* b/a b/b b/c b/d
107 $ hg st -C
107 $ hg st -C
108 A b/c
108 A b/c
109 a/c
109 a/c
110 ? b/d
110 ? b/d
111 $ hg ci -m "4 merge 1+2"
111 $ hg ci -m "4 merge 1+2"
112 created new head
112 created new head
113 $ hg debugrename b/c
113 $ hg debugrename b/c
114 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88
114 b/c renamed from a/c:354ae8da6e890359ef49ade27b68bbc361f3ca88 (glob)
115
115
116
116
117 Second scenario with two repos:
117 Second scenario with two repos:
118
118
119 $ cd ..
119 $ cd ..
120 $ hg init r1
120 $ hg init r1
121 $ cd r1
121 $ cd r1
122 $ mkdir a
122 $ mkdir a
123 $ echo foo > a/f
123 $ echo foo > a/f
124 $ hg add a
124 $ hg add a
125 adding a/f
125 adding a/f (glob)
126 $ hg ci -m "a/f == foo"
126 $ hg ci -m "a/f == foo"
127 $ cd ..
127 $ cd ..
128
128
129 $ hg clone r1 r2
129 $ hg clone r1 r2
130 updating to branch default
130 updating to branch default
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 $ cd r2
132 $ cd r2
133 $ hg mv a b
133 $ hg mv a b
134 moving a/f to b/f
134 moving a/f to b/f (glob)
135 $ echo foo1 > b/f
135 $ echo foo1 > b/f
136 $ hg ci -m" a -> b, b/f == foo1"
136 $ hg ci -m" a -> b, b/f == foo1"
137 $ cd ..
137 $ cd ..
138
138
139 $ cd r1
139 $ cd r1
140 $ mkdir a/aa
140 $ mkdir a/aa
141 $ echo bar > a/aa/g
141 $ echo bar > a/aa/g
142 $ hg add a/aa
142 $ hg add a/aa
143 adding a/aa/g
143 adding a/aa/g (glob)
144 $ hg ci -m "a/aa/g"
144 $ hg ci -m "a/aa/g"
145 $ hg pull ../r2
145 $ hg pull ../r2
146 pulling from ../r2
146 pulling from ../r2
147 searching for changes
147 searching for changes
148 adding changesets
148 adding changesets
149 adding manifests
149 adding manifests
150 adding file changes
150 adding file changes
151 added 1 changesets with 1 changes to 1 files (+1 heads)
151 added 1 changesets with 1 changes to 1 files (+1 heads)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
152 (run 'hg heads' to see heads, 'hg merge' to merge)
153
153
154 $ hg merge
154 $ hg merge
155 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
156 (branch merge, don't forget to commit)
156 (branch merge, don't forget to commit)
157
157
158 $ hg st -C
158 $ hg st -C
159 M b/f
159 M b/f
160 A b/aa/g
160 A b/aa/g
161 a/aa/g
161 a/aa/g
162 R a/aa/g
162 R a/aa/g
163 R a/f
163 R a/f
@@ -1,637 +1,637 b''
1 $ "$TESTDIR/hghave" symlink || exit 80
1 $ "$TESTDIR/hghave" symlink || exit 80
2
2
3 $ hg init
3 $ hg init
4 $ mkdir d1 d1/d11 d2
4 $ mkdir d1 d1/d11 d2
5 $ echo d1/a > d1/a
5 $ echo d1/a > d1/a
6 $ echo d1/ba > d1/ba
6 $ echo d1/ba > d1/ba
7 $ echo d1/a1 > d1/d11/a1
7 $ echo d1/a1 > d1/d11/a1
8 $ echo d1/b > d1/b
8 $ echo d1/b > d1/b
9 $ echo d2/b > d2/b
9 $ echo d2/b > d2/b
10 $ hg add d1/a d1/b d1/ba d1/d11/a1 d2/b
10 $ hg add d1/a d1/b d1/ba d1/d11/a1 d2/b
11 $ hg commit -m "1"
11 $ hg commit -m "1"
12
12
13 rename a single file
13 rename a single file
14
14
15 $ hg rename d1/d11/a1 d2/c
15 $ hg rename d1/d11/a1 d2/c
16 $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml
16 $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml
17 abort: filename contains 'con', which is reserved on Windows: 'd1/con.xml'
17 abort: filename contains 'con', which is reserved on Windows: 'd1/con.xml'
18 [255]
18 [255]
19 $ hg sum
19 $ hg sum
20 parent: 0:9b4b6e7b2c26 tip
20 parent: 0:9b4b6e7b2c26 tip
21 1
21 1
22 branch: default
22 branch: default
23 commit: 1 renamed
23 commit: 1 renamed
24 update: (current)
24 update: (current)
25 $ hg status -C
25 $ hg status -C
26 A d2/c
26 A d2/c
27 d1/d11/a1
27 d1/d11/a1
28 R d1/d11/a1
28 R d1/d11/a1
29 $ hg update -C
29 $ hg update -C
30 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 $ rm d2/c
31 $ rm d2/c
32
32
33 rename a single file using absolute paths
33 rename a single file using absolute paths
34
34
35 $ hg rename `pwd`/d1/d11/a1 `pwd`/d2/c
35 $ hg rename `pwd`/d1/d11/a1 `pwd`/d2/c
36 $ hg status -C
36 $ hg status -C
37 A d2/c
37 A d2/c
38 d1/d11/a1
38 d1/d11/a1
39 R d1/d11/a1
39 R d1/d11/a1
40 $ hg update -C
40 $ hg update -C
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 $ rm d2/c
42 $ rm d2/c
43
43
44 rename --after a single file
44 rename --after a single file
45
45
46 $ mv d1/d11/a1 d2/c
46 $ mv d1/d11/a1 d2/c
47 $ hg rename --after d1/d11/a1 d2/c
47 $ hg rename --after d1/d11/a1 d2/c
48 $ hg status -C
48 $ hg status -C
49 A d2/c
49 A d2/c
50 d1/d11/a1
50 d1/d11/a1
51 R d1/d11/a1
51 R d1/d11/a1
52 $ hg update -C
52 $ hg update -C
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 $ rm d2/c
54 $ rm d2/c
55
55
56 rename --after a single file when src and tgt already tracked
56 rename --after a single file when src and tgt already tracked
57
57
58 $ mv d1/d11/a1 d2/c
58 $ mv d1/d11/a1 d2/c
59 $ hg addrem -s 0
59 $ hg addrem -s 0
60 removing d1/d11/a1
60 removing d1/d11/a1
61 adding d2/c
61 adding d2/c
62 $ hg rename --after d1/d11/a1 d2/c
62 $ hg rename --after d1/d11/a1 d2/c
63 $ hg status -C
63 $ hg status -C
64 A d2/c
64 A d2/c
65 d1/d11/a1
65 d1/d11/a1
66 R d1/d11/a1
66 R d1/d11/a1
67 $ hg update -C
67 $ hg update -C
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 $ rm d2/c
69 $ rm d2/c
70
70
71 rename --after a single file to a nonexistant target filename
71 rename --after a single file to a nonexistant target filename
72
72
73 $ hg rename --after d1/a dummy
73 $ hg rename --after d1/a dummy
74 d1/a: not recording move - dummy does not exist
74 d1/a: not recording move - dummy does not exist (glob)
75
75
76 move a single file to an existing directory
76 move a single file to an existing directory
77
77
78 $ hg rename d1/d11/a1 d2
78 $ hg rename d1/d11/a1 d2
79 $ hg status -C
79 $ hg status -C
80 A d2/a1
80 A d2/a1
81 d1/d11/a1
81 d1/d11/a1
82 R d1/d11/a1
82 R d1/d11/a1
83 $ hg update -C
83 $ hg update -C
84 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 $ rm d2/a1
85 $ rm d2/a1
86
86
87 move --after a single file to an existing directory
87 move --after a single file to an existing directory
88
88
89 $ mv d1/d11/a1 d2
89 $ mv d1/d11/a1 d2
90 $ hg rename --after d1/d11/a1 d2
90 $ hg rename --after d1/d11/a1 d2
91 $ hg status -C
91 $ hg status -C
92 A d2/a1
92 A d2/a1
93 d1/d11/a1
93 d1/d11/a1
94 R d1/d11/a1
94 R d1/d11/a1
95 $ hg update -C
95 $ hg update -C
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 d2/a1
97 $ rm d2/a1
98
98
99 rename a file using a relative path
99 rename a file using a relative path
100
100
101 $ (cd d1/d11; hg rename ../../d2/b e)
101 $ (cd d1/d11; hg rename ../../d2/b e)
102 $ hg status -C
102 $ hg status -C
103 A d1/d11/e
103 A d1/d11/e
104 d2/b
104 d2/b
105 R d2/b
105 R d2/b
106 $ hg update -C
106 $ hg update -C
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 $ rm d1/d11/e
108 $ rm d1/d11/e
109
109
110 rename --after a file using a relative path
110 rename --after a file using a relative path
111
111
112 $ (cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e)
112 $ (cd d1/d11; mv ../../d2/b e; hg rename --after ../../d2/b e)
113 $ hg status -C
113 $ hg status -C
114 A d1/d11/e
114 A d1/d11/e
115 d2/b
115 d2/b
116 R d2/b
116 R d2/b
117 $ hg update -C
117 $ hg update -C
118 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 $ rm d1/d11/e
119 $ rm d1/d11/e
120
120
121 rename directory d1 as d3
121 rename directory d1 as d3
122
122
123 $ hg rename d1/ d3
123 $ hg rename d1/ d3
124 moving d1/a to d3/a
124 moving d1/a to d3/a (glob)
125 moving d1/b to d3/b
125 moving d1/b to d3/b (glob)
126 moving d1/ba to d3/ba
126 moving d1/ba to d3/ba (glob)
127 moving d1/d11/a1 to d3/d11/a1
127 moving d1/d11/a1 to d3/d11/a1 (glob)
128 $ hg status -C
128 $ hg status -C
129 A d3/a
129 A d3/a
130 d1/a
130 d1/a
131 A d3/b
131 A d3/b
132 d1/b
132 d1/b
133 A d3/ba
133 A d3/ba
134 d1/ba
134 d1/ba
135 A d3/d11/a1
135 A d3/d11/a1
136 d1/d11/a1
136 d1/d11/a1
137 R d1/a
137 R d1/a
138 R d1/b
138 R d1/b
139 R d1/ba
139 R d1/ba
140 R d1/d11/a1
140 R d1/d11/a1
141 $ hg update -C
141 $ hg update -C
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 $ rm -rf d3
143 $ rm -rf d3
144
144
145 rename --after directory d1 as d3
145 rename --after directory d1 as d3
146
146
147 $ mv d1 d3
147 $ mv d1 d3
148 $ hg rename --after d1 d3
148 $ hg rename --after d1 d3
149 moving d1/a to d3/a
149 moving d1/a to d3/a (glob)
150 moving d1/b to d3/b
150 moving d1/b to d3/b (glob)
151 moving d1/ba to d3/ba
151 moving d1/ba to d3/ba (glob)
152 moving d1/d11/a1 to d3/d11/a1
152 moving d1/d11/a1 to d3/d11/a1 (glob)
153 $ hg status -C
153 $ hg status -C
154 A d3/a
154 A d3/a
155 d1/a
155 d1/a
156 A d3/b
156 A d3/b
157 d1/b
157 d1/b
158 A d3/ba
158 A d3/ba
159 d1/ba
159 d1/ba
160 A d3/d11/a1
160 A d3/d11/a1
161 d1/d11/a1
161 d1/d11/a1
162 R d1/a
162 R d1/a
163 R d1/b
163 R d1/b
164 R d1/ba
164 R d1/ba
165 R d1/d11/a1
165 R d1/d11/a1
166 $ hg update -C
166 $ hg update -C
167 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
167 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 $ rm -rf d3
168 $ rm -rf d3
169
169
170 move a directory using a relative path
170 move a directory using a relative path
171
171
172 $ (cd d2; mkdir d3; hg rename ../d1/d11 d3)
172 $ (cd d2; mkdir d3; hg rename ../d1/d11 d3)
173 moving ../d1/d11/a1 to d3/d11/a1
173 moving ../d1/d11/a1 to d3/d11/a1 (glob)
174 $ hg status -C
174 $ hg status -C
175 A d2/d3/d11/a1
175 A d2/d3/d11/a1
176 d1/d11/a1
176 d1/d11/a1
177 R d1/d11/a1
177 R d1/d11/a1
178 $ hg update -C
178 $ hg update -C
179 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 $ rm -rf d2/d3
180 $ rm -rf d2/d3
181
181
182 move --after a directory using a relative path
182 move --after a directory using a relative path
183
183
184 $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3)
184 $ (cd d2; mkdir d3; mv ../d1/d11 d3; hg rename --after ../d1/d11 d3)
185 moving ../d1/d11/a1 to d3/d11/a1
185 moving ../d1/d11/a1 to d3/d11/a1 (glob)
186 $ hg status -C
186 $ hg status -C
187 A d2/d3/d11/a1
187 A d2/d3/d11/a1
188 d1/d11/a1
188 d1/d11/a1
189 R d1/d11/a1
189 R d1/d11/a1
190 $ hg update -C
190 $ hg update -C
191 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 $ rm -rf d2/d3
192 $ rm -rf d2/d3
193
193
194 move directory d1/d11 to an existing directory d2 (removes empty d1)
194 move directory d1/d11 to an existing directory d2 (removes empty d1)
195
195
196 $ hg rename d1/d11/ d2
196 $ hg rename d1/d11/ d2
197 moving d1/d11/a1 to d2/d11/a1
197 moving d1/d11/a1 to d2/d11/a1 (glob)
198 $ hg status -C
198 $ hg status -C
199 A d2/d11/a1
199 A d2/d11/a1
200 d1/d11/a1
200 d1/d11/a1
201 R d1/d11/a1
201 R d1/d11/a1
202 $ hg update -C
202 $ hg update -C
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ rm -rf d2/d11
204 $ rm -rf d2/d11
205
205
206 move directories d1 and d2 to a new directory d3
206 move directories d1 and d2 to a new directory d3
207
207
208 $ mkdir d3
208 $ mkdir d3
209 $ hg rename d1 d2 d3
209 $ hg rename d1 d2 d3
210 moving d1/a to d3/d1/a
210 moving d1/a to d3/d1/a (glob)
211 moving d1/b to d3/d1/b
211 moving d1/b to d3/d1/b (glob)
212 moving d1/ba to d3/d1/ba
212 moving d1/ba to d3/d1/ba (glob)
213 moving d1/d11/a1 to d3/d1/d11/a1
213 moving d1/d11/a1 to d3/d1/d11/a1 (glob)
214 moving d2/b to d3/d2/b
214 moving d2/b to d3/d2/b (glob)
215 $ hg status -C
215 $ hg status -C
216 A d3/d1/a
216 A d3/d1/a
217 d1/a
217 d1/a
218 A d3/d1/b
218 A d3/d1/b
219 d1/b
219 d1/b
220 A d3/d1/ba
220 A d3/d1/ba
221 d1/ba
221 d1/ba
222 A d3/d1/d11/a1
222 A d3/d1/d11/a1
223 d1/d11/a1
223 d1/d11/a1
224 A d3/d2/b
224 A d3/d2/b
225 d2/b
225 d2/b
226 R d1/a
226 R d1/a
227 R d1/b
227 R d1/b
228 R d1/ba
228 R d1/ba
229 R d1/d11/a1
229 R d1/d11/a1
230 R d2/b
230 R d2/b
231 $ hg update -C
231 $ hg update -C
232 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 $ rm -rf d3
233 $ rm -rf d3
234
234
235 move --after directories d1 and d2 to a new directory d3
235 move --after directories d1 and d2 to a new directory d3
236
236
237 $ mkdir d3
237 $ mkdir d3
238 $ mv d1 d2 d3
238 $ mv d1 d2 d3
239 $ hg rename --after d1 d2 d3
239 $ hg rename --after d1 d2 d3
240 moving d1/a to d3/d1/a
240 moving d1/a to d3/d1/a (glob)
241 moving d1/b to d3/d1/b
241 moving d1/b to d3/d1/b (glob)
242 moving d1/ba to d3/d1/ba
242 moving d1/ba to d3/d1/ba (glob)
243 moving d1/d11/a1 to d3/d1/d11/a1
243 moving d1/d11/a1 to d3/d1/d11/a1 (glob)
244 moving d2/b to d3/d2/b
244 moving d2/b to d3/d2/b (glob)
245 $ hg status -C
245 $ hg status -C
246 A d3/d1/a
246 A d3/d1/a
247 d1/a
247 d1/a
248 A d3/d1/b
248 A d3/d1/b
249 d1/b
249 d1/b
250 A d3/d1/ba
250 A d3/d1/ba
251 d1/ba
251 d1/ba
252 A d3/d1/d11/a1
252 A d3/d1/d11/a1
253 d1/d11/a1
253 d1/d11/a1
254 A d3/d2/b
254 A d3/d2/b
255 d2/b
255 d2/b
256 R d1/a
256 R d1/a
257 R d1/b
257 R d1/b
258 R d1/ba
258 R d1/ba
259 R d1/d11/a1
259 R d1/d11/a1
260 R d2/b
260 R d2/b
261 $ hg update -C
261 $ hg update -C
262 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 $ rm -rf d3
263 $ rm -rf d3
264
264
265 move everything under directory d1 to existing directory d2, do not
265 move everything under directory d1 to existing directory d2, do not
266 overwrite existing files (d2/b)
266 overwrite existing files (d2/b)
267
267
268 $ hg rename d1/* d2
268 $ hg rename d1/* d2
269 d2/b: not overwriting - file exists
269 d2/b: not overwriting - file exists
270 moving d1/d11/a1 to d2/d11/a1
270 moving d1/d11/a1 to d2/d11/a1 (glob)
271 $ hg status -C
271 $ hg status -C
272 A d2/a
272 A d2/a
273 d1/a
273 d1/a
274 A d2/ba
274 A d2/ba
275 d1/ba
275 d1/ba
276 A d2/d11/a1
276 A d2/d11/a1
277 d1/d11/a1
277 d1/d11/a1
278 R d1/a
278 R d1/a
279 R d1/ba
279 R d1/ba
280 R d1/d11/a1
280 R d1/d11/a1
281 $ diff -u d1/b d2/b
281 $ diff -u d1/b d2/b
282 --- d1/b * (glob)
282 --- d1/b * (glob)
283 +++ d2/b * (glob)
283 +++ d2/b * (glob)
284 @@ * (glob)
284 @@ * (glob)
285 -d1/b
285 -d1/b
286 +d2/b
286 +d2/b
287 [1]
287 [1]
288 $ hg update -C
288 $ hg update -C
289 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
289 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 $ rm d2/a d2/ba d2/d11/a1
290 $ rm d2/a d2/ba d2/d11/a1
291
291
292 attempt to move one file into a non-existent directory
292 attempt to move one file into a non-existent directory
293
293
294 $ hg rename d1/a dx/
294 $ hg rename d1/a dx/
295 abort: destination dx/ is not a directory
295 abort: destination dx/ is not a directory
296 [255]
296 [255]
297 $ hg status -C
297 $ hg status -C
298 $ hg update -C
298 $ hg update -C
299 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
299 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
300
300
301 attempt to move potentially more than one file into a non-existent directory
301 attempt to move potentially more than one file into a non-existent directory
302
302
303 $ hg rename 'glob:d1/**' dx
303 $ hg rename 'glob:d1/**' dx
304 abort: with multiple sources, destination must be an existing directory
304 abort: with multiple sources, destination must be an existing directory
305 [255]
305 [255]
306
306
307 move every file under d1 to d2/d21 (glob)
307 move every file under d1 to d2/d21 (glob)
308
308
309 $ mkdir d2/d21
309 $ mkdir d2/d21
310 $ hg rename 'glob:d1/**' d2/d21
310 $ hg rename 'glob:d1/**' d2/d21
311 moving d1/a to d2/d21/a
311 moving d1/a to d2/d21/a (glob)
312 moving d1/b to d2/d21/b
312 moving d1/b to d2/d21/b (glob)
313 moving d1/ba to d2/d21/ba
313 moving d1/ba to d2/d21/ba (glob)
314 moving d1/d11/a1 to d2/d21/a1
314 moving d1/d11/a1 to d2/d21/a1 (glob)
315 $ hg status -C
315 $ hg status -C
316 A d2/d21/a
316 A d2/d21/a
317 d1/a
317 d1/a
318 A d2/d21/a1
318 A d2/d21/a1
319 d1/d11/a1
319 d1/d11/a1
320 A d2/d21/b
320 A d2/d21/b
321 d1/b
321 d1/b
322 A d2/d21/ba
322 A d2/d21/ba
323 d1/ba
323 d1/ba
324 R d1/a
324 R d1/a
325 R d1/b
325 R d1/b
326 R d1/ba
326 R d1/ba
327 R d1/d11/a1
327 R d1/d11/a1
328 $ hg update -C
328 $ hg update -C
329 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
329 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 $ rm -rf d2/d21
330 $ rm -rf d2/d21
331
331
332 move --after some files under d1 to d2/d21 (glob)
332 move --after some files under d1 to d2/d21 (glob)
333
333
334 $ mkdir d2/d21
334 $ mkdir d2/d21
335 $ mv d1/a d1/d11/a1 d2/d21
335 $ mv d1/a d1/d11/a1 d2/d21
336 $ hg rename --after 'glob:d1/**' d2/d21
336 $ hg rename --after 'glob:d1/**' d2/d21
337 moving d1/a to d2/d21/a
337 moving d1/a to d2/d21/a (glob)
338 d1/b: not recording move - d2/d21/b does not exist
338 d1/b: not recording move - d2/d21/b does not exist (glob)
339 d1/ba: not recording move - d2/d21/ba does not exist
339 d1/ba: not recording move - d2/d21/ba does not exist (glob)
340 moving d1/d11/a1 to d2/d21/a1
340 moving d1/d11/a1 to d2/d21/a1 (glob)
341 $ hg status -C
341 $ hg status -C
342 A d2/d21/a
342 A d2/d21/a
343 d1/a
343 d1/a
344 A d2/d21/a1
344 A d2/d21/a1
345 d1/d11/a1
345 d1/d11/a1
346 R d1/a
346 R d1/a
347 R d1/d11/a1
347 R d1/d11/a1
348 $ hg update -C
348 $ hg update -C
349 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
350 $ rm -rf d2/d21
350 $ rm -rf d2/d21
351
351
352 move every file under d1 starting with an 'a' to d2/d21 (regexp)
352 move every file under d1 starting with an 'a' to d2/d21 (regexp)
353
353
354 $ mkdir d2/d21
354 $ mkdir d2/d21
355 $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21
355 $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21
356 moving d1/a to d2/d21/a
356 moving d1/a to d2/d21/a (glob)
357 moving d1/d11/a1 to d2/d21/a1
357 moving d1/d11/a1 to d2/d21/a1 (glob)
358 $ hg status -C
358 $ hg status -C
359 A d2/d21/a
359 A d2/d21/a
360 d1/a
360 d1/a
361 A d2/d21/a1
361 A d2/d21/a1
362 d1/d11/a1
362 d1/d11/a1
363 R d1/a
363 R d1/a
364 R d1/d11/a1
364 R d1/d11/a1
365 $ hg update -C
365 $ hg update -C
366 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 $ rm -rf d2/d21
367 $ rm -rf d2/d21
368
368
369 attempt to overwrite an existing file
369 attempt to overwrite an existing file
370
370
371 $ echo "ca" > d1/ca
371 $ echo "ca" > d1/ca
372 $ hg rename d1/ba d1/ca
372 $ hg rename d1/ba d1/ca
373 d1/ca: not overwriting - file exists
373 d1/ca: not overwriting - file exists
374 $ hg status -C
374 $ hg status -C
375 ? d1/ca
375 ? d1/ca
376 $ hg update -C
376 $ hg update -C
377 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
378
378
379 forced overwrite of an existing file
379 forced overwrite of an existing file
380
380
381 $ echo "ca" > d1/ca
381 $ echo "ca" > d1/ca
382 $ hg rename --force d1/ba d1/ca
382 $ hg rename --force d1/ba d1/ca
383 $ hg status -C
383 $ hg status -C
384 A d1/ca
384 A d1/ca
385 d1/ba
385 d1/ba
386 R d1/ba
386 R d1/ba
387 $ hg update -C
387 $ hg update -C
388 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
388 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 $ rm d1/ca
389 $ rm d1/ca
390
390
391 attempt to overwrite an existing broken symlink
391 attempt to overwrite an existing broken symlink
392
392
393 $ ln -s ba d1/ca
393 $ ln -s ba d1/ca
394 $ hg rename --traceback d1/ba d1/ca
394 $ hg rename --traceback d1/ba d1/ca
395 d1/ca: not overwriting - file exists
395 d1/ca: not overwriting - file exists
396 $ hg status -C
396 $ hg status -C
397 ? d1/ca
397 ? d1/ca
398 $ hg update -C
398 $ hg update -C
399 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
399 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
400 $ rm d1/ca
400 $ rm d1/ca
401
401
402 replace a symlink with a file
402 replace a symlink with a file
403
403
404 $ ln -s ba d1/ca
404 $ ln -s ba d1/ca
405 $ hg rename --force d1/ba d1/ca
405 $ hg rename --force d1/ba d1/ca
406 $ hg status -C
406 $ hg status -C
407 A d1/ca
407 A d1/ca
408 d1/ba
408 d1/ba
409 R d1/ba
409 R d1/ba
410 $ hg update -C
410 $ hg update -C
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 $ rm d1/ca
412 $ rm d1/ca
413
413
414 do not copy more than one source file to the same destination file
414 do not copy more than one source file to the same destination file
415
415
416 $ mkdir d3
416 $ mkdir d3
417 $ hg rename d1/* d2/* d3
417 $ hg rename d1/* d2/* d3
418 moving d1/d11/a1 to d3/d11/a1
418 moving d1/d11/a1 to d3/d11/a1 (glob)
419 d3/b: not overwriting - d2/b collides with d1/b
419 d3/b: not overwriting - d2/b collides with d1/b
420 $ hg status -C
420 $ hg status -C
421 A d3/a
421 A d3/a
422 d1/a
422 d1/a
423 A d3/b
423 A d3/b
424 d1/b
424 d1/b
425 A d3/ba
425 A d3/ba
426 d1/ba
426 d1/ba
427 A d3/d11/a1
427 A d3/d11/a1
428 d1/d11/a1
428 d1/d11/a1
429 R d1/a
429 R d1/a
430 R d1/b
430 R d1/b
431 R d1/ba
431 R d1/ba
432 R d1/d11/a1
432 R d1/d11/a1
433 $ hg update -C
433 $ hg update -C
434 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
434 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
435 $ rm -rf d3
435 $ rm -rf d3
436
436
437 move a whole subtree with "hg rename ."
437 move a whole subtree with "hg rename ."
438
438
439 $ mkdir d3
439 $ mkdir d3
440 $ (cd d1; hg rename . ../d3)
440 $ (cd d1; hg rename . ../d3)
441 moving a to ../d3/d1/a
441 moving a to ../d3/d1/a
442 moving b to ../d3/d1/b
442 moving b to ../d3/d1/b
443 moving ba to ../d3/d1/ba
443 moving ba to ../d3/d1/ba
444 moving d11/a1 to ../d3/d1/d11/a1
444 moving d11/a1 to ../d3/d1/d11/a1 (glob)
445 $ hg status -C
445 $ hg status -C
446 A d3/d1/a
446 A d3/d1/a
447 d1/a
447 d1/a
448 A d3/d1/b
448 A d3/d1/b
449 d1/b
449 d1/b
450 A d3/d1/ba
450 A d3/d1/ba
451 d1/ba
451 d1/ba
452 A d3/d1/d11/a1
452 A d3/d1/d11/a1
453 d1/d11/a1
453 d1/d11/a1
454 R d1/a
454 R d1/a
455 R d1/b
455 R d1/b
456 R d1/ba
456 R d1/ba
457 R d1/d11/a1
457 R d1/d11/a1
458 $ hg update -C
458 $ hg update -C
459 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
459 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 $ rm -rf d3
460 $ rm -rf d3
461
461
462 move a whole subtree with "hg rename --after ."
462 move a whole subtree with "hg rename --after ."
463
463
464 $ mkdir d3
464 $ mkdir d3
465 $ mv d1/* d3
465 $ mv d1/* d3
466 $ (cd d1; hg rename --after . ../d3)
466 $ (cd d1; hg rename --after . ../d3)
467 moving a to ../d3/a
467 moving a to ../d3/a
468 moving b to ../d3/b
468 moving b to ../d3/b
469 moving ba to ../d3/ba
469 moving ba to ../d3/ba
470 moving d11/a1 to ../d3/d11/a1
470 moving d11/a1 to ../d3/d11/a1 (glob)
471 $ hg status -C
471 $ hg status -C
472 A d3/a
472 A d3/a
473 d1/a
473 d1/a
474 A d3/b
474 A d3/b
475 d1/b
475 d1/b
476 A d3/ba
476 A d3/ba
477 d1/ba
477 d1/ba
478 A d3/d11/a1
478 A d3/d11/a1
479 d1/d11/a1
479 d1/d11/a1
480 R d1/a
480 R d1/a
481 R d1/b
481 R d1/b
482 R d1/ba
482 R d1/ba
483 R d1/d11/a1
483 R d1/d11/a1
484 $ hg update -C
484 $ hg update -C
485 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 $ rm -rf d3
486 $ rm -rf d3
487
487
488 move the parent tree with "hg rename .."
488 move the parent tree with "hg rename .."
489
489
490 $ (cd d1/d11; hg rename .. ../../d3)
490 $ (cd d1/d11; hg rename .. ../../d3)
491 moving ../a to ../../d3/a
491 moving ../a to ../../d3/a (glob)
492 moving ../b to ../../d3/b
492 moving ../b to ../../d3/b (glob)
493 moving ../ba to ../../d3/ba
493 moving ../ba to ../../d3/ba (glob)
494 moving a1 to ../../d3/d11/a1
494 moving a1 to ../../d3/d11/a1
495 $ hg status -C
495 $ hg status -C
496 A d3/a
496 A d3/a
497 d1/a
497 d1/a
498 A d3/b
498 A d3/b
499 d1/b
499 d1/b
500 A d3/ba
500 A d3/ba
501 d1/ba
501 d1/ba
502 A d3/d11/a1
502 A d3/d11/a1
503 d1/d11/a1
503 d1/d11/a1
504 R d1/a
504 R d1/a
505 R d1/b
505 R d1/b
506 R d1/ba
506 R d1/ba
507 R d1/d11/a1
507 R d1/d11/a1
508 $ hg update -C
508 $ hg update -C
509 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
509 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
510 $ rm -rf d3
510 $ rm -rf d3
511
511
512 skip removed files
512 skip removed files
513
513
514 $ hg remove d1/b
514 $ hg remove d1/b
515 $ hg rename d1 d3
515 $ hg rename d1 d3
516 moving d1/a to d3/a
516 moving d1/a to d3/a (glob)
517 moving d1/ba to d3/ba
517 moving d1/ba to d3/ba (glob)
518 moving d1/d11/a1 to d3/d11/a1
518 moving d1/d11/a1 to d3/d11/a1 (glob)
519 $ hg status -C
519 $ hg status -C
520 A d3/a
520 A d3/a
521 d1/a
521 d1/a
522 A d3/ba
522 A d3/ba
523 d1/ba
523 d1/ba
524 A d3/d11/a1
524 A d3/d11/a1
525 d1/d11/a1
525 d1/d11/a1
526 R d1/a
526 R d1/a
527 R d1/b
527 R d1/b
528 R d1/ba
528 R d1/ba
529 R d1/d11/a1
529 R d1/d11/a1
530 $ hg update -C
530 $ hg update -C
531 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
531 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
532 $ rm -rf d3
532 $ rm -rf d3
533
533
534 transitive rename
534 transitive rename
535
535
536 $ hg rename d1/b d1/bb
536 $ hg rename d1/b d1/bb
537 $ hg rename d1/bb d1/bc
537 $ hg rename d1/bb d1/bc
538 $ hg status -C
538 $ hg status -C
539 A d1/bc
539 A d1/bc
540 d1/b
540 d1/b
541 R d1/b
541 R d1/b
542 $ hg update -C
542 $ hg update -C
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
543 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
544 $ rm d1/bc
544 $ rm d1/bc
545
545
546 transitive rename --after
546 transitive rename --after
547
547
548 $ hg rename d1/b d1/bb
548 $ hg rename d1/b d1/bb
549 $ mv d1/bb d1/bc
549 $ mv d1/bb d1/bc
550 $ hg rename --after d1/bb d1/bc
550 $ hg rename --after d1/bb d1/bc
551 $ hg status -C
551 $ hg status -C
552 A d1/bc
552 A d1/bc
553 d1/b
553 d1/b
554 R d1/b
554 R d1/b
555 $ hg update -C
555 $ hg update -C
556 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
556 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 $ rm d1/bc
557 $ rm d1/bc
558
558
559 $ echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)"
559 $ echo "# idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)"
560 # idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)
560 # idempotent renames (d1/b -> d1/bb followed by d1/bb -> d1/b)
561 $ hg rename d1/b d1/bb
561 $ hg rename d1/b d1/bb
562 $ echo "some stuff added to d1/bb" >> d1/bb
562 $ echo "some stuff added to d1/bb" >> d1/bb
563 $ hg rename d1/bb d1/b
563 $ hg rename d1/bb d1/b
564 $ hg status -C
564 $ hg status -C
565 M d1/b
565 M d1/b
566 $ hg update -C
566 $ hg update -C
567 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
567 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
568
568
569 overwriting with renames (issue1959)
569 overwriting with renames (issue1959)
570
570
571 $ hg rename d1/a d1/c
571 $ hg rename d1/a d1/c
572 $ hg rename d1/b d1/a
572 $ hg rename d1/b d1/a
573 $ hg status -C
573 $ hg status -C
574 A d1/a
574 A d1/a
575 d1/b
575 d1/b
576 A d1/c
576 A d1/c
577 d1/a
577 d1/a
578 R d1/b
578 R d1/b
579 $ hg diff --git
579 $ hg diff --git
580 diff --git a/d1/b b/d1/a
580 diff --git a/d1/b b/d1/a
581 rename from d1/b
581 rename from d1/b
582 rename to d1/a
582 rename to d1/a
583 diff --git a/d1/a b/d1/c
583 diff --git a/d1/a b/d1/c
584 copy from d1/a
584 copy from d1/a
585 copy to d1/c
585 copy to d1/c
586 $ hg update -C
586 $ hg update -C
587 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
587 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
588
588
589 check illegal path components
589 check illegal path components
590
590
591 $ hg rename d1/d11/a1 .hg/foo
591 $ hg rename d1/d11/a1 .hg/foo
592 abort: path contains illegal component: .hg/foo
592 abort: path contains illegal component: .hg/foo (glob)
593 [255]
593 [255]
594 $ hg status -C
594 $ hg status -C
595 $ hg rename d1/d11/a1 ../foo
595 $ hg rename d1/d11/a1 ../foo
596 abort: ../foo not under root
596 abort: ../foo not under root
597 [255]
597 [255]
598 $ hg status -C
598 $ hg status -C
599
599
600 $ mv d1/d11/a1 .hg/foo
600 $ mv d1/d11/a1 .hg/foo
601 $ hg rename --after d1/d11/a1 .hg/foo
601 $ hg rename --after d1/d11/a1 .hg/foo
602 abort: path contains illegal component: .hg/foo
602 abort: path contains illegal component: .hg/foo (glob)
603 [255]
603 [255]
604 $ hg status -C
604 $ hg status -C
605 ! d1/d11/a1
605 ! d1/d11/a1
606 $ hg update -C
606 $ hg update -C
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 $ rm .hg/foo
608 $ rm .hg/foo
609
609
610 $ hg rename d1/d11/a1 .hg
610 $ hg rename d1/d11/a1 .hg
611 abort: path contains illegal component: .hg/a1
611 abort: path contains illegal component: .hg/a1 (glob)
612 [255]
612 [255]
613 $ hg status -C
613 $ hg status -C
614 $ hg rename d1/d11/a1 ..
614 $ hg rename d1/d11/a1 ..
615 abort: ../a1 not under root
615 abort: ../a1 not under root (glob)
616 [255]
616 [255]
617 $ hg status -C
617 $ hg status -C
618
618
619 $ mv d1/d11/a1 .hg
619 $ mv d1/d11/a1 .hg
620 $ hg rename --after d1/d11/a1 .hg
620 $ hg rename --after d1/d11/a1 .hg
621 abort: path contains illegal component: .hg/a1
621 abort: path contains illegal component: .hg/a1 (glob)
622 [255]
622 [255]
623 $ hg status -C
623 $ hg status -C
624 ! d1/d11/a1
624 ! d1/d11/a1
625 $ hg update -C
625 $ hg update -C
626 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
626 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 $ rm .hg/a1
627 $ rm .hg/a1
628
628
629 $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo)
629 $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo)
630 abort: path contains illegal component: .hg/foo
630 abort: path contains illegal component: .hg/foo (glob)
631 [255]
631 [255]
632 $ hg status -C
632 $ hg status -C
633 $ (cd d1/d11; hg rename ../../d2/b ../../../foo)
633 $ (cd d1/d11; hg rename ../../d2/b ../../../foo)
634 abort: ../../../foo not under root
634 abort: ../../../foo not under root
635 [255]
635 [255]
636 $ hg status -C
636 $ hg status -C
637
637
@@ -1,276 +1,276 b''
1 $ "$TESTDIR/hghave" execbit || exit 80
1 $ "$TESTDIR/hghave" execbit || exit 80
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5 $ echo 123 > a
5 $ echo 123 > a
6 $ echo 123 > c
6 $ echo 123 > c
7 $ echo 123 > e
7 $ echo 123 > e
8 $ hg add a c e
8 $ hg add a c e
9 $ hg commit -m "first" a c e
9 $ hg commit -m "first" a c e
10
10
11 nothing changed
11 nothing changed
12
12
13 $ hg revert
13 $ hg revert
14 abort: no files or directories specified
14 abort: no files or directories specified
15 (use --all to revert all files)
15 (use --all to revert all files)
16 [255]
16 [255]
17 $ hg revert --all
17 $ hg revert --all
18
18
19 $ echo 123 > b
19 $ echo 123 > b
20
20
21 should show b unknown
21 should show b unknown
22
22
23 $ hg status
23 $ hg status
24 ? b
24 ? b
25 $ echo 12 > c
25 $ echo 12 > c
26
26
27 should show b unknown and c modified
27 should show b unknown and c modified
28
28
29 $ hg status
29 $ hg status
30 M c
30 M c
31 ? b
31 ? b
32 $ hg add b
32 $ hg add b
33
33
34 should show b added and c modified
34 should show b added and c modified
35
35
36 $ hg status
36 $ hg status
37 M c
37 M c
38 A b
38 A b
39 $ hg rm a
39 $ hg rm a
40
40
41 should show a removed, b added and c modified
41 should show a removed, b added and c modified
42
42
43 $ hg status
43 $ hg status
44 M c
44 M c
45 A b
45 A b
46 R a
46 R a
47 $ hg revert a
47 $ hg revert a
48
48
49 should show b added, copy saved, and c modified
49 should show b added, copy saved, and c modified
50
50
51 $ hg status
51 $ hg status
52 M c
52 M c
53 A b
53 A b
54 $ hg revert b
54 $ hg revert b
55
55
56 should show b unknown, and c modified
56 should show b unknown, and c modified
57
57
58 $ hg status
58 $ hg status
59 M c
59 M c
60 ? b
60 ? b
61 $ hg revert --no-backup c
61 $ hg revert --no-backup c
62
62
63 should show unknown: b
63 should show unknown: b
64
64
65 $ hg status
65 $ hg status
66 ? b
66 ? b
67 $ hg add b
67 $ hg add b
68
68
69 should show b added
69 should show b added
70
70
71 $ hg status b
71 $ hg status b
72 A b
72 A b
73 $ rm b
73 $ rm b
74
74
75 should show b deleted
75 should show b deleted
76
76
77 $ hg status b
77 $ hg status b
78 ! b
78 ! b
79 $ hg revert -v b
79 $ hg revert -v b
80 forgetting b
80 forgetting b
81
81
82 should not find b
82 should not find b
83
83
84 $ hg status b
84 $ hg status b
85 b: No such file or directory
85 b: No such file or directory
86
86
87 should show a c e
87 should show a c e
88
88
89 $ ls
89 $ ls
90 a
90 a
91 c
91 c
92 e
92 e
93
93
94 should verbosely save backup to e.orig
94 should verbosely save backup to e.orig
95
95
96 $ echo z > e
96 $ echo z > e
97 $ hg revert --all -v
97 $ hg revert --all -v
98 saving current version of e as e.orig
98 saving current version of e as e.orig
99 reverting e
99 reverting e
100
100
101 should say no changes needed
101 should say no changes needed
102
102
103 $ hg revert a
103 $ hg revert a
104 no changes needed to a
104 no changes needed to a
105
105
106 should say file not managed
106 should say file not managed
107
107
108 $ echo q > q
108 $ echo q > q
109 $ hg revert q
109 $ hg revert q
110 file not managed: q
110 file not managed: q
111 $ rm q
111 $ rm q
112
112
113 should say file not found
113 should say file not found
114
114
115 $ hg revert notfound
115 $ hg revert notfound
116 notfound: no such file in rev 334a9e57682c
116 notfound: no such file in rev 334a9e57682c
117 $ touch d
117 $ touch d
118 $ hg add d
118 $ hg add d
119 $ hg rm a
119 $ hg rm a
120 $ hg commit -m "second"
120 $ hg commit -m "second"
121 $ echo z > z
121 $ echo z > z
122 $ hg add z
122 $ hg add z
123 $ hg st
123 $ hg st
124 A z
124 A z
125 ? e.orig
125 ? e.orig
126
126
127 should add a, remove d, forget z
127 should add a, remove d, forget z
128
128
129 $ hg revert --all -r0
129 $ hg revert --all -r0
130 adding a
130 adding a
131 removing d
131 removing d
132 forgetting z
132 forgetting z
133
133
134 should forget a, undelete d
134 should forget a, undelete d
135
135
136 $ hg revert --all -rtip
136 $ hg revert --all -rtip
137 forgetting a
137 forgetting a
138 undeleting d
138 undeleting d
139 $ rm a *.orig
139 $ rm a *.orig
140
140
141 should silently add a
141 should silently add a
142
142
143 $ hg revert -r0 a
143 $ hg revert -r0 a
144 $ hg st a
144 $ hg st a
145 A a
145 A a
146 $ hg rm d
146 $ hg rm d
147 $ hg st d
147 $ hg st d
148 R d
148 R d
149
149
150 should silently keep d removed
150 should silently keep d removed
151
151
152 $ hg revert -r0 d
152 $ hg revert -r0 d
153 $ hg st d
153 $ hg st d
154 R d
154 R d
155
155
156 $ hg update -C
156 $ hg update -C
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ chmod +x c
158 $ chmod +x c
159 $ hg revert --all
159 $ hg revert --all
160 reverting c
160 reverting c
161
161
162 should print non-executable
162 should print non-executable
163
163
164 $ test -x c || echo non-executable
164 $ test -x c || echo non-executable
165 non-executable
165 non-executable
166
166
167 $ chmod +x c
167 $ chmod +x c
168 $ hg commit -m exe
168 $ hg commit -m exe
169
169
170 $ chmod -x c
170 $ chmod -x c
171 $ hg revert --all
171 $ hg revert --all
172 reverting c
172 reverting c
173
173
174 should print executable
174 should print executable
175
175
176 $ test -x c && echo executable
176 $ test -x c && echo executable
177 executable
177 executable
178
178
179 $ cd ..
179 $ cd ..
180
180
181
181
182 Issue241: update and revert produces inconsistent repositories
182 Issue241: update and revert produces inconsistent repositories
183
183
184 $ hg init a
184 $ hg init a
185 $ cd a
185 $ cd a
186 $ echo a >> a
186 $ echo a >> a
187 $ hg commit -A -d '1 0' -m a
187 $ hg commit -A -d '1 0' -m a
188 adding a
188 adding a
189 $ echo a >> a
189 $ echo a >> a
190 $ hg commit -d '2 0' -m a
190 $ hg commit -d '2 0' -m a
191 $ hg update 0
191 $ hg update 0
192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 $ mkdir b
193 $ mkdir b
194 $ echo b > b/b
194 $ echo b > b/b
195
195
196 should fail - no arguments
196 should fail - no arguments
197
197
198 $ hg revert -rtip
198 $ hg revert -rtip
199 abort: no files or directories specified
199 abort: no files or directories specified
200 (use --all to revert all files, or 'hg update 1' to update)
200 (use --all to revert all files, or 'hg update 1' to update)
201 [255]
201 [255]
202
202
203 should succeed
203 should succeed
204
204
205 $ hg revert --all -rtip
205 $ hg revert --all -rtip
206 reverting a
206 reverting a
207
207
208
208
209 Issue332: confusing message when reverting directory
209 Issue332: confusing message when reverting directory
210
210
211 $ hg ci -A -m b
211 $ hg ci -A -m b
212 adding b/b
212 adding b/b
213 created new head
213 created new head
214 $ echo foobar > b/b
214 $ echo foobar > b/b
215 $ mkdir newdir
215 $ mkdir newdir
216 $ echo foo > newdir/newfile
216 $ echo foo > newdir/newfile
217 $ hg add newdir/newfile
217 $ hg add newdir/newfile
218 $ hg revert b newdir
218 $ hg revert b newdir
219 reverting b/b
219 reverting b/b (glob)
220 forgetting newdir/newfile
220 forgetting newdir/newfile (glob)
221 $ echo foobar > b/b
221 $ echo foobar > b/b
222 $ hg revert .
222 $ hg revert .
223 reverting b/b
223 reverting b/b (glob)
224
224
225
225
226 reverting a rename target should revert the source
226 reverting a rename target should revert the source
227
227
228 $ hg mv a newa
228 $ hg mv a newa
229 $ hg revert newa
229 $ hg revert newa
230 $ hg st a newa
230 $ hg st a newa
231 ? newa
231 ? newa
232
232
233 $ cd ..
233 $ cd ..
234
234
235 $ hg init ignored
235 $ hg init ignored
236 $ cd ignored
236 $ cd ignored
237 $ echo '^ignored$' > .hgignore
237 $ echo '^ignored$' > .hgignore
238 $ echo '^ignoreddir$' >> .hgignore
238 $ echo '^ignoreddir$' >> .hgignore
239 $ echo '^removed$' >> .hgignore
239 $ echo '^removed$' >> .hgignore
240
240
241 $ mkdir ignoreddir
241 $ mkdir ignoreddir
242 $ touch ignoreddir/file
242 $ touch ignoreddir/file
243 $ touch ignoreddir/removed
243 $ touch ignoreddir/removed
244 $ touch ignored
244 $ touch ignored
245 $ touch removed
245 $ touch removed
246
246
247 4 ignored files (we will add/commit everything)
247 4 ignored files (we will add/commit everything)
248
248
249 $ hg st -A -X .hgignore
249 $ hg st -A -X .hgignore
250 I ignored
250 I ignored
251 I ignoreddir/file
251 I ignoreddir/file
252 I ignoreddir/removed
252 I ignoreddir/removed
253 I removed
253 I removed
254 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
254 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
255
255
256 $ echo >> ignored
256 $ echo >> ignored
257 $ echo >> ignoreddir/file
257 $ echo >> ignoreddir/file
258 $ hg rm removed ignoreddir/removed
258 $ hg rm removed ignoreddir/removed
259
259
260 should revert ignored* and undelete *removed
260 should revert ignored* and undelete *removed
261
261
262 $ hg revert -a --no-backup
262 $ hg revert -a --no-backup
263 reverting ignored
263 reverting ignored
264 reverting ignoreddir/file
264 reverting ignoreddir/file (glob)
265 undeleting ignoreddir/removed
265 undeleting ignoreddir/removed (glob)
266 undeleting removed
266 undeleting removed
267 $ hg st -mardi
267 $ hg st -mardi
268
268
269 $ hg up -qC
269 $ hg up -qC
270 $ echo >> ignored
270 $ echo >> ignored
271 $ hg rm removed
271 $ hg rm removed
272
272
273 should silently revert the named files
273 should silently revert the named files
274
274
275 $ hg revert --no-backup ignored removed
275 $ hg revert --no-backup ignored removed
276 $ hg st -mardi
276 $ hg st -mardi
@@ -1,92 +1,92 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 >
4 >
5 > [alias]
5 > [alias]
6 > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n"
6 > tlog = log --template "{rev}:{node|short}: '{desc}' {branches}\n"
7 > tglog = tlog -G
7 > tglog = tlog -G
8 > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n"
8 > tout = out --template "{rev}:{node|short}: '{desc}' {branches}\n"
9 > EOF
9 > EOF
10
10
11 $ hg init a
11 $ hg init a
12 $ cd a
12 $ cd a
13
13
14 $ echo a > a
14 $ echo a > a
15 $ hg ci -Aqm0
15 $ hg ci -Aqm0
16
16
17 $ echo foo >> a
17 $ echo foo >> a
18 $ hg ci -Aqm1
18 $ hg ci -Aqm1
19
19
20 $ hg up -q 0
20 $ hg up -q 0
21
21
22 $ hg branch stable
22 $ hg branch stable
23 marked working directory as branch stable
23 marked working directory as branch stable
24 $ echo bar >> a
24 $ echo bar >> a
25 $ hg ci -qm2
25 $ hg ci -qm2
26
26
27 $ hg tglog
27 $ hg tglog
28 @ 2:7bee6c3bea3a: '2' stable
28 @ 2:7bee6c3bea3a: '2' stable
29 |
29 |
30 | o 1:3560197d8331: '1'
30 | o 1:3560197d8331: '1'
31 |/
31 |/
32 o 0:f7b1eb17ad24: '0'
32 o 0:f7b1eb17ad24: '0'
33
33
34
34
35 $ cd ..
35 $ cd ..
36
36
37 $ hg clone -q a#stable b
37 $ hg clone -q a#stable b
38
38
39 $ cd b
39 $ cd b
40 $ cat .hg/hgrc
40 $ cat .hg/hgrc
41 [paths]
41 [paths]
42 default = $TESTTMP/a#stable
42 default = $TESTTMP/a#stable (glob)
43
43
44 $ echo red >> a
44 $ echo red >> a
45 $ hg ci -qm3
45 $ hg ci -qm3
46
46
47 $ hg up -q default
47 $ hg up -q default
48
48
49 $ echo blue >> a
49 $ echo blue >> a
50 $ hg ci -qm4
50 $ hg ci -qm4
51
51
52 $ hg tglog
52 $ hg tglog
53 @ 3:f0461977a3db: '4'
53 @ 3:f0461977a3db: '4'
54 |
54 |
55 | o 2:1d4099801a4e: '3' stable
55 | o 2:1d4099801a4e: '3' stable
56 | |
56 | |
57 | o 1:7bee6c3bea3a: '2' stable
57 | o 1:7bee6c3bea3a: '2' stable
58 |/
58 |/
59 o 0:f7b1eb17ad24: '0'
59 o 0:f7b1eb17ad24: '0'
60
60
61
61
62 $ hg tout
62 $ hg tout
63 comparing with $TESTTMP/a
63 comparing with $TESTTMP/a (glob)
64 searching for changes
64 searching for changes
65 2:1d4099801a4e: '3' stable
65 2:1d4099801a4e: '3' stable
66
66
67 $ hg tlog -r 'outgoing()'
67 $ hg tlog -r 'outgoing()'
68 2:1d4099801a4e: '3' stable
68 2:1d4099801a4e: '3' stable
69
69
70 $ hg tout ../a#default
70 $ hg tout ../a#default
71 comparing with ../a
71 comparing with ../a
72 searching for changes
72 searching for changes
73 3:f0461977a3db: '4'
73 3:f0461977a3db: '4'
74
74
75 $ hg tlog -r 'outgoing("../a#default")'
75 $ hg tlog -r 'outgoing("../a#default")'
76 3:f0461977a3db: '4'
76 3:f0461977a3db: '4'
77
77
78 $ echo "green = ../a#default" >> .hg/hgrc
78 $ echo "green = ../a#default" >> .hg/hgrc
79
79
80 $ cat .hg/hgrc
80 $ cat .hg/hgrc
81 [paths]
81 [paths]
82 default = $TESTTMP/a#stable
82 default = $TESTTMP/a#stable (glob)
83 green = ../a#default
83 green = ../a#default
84
84
85 $ hg tout green
85 $ hg tout green
86 comparing with $TESTTMP/a
86 comparing with $TESTTMP/a (glob)
87 searching for changes
87 searching for changes
88 3:f0461977a3db: '4'
88 3:f0461977a3db: '4'
89
89
90 $ hg tlog -r 'outgoing("green")'
90 $ hg tlog -r 'outgoing("green")'
91 3:f0461977a3db: '4'
91 3:f0461977a3db: '4'
92
92
@@ -1,127 +1,127 b''
1 $ "$TESTDIR/hghave" serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "share = " >> $HGRCPATH
4 $ echo "share = " >> $HGRCPATH
5
5
6 prepare repo1
6 prepare repo1
7
7
8 $ hg init repo1
8 $ hg init repo1
9 $ cd repo1
9 $ cd repo1
10 $ echo a > a
10 $ echo a > a
11 $ hg commit -A -m'init'
11 $ hg commit -A -m'init'
12 adding a
12 adding a
13
13
14 share it
14 share it
15
15
16 $ cd ..
16 $ cd ..
17 $ hg share repo1 repo2
17 $ hg share repo1 repo2
18 updating working directory
18 updating working directory
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20
20
21 share shouldn't have a store dir
21 share shouldn't have a store dir
22
22
23 $ cd repo2
23 $ cd repo2
24 $ test -d .hg/store
24 $ test -d .hg/store
25 [1]
25 [1]
26
26
27 Some sed versions appends newline, some don't, and some just fails
27 Some sed versions appends newline, some don't, and some just fails
28
28
29 $ cat .hg/sharedpath; echo
29 $ cat .hg/sharedpath; echo
30 $TESTTMP/repo1/.hg
30 $TESTTMP/repo1/.hg (glob)
31
31
32 trailing newline on .hg/sharedpath is ok
32 trailing newline on .hg/sharedpath is ok
33 $ hg tip -q
33 $ hg tip -q
34 0:d3873e73d99e
34 0:d3873e73d99e
35 $ echo '' >> .hg/sharedpath
35 $ echo '' >> .hg/sharedpath
36 $ cat .hg/sharedpath
36 $ cat .hg/sharedpath
37 $TESTTMP/repo1/.hg
37 $TESTTMP/repo1/.hg (glob)
38 $ hg tip -q
38 $ hg tip -q
39 0:d3873e73d99e
39 0:d3873e73d99e
40
40
41 commit in shared clone
41 commit in shared clone
42
42
43 $ echo a >> a
43 $ echo a >> a
44 $ hg commit -m'change in shared clone'
44 $ hg commit -m'change in shared clone'
45
45
46 check original
46 check original
47
47
48 $ cd ../repo1
48 $ cd ../repo1
49 $ hg log
49 $ hg log
50 changeset: 1:8af4dc49db9e
50 changeset: 1:8af4dc49db9e
51 tag: tip
51 tag: tip
52 user: test
52 user: test
53 date: Thu Jan 01 00:00:00 1970 +0000
53 date: Thu Jan 01 00:00:00 1970 +0000
54 summary: change in shared clone
54 summary: change in shared clone
55
55
56 changeset: 0:d3873e73d99e
56 changeset: 0:d3873e73d99e
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:00 1970 +0000
58 date: Thu Jan 01 00:00:00 1970 +0000
59 summary: init
59 summary: init
60
60
61 $ hg update
61 $ hg update
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 $ cat a # should be two lines of "a"
63 $ cat a # should be two lines of "a"
64 a
64 a
65 a
65 a
66
66
67 commit in original
67 commit in original
68
68
69 $ echo b > b
69 $ echo b > b
70 $ hg commit -A -m'another file'
70 $ hg commit -A -m'another file'
71 adding b
71 adding b
72
72
73 check in shared clone
73 check in shared clone
74
74
75 $ cd ../repo2
75 $ cd ../repo2
76 $ hg log
76 $ hg log
77 changeset: 2:c2e0ac586386
77 changeset: 2:c2e0ac586386
78 tag: tip
78 tag: tip
79 user: test
79 user: test
80 date: Thu Jan 01 00:00:00 1970 +0000
80 date: Thu Jan 01 00:00:00 1970 +0000
81 summary: another file
81 summary: another file
82
82
83 changeset: 1:8af4dc49db9e
83 changeset: 1:8af4dc49db9e
84 user: test
84 user: test
85 date: Thu Jan 01 00:00:00 1970 +0000
85 date: Thu Jan 01 00:00:00 1970 +0000
86 summary: change in shared clone
86 summary: change in shared clone
87
87
88 changeset: 0:d3873e73d99e
88 changeset: 0:d3873e73d99e
89 user: test
89 user: test
90 date: Thu Jan 01 00:00:00 1970 +0000
90 date: Thu Jan 01 00:00:00 1970 +0000
91 summary: init
91 summary: init
92
92
93 $ hg update
93 $ hg update
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 $ cat b # should exist with one "b"
95 $ cat b # should exist with one "b"
96 b
96 b
97
97
98 hg serve shared clone
98 hg serve shared clone
99
99
100 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
100 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid
101 $ cat hg.pid >> $DAEMON_PIDS
101 $ cat hg.pid >> $DAEMON_PIDS
102 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-file/'
102 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-file/'
103 200 Script output follows
103 200 Script output follows
104
104
105
105
106 -rw-r--r-- 4 a
106 -rw-r--r-- 4 a
107 -rw-r--r-- 2 b
107 -rw-r--r-- 2 b
108
108
109
109
110
110
111 test unshare command
111 test unshare command
112
112
113 $ hg unshare
113 $ hg unshare
114 $ test -d .hg/store
114 $ test -d .hg/store
115 $ test -f .hg/sharedpath
115 $ test -f .hg/sharedpath
116 [1]
116 [1]
117 $ hg unshare
117 $ hg unshare
118 abort: this is not a shared repo
118 abort: this is not a shared repo
119 [255]
119 [255]
120
120
121 check that a change does not propagate
121 check that a change does not propagate
122
122
123 $ echo b >> b
123 $ echo b >> b
124 $ hg commit -m'change in unshared'
124 $ hg commit -m'change in unshared'
125 $ cd ../repo1
125 $ cd ../repo1
126 $ hg id -r tip
126 $ hg id -r tip
127 c2e0ac586386 tip
127 c2e0ac586386 tip
@@ -1,102 +1,102 b''
1 Preparing the subrepository 'sub2'
1 Preparing the subrepository 'sub2'
2
2
3 $ hg init sub2
3 $ hg init sub2
4 $ echo sub2 > sub2/sub2
4 $ echo sub2 > sub2/sub2
5 $ hg add -R sub2
5 $ hg add -R sub2
6 adding sub2/sub2
6 adding sub2/sub2 (glob)
7 $ hg commit -R sub2 -m "sub2 import"
7 $ hg commit -R sub2 -m "sub2 import"
8
8
9 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
9 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
10
10
11 $ hg init sub1
11 $ hg init sub1
12 $ echo sub1 > sub1/sub1
12 $ echo sub1 > sub1/sub1
13 $ echo "sub2 = ../sub2" > sub1/.hgsub
13 $ echo "sub2 = ../sub2" > sub1/.hgsub
14 $ hg clone sub2 sub1/sub2
14 $ hg clone sub2 sub1/sub2
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 $ hg add -R sub1
17 $ hg add -R sub1
18 adding sub1/.hgsub
18 adding sub1/.hgsub (glob)
19 adding sub1/sub1
19 adding sub1/sub1 (glob)
20 $ hg commit -R sub1 -m "sub1 import"
20 $ hg commit -R sub1 -m "sub1 import"
21 committing subrepository sub2
21 committing subrepository sub2
22
22
23 Preparing the 'main' repo which depends on the subrepo 'sub1'
23 Preparing the 'main' repo which depends on the subrepo 'sub1'
24
24
25 $ hg init main
25 $ hg init main
26 $ echo main > main/main
26 $ echo main > main/main
27 $ echo "sub1 = ../sub1" > main/.hgsub
27 $ echo "sub1 = ../sub1" > main/.hgsub
28 $ hg clone sub1 main/sub1
28 $ hg clone sub1 main/sub1
29 updating to branch default
29 updating to branch default
30 cloning subrepo sub2 from $TESTTMP/sub2
30 cloning subrepo sub2 from $TESTTMP/sub2
31 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 $ hg add -R main
32 $ hg add -R main
33 adding main/.hgsub
33 adding main/.hgsub (glob)
34 adding main/main
34 adding main/main (glob)
35 $ hg commit -R main -m "main import"
35 $ hg commit -R main -m "main import"
36 committing subrepository sub1
36 committing subrepository sub1
37
37
38 Cleaning both repositories, just as a clone -U
38 Cleaning both repositories, just as a clone -U
39
39
40 $ hg up -C -R sub2 null
40 $ hg up -C -R sub2 null
41 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
41 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
42 $ hg up -C -R sub1 null
42 $ hg up -C -R sub1 null
43 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
43 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
44 $ hg up -C -R main null
44 $ hg up -C -R main null
45 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
45 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
46 $ rm -rf main/sub1
46 $ rm -rf main/sub1
47 $ rm -rf sub1/sub2
47 $ rm -rf sub1/sub2
48
48
49 Clone main
49 Clone main
50
50
51 $ hg clone main cloned
51 $ hg clone main cloned
52 updating to branch default
52 updating to branch default
53 cloning subrepo sub1 from $TESTTMP/sub1
53 cloning subrepo sub1 from $TESTTMP/sub1
54 cloning subrepo sub1/sub2 from $TESTTMP/sub2
54 cloning subrepo sub1/sub2 from $TESTTMP/sub2 (glob)
55 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
56
56
57 Checking cloned repo ids
57 Checking cloned repo ids
58
58
59 $ printf "cloned " ; hg id -R cloned
59 $ printf "cloned " ; hg id -R cloned
60 cloned 7f491f53a367 tip
60 cloned 7f491f53a367 tip
61 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
61 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
62 cloned/sub1 fc3b4ce2696f tip
62 cloned/sub1 fc3b4ce2696f tip
63 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
63 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
64 cloned/sub1/sub2 c57a0840e3ba tip
64 cloned/sub1/sub2 c57a0840e3ba tip
65
65
66 debugsub output for main and sub1
66 debugsub output for main and sub1
67
67
68 $ hg debugsub -R cloned
68 $ hg debugsub -R cloned
69 path sub1
69 path sub1
70 source ../sub1
70 source ../sub1
71 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
71 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
72 $ hg debugsub -R cloned/sub1
72 $ hg debugsub -R cloned/sub1
73 path sub2
73 path sub2
74 source ../sub2
74 source ../sub2
75 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
75 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
76
76
77 Modifying deeply nested 'sub2'
77 Modifying deeply nested 'sub2'
78
78
79 $ echo modified > cloned/sub1/sub2/sub2
79 $ echo modified > cloned/sub1/sub2/sub2
80 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
80 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
81 committing subrepository sub1
81 committing subrepository sub1
82 committing subrepository sub1/sub2
82 committing subrepository sub1/sub2 (glob)
83
83
84 Checking modified node ids
84 Checking modified node ids
85
85
86 $ printf "cloned " ; hg id -R cloned
86 $ printf "cloned " ; hg id -R cloned
87 cloned ffe6649062fe tip
87 cloned ffe6649062fe tip
88 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
88 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
89 cloned/sub1 2ecb03bf44a9 tip
89 cloned/sub1 2ecb03bf44a9 tip
90 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
90 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
91 cloned/sub1/sub2 53dd3430bcaf tip
91 cloned/sub1/sub2 53dd3430bcaf tip
92
92
93 debugsub output for main and sub1
93 debugsub output for main and sub1
94
94
95 $ hg debugsub -R cloned
95 $ hg debugsub -R cloned
96 path sub1
96 path sub1
97 source ../sub1
97 source ../sub1
98 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
98 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
99 $ hg debugsub -R cloned/sub1
99 $ hg debugsub -R cloned/sub1
100 path sub2
100 path sub2
101 source ../sub2
101 source ../sub2
102 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
102 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
@@ -1,59 +1,59 b''
1 $ hg init outer
1 $ hg init outer
2 $ cd outer
2 $ cd outer
3
3
4 $ echo '[paths]' >> .hg/hgrc
4 $ echo '[paths]' >> .hg/hgrc
5 $ echo 'default = http://example.net/' >> .hg/hgrc
5 $ echo 'default = http://example.net/' >> .hg/hgrc
6
6
7 hg debugsub with no remapping
7 hg debugsub with no remapping
8
8
9 $ echo 'sub = libfoo' > .hgsub
9 $ echo 'sub = libfoo' > .hgsub
10 $ hg add .hgsub
10 $ hg add .hgsub
11
11
12 $ hg debugsub
12 $ hg debugsub
13 path sub
13 path sub
14 source libfoo
14 source libfoo
15 revision
15 revision
16
16
17 hg debugsub with remapping
17 hg debugsub with remapping
18
18
19 $ echo '[subpaths]' >> .hg/hgrc
19 $ echo '[subpaths]' >> .hg/hgrc
20 $ printf 'http://example.net/lib(.*) = C:\\libs\\\\1-lib\\\n' >> .hg/hgrc
20 $ printf 'http://example.net/lib(.*) = C:\\libs\\\\1-lib\\\n' >> .hg/hgrc
21
21
22 $ hg debugsub
22 $ hg debugsub
23 path sub
23 path sub
24 source C:\libs\foo-lib\
24 source C:\libs\foo-lib\
25 revision
25 revision
26
26
27 test cumulative remapping, the $HGRCPATH file is loaded first
27 test cumulative remapping, the $HGRCPATH file is loaded first
28
28
29 $ echo '[subpaths]' >> $HGRCPATH
29 $ echo '[subpaths]' >> $HGRCPATH
30 $ echo 'libfoo = libbar' >> $HGRCPATH
30 $ echo 'libfoo = libbar' >> $HGRCPATH
31 $ hg debugsub
31 $ hg debugsub
32 path sub
32 path sub
33 source C:\libs\bar-lib\
33 source C:\libs\bar-lib\
34 revision
34 revision
35
35
36 test absolute source path -- testing with a URL is important since
36 test absolute source path -- testing with a URL is important since
37 standard os.path.join wont treat that as an absolute path
37 standard os.path.join wont treat that as an absolute path
38
38
39 $ echo 'abs = http://example.net/abs' > .hgsub
39 $ echo 'abs = http://example.net/abs' > .hgsub
40 $ hg debugsub
40 $ hg debugsub
41 path abs
41 path abs
42 source http://example.net/abs
42 source http://example.net/abs
43 revision
43 revision
44
44
45 $ echo 'abs = /abs' > .hgsub
45 $ echo 'abs = /abs' > .hgsub
46 $ hg debugsub
46 $ hg debugsub
47 path abs
47 path abs
48 source /abs
48 source /abs
49 revision
49 revision
50
50
51 test bad subpaths pattern
51 test bad subpaths pattern
52
52
53 $ cat > .hg/hgrc <<EOF
53 $ cat > .hg/hgrc <<EOF
54 > [subpaths]
54 > [subpaths]
55 > .* = \1
55 > .* = \1
56 > EOF
56 > EOF
57 $ hg debugsub
57 $ hg debugsub
58 abort: bad subrepository pattern in $TESTTMP/outer/.hg/hgrc:2: invalid group reference
58 abort: bad subrepository pattern in $TESTTMP/outer/.hg/hgrc:2: invalid group reference (glob)
59 [255]
59 [255]
@@ -1,477 +1,477 b''
1 Create test repository:
1 Create test repository:
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5 $ echo x1 > x.txt
5 $ echo x1 > x.txt
6
6
7 $ hg init foo
7 $ hg init foo
8 $ cd foo
8 $ cd foo
9 $ echo y1 > y.txt
9 $ echo y1 > y.txt
10
10
11 $ hg init bar
11 $ hg init bar
12 $ cd bar
12 $ cd bar
13 $ echo z1 > z.txt
13 $ echo z1 > z.txt
14
14
15 $ cd ..
15 $ cd ..
16 $ echo 'bar = bar' > .hgsub
16 $ echo 'bar = bar' > .hgsub
17
17
18 $ cd ..
18 $ cd ..
19 $ echo 'foo = foo' > .hgsub
19 $ echo 'foo = foo' > .hgsub
20
20
21 Add files --- .hgsub files must go first to trigger subrepos:
21 Add files --- .hgsub files must go first to trigger subrepos:
22
22
23 $ hg add -S .hgsub
23 $ hg add -S .hgsub
24 $ hg add -S foo/.hgsub
24 $ hg add -S foo/.hgsub
25 $ hg add -S foo/bar
25 $ hg add -S foo/bar
26 adding foo/bar/z.txt
26 adding foo/bar/z.txt
27 $ hg add -S
27 $ hg add -S
28 adding x.txt
28 adding x.txt
29 adding foo/y.txt
29 adding foo/y.txt
30
30
31 Test recursive status without committing anything:
31 Test recursive status without committing anything:
32
32
33 $ hg status -S
33 $ hg status -S
34 A .hgsub
34 A .hgsub
35 A foo/.hgsub
35 A foo/.hgsub
36 A foo/bar/z.txt
36 A foo/bar/z.txt
37 A foo/y.txt
37 A foo/y.txt
38 A x.txt
38 A x.txt
39
39
40 Test recursive diff without committing anything:
40 Test recursive diff without committing anything:
41
41
42 $ hg diff --nodates -S foo
42 $ hg diff --nodates -S foo
43 diff -r 000000000000 foo/.hgsub
43 diff -r 000000000000 foo/.hgsub
44 --- /dev/null
44 --- /dev/null
45 +++ b/foo/.hgsub
45 +++ b/foo/.hgsub
46 @@ -0,0 +1,1 @@
46 @@ -0,0 +1,1 @@
47 +bar = bar
47 +bar = bar
48 diff -r 000000000000 foo/y.txt
48 diff -r 000000000000 foo/y.txt
49 --- /dev/null
49 --- /dev/null
50 +++ b/foo/y.txt
50 +++ b/foo/y.txt
51 @@ -0,0 +1,1 @@
51 @@ -0,0 +1,1 @@
52 +y1
52 +y1
53 diff -r 000000000000 foo/bar/z.txt
53 diff -r 000000000000 foo/bar/z.txt
54 --- /dev/null
54 --- /dev/null
55 +++ b/foo/bar/z.txt
55 +++ b/foo/bar/z.txt
56 @@ -0,0 +1,1 @@
56 @@ -0,0 +1,1 @@
57 +z1
57 +z1
58
58
59 Commits:
59 Commits:
60
60
61 $ hg commit -m fails
61 $ hg commit -m fails
62 abort: uncommitted changes in subrepo foo
62 abort: uncommitted changes in subrepo foo
63 (use --subrepos for recursive commit)
63 (use --subrepos for recursive commit)
64 [255]
64 [255]
65
65
66 The --subrepos flag overwrite the config setting:
66 The --subrepos flag overwrite the config setting:
67
67
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
69 committing subrepository foo
69 committing subrepository foo
70 committing subrepository foo/bar
70 committing subrepository foo/bar
71
71
72 $ cd foo
72 $ cd foo
73 $ echo y2 >> y.txt
73 $ echo y2 >> y.txt
74 $ hg commit -m 0-1-0
74 $ hg commit -m 0-1-0
75
75
76 $ cd bar
76 $ cd bar
77 $ echo z2 >> z.txt
77 $ echo z2 >> z.txt
78 $ hg commit -m 0-1-1
78 $ hg commit -m 0-1-1
79
79
80 $ cd ..
80 $ cd ..
81 $ hg commit -m 0-2-1
81 $ hg commit -m 0-2-1
82 committing subrepository bar
82 committing subrepository bar
83
83
84 $ cd ..
84 $ cd ..
85 $ hg commit -m 1-2-1
85 $ hg commit -m 1-2-1
86 committing subrepository foo
86 committing subrepository foo
87
87
88 Change working directory:
88 Change working directory:
89
89
90 $ echo y3 >> foo/y.txt
90 $ echo y3 >> foo/y.txt
91 $ echo z3 >> foo/bar/z.txt
91 $ echo z3 >> foo/bar/z.txt
92 $ hg status -S
92 $ hg status -S
93 M foo/bar/z.txt
93 M foo/bar/z.txt
94 M foo/y.txt
94 M foo/y.txt
95 $ hg diff --nodates -S
95 $ hg diff --nodates -S
96 diff -r d254738c5f5e foo/y.txt
96 diff -r d254738c5f5e foo/y.txt
97 --- a/foo/y.txt
97 --- a/foo/y.txt
98 +++ b/foo/y.txt
98 +++ b/foo/y.txt
99 @@ -1,2 +1,3 @@
99 @@ -1,2 +1,3 @@
100 y1
100 y1
101 y2
101 y2
102 +y3
102 +y3
103 diff -r 9647f22de499 foo/bar/z.txt
103 diff -r 9647f22de499 foo/bar/z.txt
104 --- a/foo/bar/z.txt
104 --- a/foo/bar/z.txt
105 +++ b/foo/bar/z.txt
105 +++ b/foo/bar/z.txt
106 @@ -1,2 +1,3 @@
106 @@ -1,2 +1,3 @@
107 z1
107 z1
108 z2
108 z2
109 +z3
109 +z3
110
110
111 Status call crossing repository boundaries:
111 Status call crossing repository boundaries:
112
112
113 $ hg status -S foo/bar/z.txt
113 $ hg status -S foo/bar/z.txt
114 M foo/bar/z.txt
114 M foo/bar/z.txt
115 $ hg status -S -I 'foo/?.txt'
115 $ hg status -S -I 'foo/?.txt'
116 M foo/y.txt
116 M foo/y.txt
117 $ hg status -S -I '**/?.txt'
117 $ hg status -S -I '**/?.txt'
118 M foo/bar/z.txt
118 M foo/bar/z.txt
119 M foo/y.txt
119 M foo/y.txt
120 $ hg diff --nodates -S -I '**/?.txt'
120 $ hg diff --nodates -S -I '**/?.txt'
121 diff -r d254738c5f5e foo/y.txt
121 diff -r d254738c5f5e foo/y.txt
122 --- a/foo/y.txt
122 --- a/foo/y.txt
123 +++ b/foo/y.txt
123 +++ b/foo/y.txt
124 @@ -1,2 +1,3 @@
124 @@ -1,2 +1,3 @@
125 y1
125 y1
126 y2
126 y2
127 +y3
127 +y3
128 diff -r 9647f22de499 foo/bar/z.txt
128 diff -r 9647f22de499 foo/bar/z.txt
129 --- a/foo/bar/z.txt
129 --- a/foo/bar/z.txt
130 +++ b/foo/bar/z.txt
130 +++ b/foo/bar/z.txt
131 @@ -1,2 +1,3 @@
131 @@ -1,2 +1,3 @@
132 z1
132 z1
133 z2
133 z2
134 +z3
134 +z3
135
135
136 Status from within a subdirectory:
136 Status from within a subdirectory:
137
137
138 $ mkdir dir
138 $ mkdir dir
139 $ cd dir
139 $ cd dir
140 $ echo a1 > a.txt
140 $ echo a1 > a.txt
141 $ hg status -S
141 $ hg status -S
142 M foo/bar/z.txt
142 M foo/bar/z.txt
143 M foo/y.txt
143 M foo/y.txt
144 ? dir/a.txt
144 ? dir/a.txt
145 $ hg diff --nodates -S
145 $ hg diff --nodates -S
146 diff -r d254738c5f5e foo/y.txt
146 diff -r d254738c5f5e foo/y.txt
147 --- a/foo/y.txt
147 --- a/foo/y.txt
148 +++ b/foo/y.txt
148 +++ b/foo/y.txt
149 @@ -1,2 +1,3 @@
149 @@ -1,2 +1,3 @@
150 y1
150 y1
151 y2
151 y2
152 +y3
152 +y3
153 diff -r 9647f22de499 foo/bar/z.txt
153 diff -r 9647f22de499 foo/bar/z.txt
154 --- a/foo/bar/z.txt
154 --- a/foo/bar/z.txt
155 +++ b/foo/bar/z.txt
155 +++ b/foo/bar/z.txt
156 @@ -1,2 +1,3 @@
156 @@ -1,2 +1,3 @@
157 z1
157 z1
158 z2
158 z2
159 +z3
159 +z3
160
160
161 Status with relative path:
161 Status with relative path:
162
162
163 $ hg status -S ..
163 $ hg status -S ..
164 M ../foo/bar/z.txt
164 M ../foo/bar/z.txt
165 M ../foo/y.txt
165 M ../foo/y.txt
166 ? a.txt
166 ? a.txt
167 $ hg diff --nodates -S ..
167 $ hg diff --nodates -S ..
168 diff -r d254738c5f5e foo/y.txt
168 diff -r d254738c5f5e foo/y.txt
169 --- a/foo/y.txt
169 --- a/foo/y.txt
170 +++ b/foo/y.txt
170 +++ b/foo/y.txt
171 @@ -1,2 +1,3 @@
171 @@ -1,2 +1,3 @@
172 y1
172 y1
173 y2
173 y2
174 +y3
174 +y3
175 diff -r 9647f22de499 foo/bar/z.txt
175 diff -r 9647f22de499 foo/bar/z.txt
176 --- a/foo/bar/z.txt
176 --- a/foo/bar/z.txt
177 +++ b/foo/bar/z.txt
177 +++ b/foo/bar/z.txt
178 @@ -1,2 +1,3 @@
178 @@ -1,2 +1,3 @@
179 z1
179 z1
180 z2
180 z2
181 +z3
181 +z3
182 $ cd ..
182 $ cd ..
183
183
184 Cleanup and final commit:
184 Cleanup and final commit:
185
185
186 $ rm -r dir
186 $ rm -r dir
187 $ hg commit --subrepos -m 2-3-2
187 $ hg commit --subrepos -m 2-3-2
188 committing subrepository foo
188 committing subrepository foo
189 committing subrepository foo/bar
189 committing subrepository foo/bar
190
190
191 Log with the relationships between repo and its subrepo:
191 Log with the relationships between repo and its subrepo:
192
192
193 $ hg log --template '{rev}:{node|short} {desc}\n'
193 $ hg log --template '{rev}:{node|short} {desc}\n'
194 2:1326fa26d0c0 2-3-2
194 2:1326fa26d0c0 2-3-2
195 1:4b3c9ff4f66b 1-2-1
195 1:4b3c9ff4f66b 1-2-1
196 0:23376cbba0d8 0-0-0
196 0:23376cbba0d8 0-0-0
197
197
198 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
198 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
199 3:65903cebad86 2-3-2
199 3:65903cebad86 2-3-2
200 2:d254738c5f5e 0-2-1
200 2:d254738c5f5e 0-2-1
201 1:8629ce7dcc39 0-1-0
201 1:8629ce7dcc39 0-1-0
202 0:af048e97ade2 0-0-0
202 0:af048e97ade2 0-0-0
203
203
204 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
204 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
205 2:31ecbdafd357 2-3-2
205 2:31ecbdafd357 2-3-2
206 1:9647f22de499 0-1-1
206 1:9647f22de499 0-1-1
207 0:4904098473f9 0-0-0
207 0:4904098473f9 0-0-0
208
208
209 Status between revisions:
209 Status between revisions:
210
210
211 $ hg status -S
211 $ hg status -S
212 $ hg status -S --rev 0:1
212 $ hg status -S --rev 0:1
213 M .hgsubstate
213 M .hgsubstate
214 M foo/.hgsubstate
214 M foo/.hgsubstate
215 M foo/bar/z.txt
215 M foo/bar/z.txt
216 M foo/y.txt
216 M foo/y.txt
217 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
217 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
218 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
218 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
219 --- a/foo/y.txt
219 --- a/foo/y.txt
220 +++ b/foo/y.txt
220 +++ b/foo/y.txt
221 @@ -1,1 +1,2 @@
221 @@ -1,1 +1,2 @@
222 y1
222 y1
223 +y2
223 +y2
224 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
224 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
225 --- a/foo/bar/z.txt
225 --- a/foo/bar/z.txt
226 +++ b/foo/bar/z.txt
226 +++ b/foo/bar/z.txt
227 @@ -1,1 +1,2 @@
227 @@ -1,1 +1,2 @@
228 z1
228 z1
229 +z2
229 +z2
230
230
231 Enable progress extension for archive tests:
231 Enable progress extension for archive tests:
232
232
233 $ cp $HGRCPATH $HGRCPATH.no-progress
233 $ cp $HGRCPATH $HGRCPATH.no-progress
234 $ cat >> $HGRCPATH <<EOF
234 $ cat >> $HGRCPATH <<EOF
235 > [extensions]
235 > [extensions]
236 > progress =
236 > progress =
237 > [progress]
237 > [progress]
238 > assume-tty = 1
238 > assume-tty = 1
239 > delay = 0
239 > delay = 0
240 > format = topic bar number
240 > format = topic bar number
241 > refresh = 0
241 > refresh = 0
242 > width = 60
242 > width = 60
243 > EOF
243 > EOF
244
244
245 Test archiving to a directory tree (the doubled lines in the output
245 Test archiving to a directory tree (the doubled lines in the output
246 only show up in the test output, not in real usage):
246 only show up in the test output, not in real usage):
247
247
248 $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py
248 $ hg archive --subrepos ../archive 2>&1 | $TESTDIR/filtercr.py
249
249
250 archiving [ ] 0/3
250 archiving [ ] 0/3
251 archiving [ ] 0/3
251 archiving [ ] 0/3
252 archiving [=============> ] 1/3
252 archiving [=============> ] 1/3
253 archiving [=============> ] 1/3
253 archiving [=============> ] 1/3
254 archiving [===========================> ] 2/3
254 archiving [===========================> ] 2/3
255 archiving [===========================> ] 2/3
255 archiving [===========================> ] 2/3
256 archiving [==========================================>] 3/3
256 archiving [==========================================>] 3/3
257 archiving [==========================================>] 3/3
257 archiving [==========================================>] 3/3
258
258
259 archiving (foo) [ ] 0/3
259 archiving (foo) [ ] 0/3
260 archiving (foo) [ ] 0/3
260 archiving (foo) [ ] 0/3
261 archiving (foo) [===========> ] 1/3
261 archiving (foo) [===========> ] 1/3
262 archiving (foo) [===========> ] 1/3
262 archiving (foo) [===========> ] 1/3
263 archiving (foo) [=======================> ] 2/3
263 archiving (foo) [=======================> ] 2/3
264 archiving (foo) [=======================> ] 2/3
264 archiving (foo) [=======================> ] 2/3
265 archiving (foo) [====================================>] 3/3
265 archiving (foo) [====================================>] 3/3
266 archiving (foo) [====================================>] 3/3
266 archiving (foo) [====================================>] 3/3
267
267
268 archiving (foo/bar) [ ] 0/1
268 archiving (foo/bar) [ ] 0/1 (glob)
269 archiving (foo/bar) [ ] 0/1
269 archiving (foo/bar) [ ] 0/1 (glob)
270 archiving (foo/bar) [================================>] 1/1
270 archiving (foo/bar) [================================>] 1/1 (glob)
271 archiving (foo/bar) [================================>] 1/1
271 archiving (foo/bar) [================================>] 1/1 (glob)
272 \r (esc)
272 \r (esc)
273 $ find ../archive | sort
273 $ find ../archive | sort
274 ../archive
274 ../archive
275 ../archive/.hg_archival.txt
275 ../archive/.hg_archival.txt
276 ../archive/.hgsub
276 ../archive/.hgsub
277 ../archive/.hgsubstate
277 ../archive/.hgsubstate
278 ../archive/foo
278 ../archive/foo
279 ../archive/foo/.hgsub
279 ../archive/foo/.hgsub
280 ../archive/foo/.hgsubstate
280 ../archive/foo/.hgsubstate
281 ../archive/foo/bar
281 ../archive/foo/bar
282 ../archive/foo/bar/z.txt
282 ../archive/foo/bar/z.txt
283 ../archive/foo/y.txt
283 ../archive/foo/y.txt
284 ../archive/x.txt
284 ../archive/x.txt
285
285
286 Test archiving to zip file (unzip output is unstable):
286 Test archiving to zip file (unzip output is unstable):
287
287
288 $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py
288 $ hg archive --subrepos ../archive.zip 2>&1 | $TESTDIR/filtercr.py
289
289
290 archiving [ ] 0/3
290 archiving [ ] 0/3
291 archiving [ ] 0/3
291 archiving [ ] 0/3
292 archiving [=============> ] 1/3
292 archiving [=============> ] 1/3
293 archiving [=============> ] 1/3
293 archiving [=============> ] 1/3
294 archiving [===========================> ] 2/3
294 archiving [===========================> ] 2/3
295 archiving [===========================> ] 2/3
295 archiving [===========================> ] 2/3
296 archiving [==========================================>] 3/3
296 archiving [==========================================>] 3/3
297 archiving [==========================================>] 3/3
297 archiving [==========================================>] 3/3
298
298
299 archiving (foo) [ ] 0/3
299 archiving (foo) [ ] 0/3
300 archiving (foo) [ ] 0/3
300 archiving (foo) [ ] 0/3
301 archiving (foo) [===========> ] 1/3
301 archiving (foo) [===========> ] 1/3
302 archiving (foo) [===========> ] 1/3
302 archiving (foo) [===========> ] 1/3
303 archiving (foo) [=======================> ] 2/3
303 archiving (foo) [=======================> ] 2/3
304 archiving (foo) [=======================> ] 2/3
304 archiving (foo) [=======================> ] 2/3
305 archiving (foo) [====================================>] 3/3
305 archiving (foo) [====================================>] 3/3
306 archiving (foo) [====================================>] 3/3
306 archiving (foo) [====================================>] 3/3
307
307
308 archiving (foo/bar) [ ] 0/1
308 archiving (foo/bar) [ ] 0/1 (glob)
309 archiving (foo/bar) [ ] 0/1
309 archiving (foo/bar) [ ] 0/1 (glob)
310 archiving (foo/bar) [================================>] 1/1
310 archiving (foo/bar) [================================>] 1/1 (glob)
311 archiving (foo/bar) [================================>] 1/1
311 archiving (foo/bar) [================================>] 1/1 (glob)
312 \r (esc)
312 \r (esc)
313
313
314 Test archiving a revision that references a subrepo that is not yet
314 Test archiving a revision that references a subrepo that is not yet
315 cloned:
315 cloned:
316
316
317 $ hg clone -U . ../empty
317 $ hg clone -U . ../empty
318 $ cd ../empty
318 $ cd ../empty
319 $ hg archive --subrepos -r tip ../archive.tar.gz 2>&1 | $TESTDIR/filtercr.py
319 $ hg archive --subrepos -r tip ../archive.tar.gz 2>&1 | $TESTDIR/filtercr.py
320
320
321 archiving [ ] 0/3
321 archiving [ ] 0/3
322 archiving [ ] 0/3
322 archiving [ ] 0/3
323 archiving [=============> ] 1/3
323 archiving [=============> ] 1/3
324 archiving [=============> ] 1/3
324 archiving [=============> ] 1/3
325 archiving [===========================> ] 2/3
325 archiving [===========================> ] 2/3
326 archiving [===========================> ] 2/3
326 archiving [===========================> ] 2/3
327 archiving [==========================================>] 3/3
327 archiving [==========================================>] 3/3
328 archiving [==========================================>] 3/3
328 archiving [==========================================>] 3/3
329
329
330 archiving (foo) [ ] 0/3
330 archiving (foo) [ ] 0/3
331 archiving (foo) [ ] 0/3
331 archiving (foo) [ ] 0/3
332 archiving (foo) [===========> ] 1/3
332 archiving (foo) [===========> ] 1/3
333 archiving (foo) [===========> ] 1/3
333 archiving (foo) [===========> ] 1/3
334 archiving (foo) [=======================> ] 2/3
334 archiving (foo) [=======================> ] 2/3
335 archiving (foo) [=======================> ] 2/3
335 archiving (foo) [=======================> ] 2/3
336 archiving (foo) [====================================>] 3/3
336 archiving (foo) [====================================>] 3/3
337 archiving (foo) [====================================>] 3/3
337 archiving (foo) [====================================>] 3/3
338
338
339 archiving (foo/bar) [ ] 0/1
339 archiving (foo/bar) [ ] 0/1 (glob)
340 archiving (foo/bar) [ ] 0/1
340 archiving (foo/bar) [ ] 0/1 (glob)
341 archiving (foo/bar) [================================>] 1/1
341 archiving (foo/bar) [================================>] 1/1 (glob)
342 archiving (foo/bar) [================================>] 1/1
342 archiving (foo/bar) [================================>] 1/1 (glob)
343
343
344 cloning subrepo foo from $TESTTMP/repo/foo
344 cloning subrepo foo from $TESTTMP/repo/foo
345 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
345 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
346
346
347 The newly cloned subrepos contain no working copy:
347 The newly cloned subrepos contain no working copy:
348
348
349 $ hg -R foo summary
349 $ hg -R foo summary
350 parent: -1:000000000000 (no revision checked out)
350 parent: -1:000000000000 (no revision checked out)
351 branch: default
351 branch: default
352 commit: (clean)
352 commit: (clean)
353 update: 4 new changesets (update)
353 update: 4 new changesets (update)
354
354
355 Disable progress extension and cleanup:
355 Disable progress extension and cleanup:
356
356
357 $ mv $HGRCPATH.no-progress $HGRCPATH
357 $ mv $HGRCPATH.no-progress $HGRCPATH
358
358
359 Test archiving when there is a directory in the way for a subrepo
359 Test archiving when there is a directory in the way for a subrepo
360 created by archive:
360 created by archive:
361
361
362 $ hg clone -U . ../almost-empty
362 $ hg clone -U . ../almost-empty
363 $ cd ../almost-empty
363 $ cd ../almost-empty
364 $ mkdir foo
364 $ mkdir foo
365 $ echo f > foo/f
365 $ echo f > foo/f
366 $ hg archive --subrepos -r tip archive
366 $ hg archive --subrepos -r tip archive
367 cloning subrepo foo from $TESTTMP/empty/foo
367 cloning subrepo foo from $TESTTMP/empty/foo
368 abort: destination '$TESTTMP/almost-empty/foo' is not empty
368 abort: destination '$TESTTMP/almost-empty/foo' is not empty
369 [255]
369 [255]
370
370
371 Clone and test outgoing:
371 Clone and test outgoing:
372
372
373 $ cd ..
373 $ cd ..
374 $ hg clone repo repo2
374 $ hg clone repo repo2
375 updating to branch default
375 updating to branch default
376 cloning subrepo foo from $TESTTMP/repo/foo
376 cloning subrepo foo from $TESTTMP/repo/foo
377 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
377 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 $ cd repo2
379 $ cd repo2
380 $ hg outgoing -S
380 $ hg outgoing -S
381 comparing with $TESTTMP/repo
381 comparing with $TESTTMP/repo
382 searching for changes
382 searching for changes
383 no changes found
383 no changes found
384 comparing with $TESTTMP/repo/foo
384 comparing with $TESTTMP/repo/foo
385 searching for changes
385 searching for changes
386 no changes found
386 no changes found
387 comparing with $TESTTMP/repo/foo/bar
387 comparing with $TESTTMP/repo/foo/bar
388 searching for changes
388 searching for changes
389 no changes found
389 no changes found
390 [1]
390 [1]
391
391
392 Make nested change:
392 Make nested change:
393
393
394 $ echo y4 >> foo/y.txt
394 $ echo y4 >> foo/y.txt
395 $ hg diff --nodates -S
395 $ hg diff --nodates -S
396 diff -r 65903cebad86 foo/y.txt
396 diff -r 65903cebad86 foo/y.txt
397 --- a/foo/y.txt
397 --- a/foo/y.txt
398 +++ b/foo/y.txt
398 +++ b/foo/y.txt
399 @@ -1,3 +1,4 @@
399 @@ -1,3 +1,4 @@
400 y1
400 y1
401 y2
401 y2
402 y3
402 y3
403 +y4
403 +y4
404 $ hg commit --subrepos -m 3-4-2
404 $ hg commit --subrepos -m 3-4-2
405 committing subrepository foo
405 committing subrepository foo
406 $ hg outgoing -S
406 $ hg outgoing -S
407 comparing with $TESTTMP/repo
407 comparing with $TESTTMP/repo
408 searching for changes
408 searching for changes
409 changeset: 3:2655b8ecc4ee
409 changeset: 3:2655b8ecc4ee
410 tag: tip
410 tag: tip
411 user: test
411 user: test
412 date: Thu Jan 01 00:00:00 1970 +0000
412 date: Thu Jan 01 00:00:00 1970 +0000
413 summary: 3-4-2
413 summary: 3-4-2
414
414
415 comparing with $TESTTMP/repo/foo
415 comparing with $TESTTMP/repo/foo
416 searching for changes
416 searching for changes
417 changeset: 4:e96193d6cb36
417 changeset: 4:e96193d6cb36
418 tag: tip
418 tag: tip
419 user: test
419 user: test
420 date: Thu Jan 01 00:00:00 1970 +0000
420 date: Thu Jan 01 00:00:00 1970 +0000
421 summary: 3-4-2
421 summary: 3-4-2
422
422
423 comparing with $TESTTMP/repo/foo/bar
423 comparing with $TESTTMP/repo/foo/bar
424 searching for changes
424 searching for changes
425 no changes found
425 no changes found
426
426
427
427
428 Switch to original repo and setup default path:
428 Switch to original repo and setup default path:
429
429
430 $ cd ../repo
430 $ cd ../repo
431 $ echo '[paths]' >> .hg/hgrc
431 $ echo '[paths]' >> .hg/hgrc
432 $ echo 'default = ../repo2' >> .hg/hgrc
432 $ echo 'default = ../repo2' >> .hg/hgrc
433
433
434 Test incoming:
434 Test incoming:
435
435
436 $ hg incoming -S
436 $ hg incoming -S
437 comparing with $TESTTMP/repo2
437 comparing with $TESTTMP/repo2
438 searching for changes
438 searching for changes
439 changeset: 3:2655b8ecc4ee
439 changeset: 3:2655b8ecc4ee
440 tag: tip
440 tag: tip
441 user: test
441 user: test
442 date: Thu Jan 01 00:00:00 1970 +0000
442 date: Thu Jan 01 00:00:00 1970 +0000
443 summary: 3-4-2
443 summary: 3-4-2
444
444
445 comparing with $TESTTMP/repo2/foo
445 comparing with $TESTTMP/repo2/foo
446 searching for changes
446 searching for changes
447 changeset: 4:e96193d6cb36
447 changeset: 4:e96193d6cb36
448 tag: tip
448 tag: tip
449 user: test
449 user: test
450 date: Thu Jan 01 00:00:00 1970 +0000
450 date: Thu Jan 01 00:00:00 1970 +0000
451 summary: 3-4-2
451 summary: 3-4-2
452
452
453 comparing with $TESTTMP/repo2/foo/bar
453 comparing with $TESTTMP/repo2/foo/bar
454 searching for changes
454 searching for changes
455 no changes found
455 no changes found
456
456
457 $ hg incoming -S --bundle incoming.hg
457 $ hg incoming -S --bundle incoming.hg
458 abort: cannot combine --bundle and --subrepos
458 abort: cannot combine --bundle and --subrepos
459 [255]
459 [255]
460
460
461 Test missing subrepo:
461 Test missing subrepo:
462
462
463 $ rm -r foo
463 $ rm -r foo
464 $ hg status -S
464 $ hg status -S
465 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
465 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
466
466
467 Issue2619: IndexError: list index out of range on hg add with subrepos
467 Issue2619: IndexError: list index out of range on hg add with subrepos
468 The subrepo must sorts after the explicit filename.
468 The subrepo must sorts after the explicit filename.
469
469
470 $ cd ..
470 $ cd ..
471 $ hg init test
471 $ hg init test
472 $ cd test
472 $ cd test
473 $ hg init x
473 $ hg init x
474 $ echo "x = x" >> .hgsub
474 $ echo "x = x" >> .hgsub
475 $ hg add .hgsub
475 $ hg add .hgsub
476 $ touch a x/a
476 $ touch a x/a
477 $ hg add a x/a
477 $ hg add a x/a
@@ -1,105 +1,105 b''
1 $ "$TESTDIR/hghave" serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2
2
3 Preparing the subrepository 'sub'
3 Preparing the subrepository 'sub'
4
4
5 $ hg init sub
5 $ hg init sub
6 $ echo sub > sub/sub
6 $ echo sub > sub/sub
7 $ hg add -R sub
7 $ hg add -R sub
8 adding sub/sub
8 adding sub/sub (glob)
9 $ hg commit -R sub -m "sub import"
9 $ hg commit -R sub -m "sub import"
10
10
11 Preparing the 'main' repo which depends on the subrepo 'sub'
11 Preparing the 'main' repo which depends on the subrepo 'sub'
12
12
13 $ hg init main
13 $ hg init main
14 $ echo main > main/main
14 $ echo main > main/main
15 $ echo "sub = ../sub" > main/.hgsub
15 $ echo "sub = ../sub" > main/.hgsub
16 $ hg clone sub main/sub
16 $ hg clone sub main/sub
17 updating to branch default
17 updating to branch default
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 $ hg add -R main
19 $ hg add -R main
20 adding main/.hgsub
20 adding main/.hgsub (glob)
21 adding main/main
21 adding main/main (glob)
22 $ hg commit -R main -m "main import"
22 $ hg commit -R main -m "main import"
23 committing subrepository sub
23 committing subrepository sub
24
24
25 Cleaning both repositories, just as a clone -U
25 Cleaning both repositories, just as a clone -U
26
26
27 $ hg up -C -R sub null
27 $ hg up -C -R sub null
28 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
28 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
29 $ hg up -C -R main null
29 $ hg up -C -R main null
30 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
30 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
31 $ rm -rf main/sub
31 $ rm -rf main/sub
32
32
33 Serving them both using hgweb
33 Serving them both using hgweb
34
34
35 $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
35 $ printf '[paths]\n/main = main\nsub = sub\n' > webdir.conf
36 $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
36 $ hg serve --webdir-conf webdir.conf -a localhost -p $HGPORT \
37 > -A /dev/null -E /dev/null --pid-file hg.pid -d
37 > -A /dev/null -E /dev/null --pid-file hg.pid -d
38 $ cat hg.pid >> $DAEMON_PIDS
38 $ cat hg.pid >> $DAEMON_PIDS
39
39
40 Clone main from hgweb
40 Clone main from hgweb
41
41
42 $ hg clone "http://localhost:$HGPORT/main" cloned
42 $ hg clone "http://localhost:$HGPORT/main" cloned
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 1 changesets with 3 changes to 3 files
47 added 1 changesets with 3 changes to 3 files
48 updating to branch default
48 updating to branch default
49 cloning subrepo sub from http://localhost:$HGPORT/sub
49 cloning subrepo sub from http://localhost:$HGPORT/sub
50 requesting all changes
50 requesting all changes
51 adding changesets
51 adding changesets
52 adding manifests
52 adding manifests
53 adding file changes
53 adding file changes
54 added 1 changesets with 1 changes to 1 files
54 added 1 changesets with 1 changes to 1 files
55 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
56
56
57 Checking cloned repo ids
57 Checking cloned repo ids
58
58
59 $ hg id -R cloned
59 $ hg id -R cloned
60 fdfeeb3e979e tip
60 fdfeeb3e979e tip
61 $ hg id -R cloned/sub
61 $ hg id -R cloned/sub
62 863c1745b441 tip
62 863c1745b441 tip
63
63
64 subrepo debug for 'main' clone
64 subrepo debug for 'main' clone
65
65
66 $ hg debugsub -R cloned
66 $ hg debugsub -R cloned
67 path sub
67 path sub
68 source ../sub
68 source ../sub
69 revision 863c1745b441bd97a8c4a096e87793073f4fb215
69 revision 863c1745b441bd97a8c4a096e87793073f4fb215
70
70
71 $ "$TESTDIR/killdaemons.py"
71 $ "$TESTDIR/killdaemons.py"
72
72
73 subrepo paths with ssh urls
73 subrepo paths with ssh urls
74
74
75 $ cp $TESTDIR/dummyssh $BINDIR/ssh
75 $ cp $TESTDIR/dummyssh $BINDIR/ssh
76
76
77 $ hg clone ssh://user@dummy/cloned sshclone
77 $ hg clone ssh://user@dummy/cloned sshclone
78 requesting all changes
78 requesting all changes
79 adding changesets
79 adding changesets
80 adding manifests
80 adding manifests
81 adding file changes
81 adding file changes
82 added 1 changesets with 3 changes to 3 files
82 added 1 changesets with 3 changes to 3 files
83 updating to branch default
83 updating to branch default
84 cloning subrepo sub from ssh://user@dummy/sub
84 cloning subrepo sub from ssh://user@dummy/sub
85 requesting all changes
85 requesting all changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 1 changesets with 1 changes to 1 files
89 added 1 changesets with 1 changes to 1 files
90 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 $ hg -R sshclone push ssh://user@dummy/$TESTTMP/cloned
92 $ hg -R sshclone push ssh://user@dummy/$TESTTMP/cloned
93 pushing to ssh://user@dummy/$TESTTMP/cloned
93 pushing to ssh://user@dummy/$TESTTMP/cloned
94 pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
94 pushing subrepo sub to ssh://user@dummy/$TESTTMP/sub
95 searching for changes
95 searching for changes
96 no changes found
96 no changes found
97 searching for changes
97 searching for changes
98 no changes found
98 no changes found
99
99
100 $ cat dummylog
100 $ cat dummylog
101 Got arguments 1:user@dummy 2:hg -R cloned serve --stdio
101 Got arguments 1:user@dummy 2:hg -R cloned serve --stdio
102 Got arguments 1:user@dummy 2:hg -R sub serve --stdio
102 Got arguments 1:user@dummy 2:hg -R sub serve --stdio
103 Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio
103 Got arguments 1:user@dummy 2:hg -R $TESTTMP/cloned serve --stdio
104 Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio
104 Got arguments 1:user@dummy 2:hg -R $TESTTMP/sub serve --stdio
105 $ rm $BINDIR/ssh
105 $ rm $BINDIR/ssh
@@ -1,1007 +1,1007 b''
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
1 Let commit recurse into subrepos by default to match pre-2.0 behavior:
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
4 $ echo "commitsubrepos = Yes" >> $HGRCPATH
5
5
6 $ rm -rf sub
6 $ rm -rf sub
7 $ mkdir sub
7 $ mkdir sub
8 $ cd sub
8 $ cd sub
9 $ hg init t
9 $ hg init t
10 $ cd t
10 $ cd t
11
11
12 first revision, no sub
12 first revision, no sub
13
13
14 $ echo a > a
14 $ echo a > a
15 $ hg ci -Am0
15 $ hg ci -Am0
16 adding a
16 adding a
17
17
18 add first sub
18 add first sub
19
19
20 $ echo s = s > .hgsub
20 $ echo s = s > .hgsub
21 $ hg add .hgsub
21 $ hg add .hgsub
22 $ hg init s
22 $ hg init s
23 $ echo a > s/a
23 $ echo a > s/a
24
24
25 Issue2232: committing a subrepo without .hgsub
25 Issue2232: committing a subrepo without .hgsub
26
26
27 $ hg ci -mbad s
27 $ hg ci -mbad s
28 abort: can't commit subrepos without .hgsub
28 abort: can't commit subrepos without .hgsub
29 [255]
29 [255]
30
30
31 $ hg -R s ci -Ams0
31 $ hg -R s ci -Ams0
32 adding a
32 adding a
33 $ hg sum
33 $ hg sum
34 parent: 0:f7b1eb17ad24 tip
34 parent: 0:f7b1eb17ad24 tip
35 0
35 0
36 branch: default
36 branch: default
37 commit: 1 added, 1 subrepos
37 commit: 1 added, 1 subrepos
38 update: (current)
38 update: (current)
39 $ hg ci -m1
39 $ hg ci -m1
40 committing subrepository s
40 committing subrepository s
41
41
42 Revert can't (yet) revert subrepos:
42 Revert can't (yet) revert subrepos:
43
43
44 $ echo b > s/a
44 $ echo b > s/a
45 $ hg revert s
45 $ hg revert s
46 s: reverting subrepos is unsupported
46 s: reverting subrepos is unsupported
47
47
48 Revert currently ignores subrepos by default
48 Revert currently ignores subrepos by default
49
49
50 $ hg revert -a
50 $ hg revert -a
51 $ hg revert -R s -a -C
51 $ hg revert -R s -a -C
52 reverting s/a
52 reverting s/a (glob)
53
53
54 Issue2022: update -C
54 Issue2022: update -C
55
55
56 $ echo b > s/a
56 $ echo b > s/a
57 $ hg sum
57 $ hg sum
58 parent: 1:7cf8cfea66e4 tip
58 parent: 1:7cf8cfea66e4 tip
59 1
59 1
60 branch: default
60 branch: default
61 commit: 1 subrepos
61 commit: 1 subrepos
62 update: (current)
62 update: (current)
63 $ hg co -C 1
63 $ hg co -C 1
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ hg sum
65 $ hg sum
66 parent: 1:7cf8cfea66e4 tip
66 parent: 1:7cf8cfea66e4 tip
67 1
67 1
68 branch: default
68 branch: default
69 commit: (clean)
69 commit: (clean)
70 update: (current)
70 update: (current)
71
71
72 commands that require a clean repo should respect subrepos
72 commands that require a clean repo should respect subrepos
73
73
74 $ echo b >> s/a
74 $ echo b >> s/a
75 $ hg backout tip
75 $ hg backout tip
76 abort: uncommitted changes in subrepo s
76 abort: uncommitted changes in subrepo s
77 [255]
77 [255]
78 $ hg revert -C -R s s/a
78 $ hg revert -C -R s s/a
79
79
80 add sub sub
80 add sub sub
81
81
82 $ echo ss = ss > s/.hgsub
82 $ echo ss = ss > s/.hgsub
83 $ hg init s/ss
83 $ hg init s/ss
84 $ echo a > s/ss/a
84 $ echo a > s/ss/a
85 $ hg -R s add s/.hgsub
85 $ hg -R s add s/.hgsub
86 $ hg -R s/ss add s/ss/a
86 $ hg -R s/ss add s/ss/a
87 $ hg sum
87 $ hg sum
88 parent: 1:7cf8cfea66e4 tip
88 parent: 1:7cf8cfea66e4 tip
89 1
89 1
90 branch: default
90 branch: default
91 commit: 1 subrepos
91 commit: 1 subrepos
92 update: (current)
92 update: (current)
93 $ hg ci -m2
93 $ hg ci -m2
94 committing subrepository s
94 committing subrepository s
95 committing subrepository s/ss
95 committing subrepository s/ss (glob)
96 $ hg sum
96 $ hg sum
97 parent: 2:df30734270ae tip
97 parent: 2:df30734270ae tip
98 2
98 2
99 branch: default
99 branch: default
100 commit: (clean)
100 commit: (clean)
101 update: (current)
101 update: (current)
102
102
103 bump sub rev (and check it is ignored by ui.commitsubrepos)
103 bump sub rev (and check it is ignored by ui.commitsubrepos)
104
104
105 $ echo b > s/a
105 $ echo b > s/a
106 $ hg -R s ci -ms1
106 $ hg -R s ci -ms1
107 $ hg --config ui.commitsubrepos=no ci -m3
107 $ hg --config ui.commitsubrepos=no ci -m3
108 committing subrepository s
108 committing subrepository s
109
109
110 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
110 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
111
111
112 $ echo c > s/a
112 $ echo c > s/a
113 $ hg --config ui.commitsubrepos=no ci -m4
113 $ hg --config ui.commitsubrepos=no ci -m4
114 abort: uncommitted changes in subrepo s
114 abort: uncommitted changes in subrepo s
115 (use --subrepos for recursive commit)
115 (use --subrepos for recursive commit)
116 [255]
116 [255]
117 $ hg ci -m4
117 $ hg ci -m4
118 committing subrepository s
118 committing subrepository s
119 $ hg tip -R s
119 $ hg tip -R s
120 changeset: 3:1c833a7a9e3a
120 changeset: 3:1c833a7a9e3a
121 tag: tip
121 tag: tip
122 user: test
122 user: test
123 date: Thu Jan 01 00:00:00 1970 +0000
123 date: Thu Jan 01 00:00:00 1970 +0000
124 summary: 4
124 summary: 4
125
125
126
126
127 check caching
127 check caching
128
128
129 $ hg co 0
129 $ hg co 0
130 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
130 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
131 $ hg debugsub
131 $ hg debugsub
132
132
133 restore
133 restore
134
134
135 $ hg co
135 $ hg co
136 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
137 $ hg debugsub
137 $ hg debugsub
138 path s
138 path s
139 source s
139 source s
140 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
140 revision 1c833a7a9e3a4445c711aaf0f012379cd0d4034e
141
141
142 new branch for merge tests
142 new branch for merge tests
143
143
144 $ hg co 1
144 $ hg co 1
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ echo t = t >> .hgsub
146 $ echo t = t >> .hgsub
147 $ hg init t
147 $ hg init t
148 $ echo t > t/t
148 $ echo t > t/t
149 $ hg -R t add t
149 $ hg -R t add t
150 adding t/t
150 adding t/t (glob)
151
151
152 5
152 5
153
153
154 $ hg ci -m5 # add sub
154 $ hg ci -m5 # add sub
155 committing subrepository t
155 committing subrepository t
156 created new head
156 created new head
157 $ echo t2 > t/t
157 $ echo t2 > t/t
158
158
159 6
159 6
160
160
161 $ hg st -R s
161 $ hg st -R s
162 $ hg ci -m6 # change sub
162 $ hg ci -m6 # change sub
163 committing subrepository t
163 committing subrepository t
164 $ hg debugsub
164 $ hg debugsub
165 path s
165 path s
166 source s
166 source s
167 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
167 revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4
168 path t
168 path t
169 source t
169 source t
170 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
170 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
171 $ echo t3 > t/t
171 $ echo t3 > t/t
172
172
173 7
173 7
174
174
175 $ hg ci -m7 # change sub again for conflict test
175 $ hg ci -m7 # change sub again for conflict test
176 committing subrepository t
176 committing subrepository t
177 $ hg rm .hgsub
177 $ hg rm .hgsub
178
178
179 8
179 8
180
180
181 $ hg ci -m8 # remove sub
181 $ hg ci -m8 # remove sub
182
182
183 merge tests
183 merge tests
184
184
185 $ hg co -C 3
185 $ hg co -C 3
186 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
186 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
187 $ hg merge 5 # test adding
187 $ hg merge 5 # test adding
188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 (branch merge, don't forget to commit)
189 (branch merge, don't forget to commit)
190 $ hg debugsub
190 $ hg debugsub
191 path s
191 path s
192 source s
192 source s
193 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
193 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
194 path t
194 path t
195 source t
195 source t
196 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
196 revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382
197 $ hg ci -m9
197 $ hg ci -m9
198 created new head
198 created new head
199 $ hg merge 6 --debug # test change
199 $ hg merge 6 --debug # test change
200 searching for copies back to rev 2
200 searching for copies back to rev 2
201 resolving manifests
201 resolving manifests
202 overwrite None partial False
202 overwrite None partial False
203 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
203 ancestor 1f14a2e2d3ec local f0d2028bf86d+ remote 1831e14459c4
204 .hgsubstate: versions differ -> m
204 .hgsubstate: versions differ -> m
205 updating: .hgsubstate 1/1 files (100.00%)
205 updating: .hgsubstate 1/1 files (100.00%)
206 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
206 subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec
207 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
207 subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg
208 getting subrepo t
208 getting subrepo t
209 resolving manifests
209 resolving manifests
210 overwrite True partial False
210 overwrite True partial False
211 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
211 ancestor 60ca1237c194+ local 60ca1237c194+ remote 6747d179aa9a
212 t: remote is newer -> g
212 t: remote is newer -> g
213 updating: t 1/1 files (100.00%)
213 updating: t 1/1 files (100.00%)
214 getting t
214 getting t
215 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 (branch merge, don't forget to commit)
216 (branch merge, don't forget to commit)
217 $ hg debugsub
217 $ hg debugsub
218 path s
218 path s
219 source s
219 source s
220 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
220 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
221 path t
221 path t
222 source t
222 source t
223 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
223 revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad
224 $ echo conflict > t/t
224 $ echo conflict > t/t
225 $ hg ci -m10
225 $ hg ci -m10
226 committing subrepository t
226 committing subrepository t
227 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
227 $ HGMERGE=internal:merge hg merge --debug 7 # test conflict
228 searching for copies back to rev 2
228 searching for copies back to rev 2
229 resolving manifests
229 resolving manifests
230 overwrite None partial False
230 overwrite None partial False
231 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
231 ancestor 1831e14459c4 local e45c8b14af55+ remote f94576341bcf
232 .hgsubstate: versions differ -> m
232 .hgsubstate: versions differ -> m
233 updating: .hgsubstate 1/1 files (100.00%)
233 updating: .hgsubstate 1/1 files (100.00%)
234 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
234 subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
235 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
235 subrepo t: both sides changed, merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg
236 merging subrepo t
236 merging subrepo t
237 searching for copies back to rev 2
237 searching for copies back to rev 2
238 resolving manifests
238 resolving manifests
239 overwrite None partial False
239 overwrite None partial False
240 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
240 ancestor 6747d179aa9a local 20a0db6fbf6c+ remote 7af322bc1198
241 t: versions differ -> m
241 t: versions differ -> m
242 preserving t for resolve of t
242 preserving t for resolve of t
243 updating: t 1/1 files (100.00%)
243 updating: t 1/1 files (100.00%)
244 picked tool 'internal:merge' for t (binary False symlink False)
244 picked tool 'internal:merge' for t (binary False symlink False)
245 merging t
245 merging t
246 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
246 my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a
247 warning: conflicts during merge.
247 warning: conflicts during merge.
248 merging t failed!
248 merging t failed!
249 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
249 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
250 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
250 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 (branch merge, don't forget to commit)
252 (branch merge, don't forget to commit)
253
253
254 should conflict
254 should conflict
255
255
256 $ cat t/t
256 $ cat t/t
257 <<<<<<< local
257 <<<<<<< local
258 conflict
258 conflict
259 =======
259 =======
260 t3
260 t3
261 >>>>>>> other
261 >>>>>>> other
262
262
263 clone
263 clone
264
264
265 $ cd ..
265 $ cd ..
266 $ hg clone t tc
266 $ hg clone t tc
267 updating to branch default
267 updating to branch default
268 cloning subrepo s from $TESTTMP/sub/t/s
268 cloning subrepo s from $TESTTMP/sub/t/s (glob)
269 cloning subrepo s/ss from $TESTTMP/sub/t/s/ss
269 cloning subrepo s/ss from $TESTTMP/sub/t/s/ss (glob)
270 cloning subrepo t from $TESTTMP/sub/t/t
270 cloning subrepo t from $TESTTMP/sub/t/t (glob)
271 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 $ cd tc
272 $ cd tc
273 $ hg debugsub
273 $ hg debugsub
274 path s
274 path s
275 source s
275 source s
276 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
276 revision fc627a69481fcbe5f1135069e8a3881c023e4cf5
277 path t
277 path t
278 source t
278 source t
279 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
279 revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
280
280
281 push
281 push
282
282
283 $ echo bah > t/t
283 $ echo bah > t/t
284 $ hg ci -m11
284 $ hg ci -m11
285 committing subrepository t
285 committing subrepository t
286 $ hg push
286 $ hg push
287 pushing to $TESTTMP/sub/t
287 pushing to $TESTTMP/sub/t (glob)
288 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss
288 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
289 searching for changes
289 searching for changes
290 no changes found
290 no changes found
291 pushing subrepo s to $TESTTMP/sub/t/s
291 pushing subrepo s to $TESTTMP/sub/t/s (glob)
292 searching for changes
292 searching for changes
293 no changes found
293 no changes found
294 pushing subrepo t to $TESTTMP/sub/t/t
294 pushing subrepo t to $TESTTMP/sub/t/t (glob)
295 searching for changes
295 searching for changes
296 adding changesets
296 adding changesets
297 adding manifests
297 adding manifests
298 adding file changes
298 adding file changes
299 added 1 changesets with 1 changes to 1 files
299 added 1 changesets with 1 changes to 1 files
300 searching for changes
300 searching for changes
301 adding changesets
301 adding changesets
302 adding manifests
302 adding manifests
303 adding file changes
303 adding file changes
304 added 1 changesets with 1 changes to 1 files
304 added 1 changesets with 1 changes to 1 files
305
305
306 push -f
306 push -f
307
307
308 $ echo bah > s/a
308 $ echo bah > s/a
309 $ hg ci -m12
309 $ hg ci -m12
310 committing subrepository s
310 committing subrepository s
311 $ hg push
311 $ hg push
312 pushing to $TESTTMP/sub/t
312 pushing to $TESTTMP/sub/t (glob)
313 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss
313 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
314 searching for changes
314 searching for changes
315 no changes found
315 no changes found
316 pushing subrepo s to $TESTTMP/sub/t/s
316 pushing subrepo s to $TESTTMP/sub/t/s (glob)
317 searching for changes
317 searching for changes
318 abort: push creates new remote head 12a213df6fa9!
318 abort: push creates new remote head 12a213df6fa9!
319 (did you forget to merge? use push -f to force)
319 (did you forget to merge? use push -f to force)
320 [255]
320 [255]
321 $ hg push -f
321 $ hg push -f
322 pushing to $TESTTMP/sub/t
322 pushing to $TESTTMP/sub/t (glob)
323 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss
323 pushing subrepo s/ss to $TESTTMP/sub/t/s/ss (glob)
324 searching for changes
324 searching for changes
325 no changes found
325 no changes found
326 pushing subrepo s to $TESTTMP/sub/t/s
326 pushing subrepo s to $TESTTMP/sub/t/s (glob)
327 searching for changes
327 searching for changes
328 adding changesets
328 adding changesets
329 adding manifests
329 adding manifests
330 adding file changes
330 adding file changes
331 added 1 changesets with 1 changes to 1 files (+1 heads)
331 added 1 changesets with 1 changes to 1 files (+1 heads)
332 pushing subrepo t to $TESTTMP/sub/t/t
332 pushing subrepo t to $TESTTMP/sub/t/t (glob)
333 searching for changes
333 searching for changes
334 no changes found
334 no changes found
335 searching for changes
335 searching for changes
336 adding changesets
336 adding changesets
337 adding manifests
337 adding manifests
338 adding file changes
338 adding file changes
339 added 1 changesets with 1 changes to 1 files
339 added 1 changesets with 1 changes to 1 files
340
340
341 update
341 update
342
342
343 $ cd ../t
343 $ cd ../t
344 $ hg up -C # discard our earlier merge
344 $ hg up -C # discard our earlier merge
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
345 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
346 $ echo blah > t/t
346 $ echo blah > t/t
347 $ hg ci -m13
347 $ hg ci -m13
348 committing subrepository t
348 committing subrepository t
349
349
350 pull
350 pull
351
351
352 $ cd ../tc
352 $ cd ../tc
353 $ hg pull
353 $ hg pull
354 pulling from $TESTTMP/sub/t
354 pulling from $TESTTMP/sub/t (glob)
355 searching for changes
355 searching for changes
356 adding changesets
356 adding changesets
357 adding manifests
357 adding manifests
358 adding file changes
358 adding file changes
359 added 1 changesets with 1 changes to 1 files
359 added 1 changesets with 1 changes to 1 files
360 (run 'hg update' to get a working copy)
360 (run 'hg update' to get a working copy)
361
361
362 should pull t
362 should pull t
363
363
364 $ hg up
364 $ hg up
365 pulling subrepo t from $TESTTMP/sub/t/t
365 pulling subrepo t from $TESTTMP/sub/t/t (glob)
366 searching for changes
366 searching for changes
367 adding changesets
367 adding changesets
368 adding manifests
368 adding manifests
369 adding file changes
369 adding file changes
370 added 1 changesets with 1 changes to 1 files
370 added 1 changesets with 1 changes to 1 files
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 $ cat t/t
372 $ cat t/t
373 blah
373 blah
374
374
375 bogus subrepo path aborts
375 bogus subrepo path aborts
376
376
377 $ echo 'bogus=[boguspath' >> .hgsub
377 $ echo 'bogus=[boguspath' >> .hgsub
378 $ hg ci -m 'bogus subrepo path'
378 $ hg ci -m 'bogus subrepo path'
379 abort: missing ] in subrepo source
379 abort: missing ] in subrepo source
380 [255]
380 [255]
381
381
382 Issue1986: merge aborts when trying to merge a subrepo that
382 Issue1986: merge aborts when trying to merge a subrepo that
383 shouldn't need merging
383 shouldn't need merging
384
384
385 # subrepo layout
385 # subrepo layout
386 #
386 #
387 # o 5 br
387 # o 5 br
388 # /|
388 # /|
389 # o | 4 default
389 # o | 4 default
390 # | |
390 # | |
391 # | o 3 br
391 # | o 3 br
392 # |/|
392 # |/|
393 # o | 2 default
393 # o | 2 default
394 # | |
394 # | |
395 # | o 1 br
395 # | o 1 br
396 # |/
396 # |/
397 # o 0 default
397 # o 0 default
398
398
399 $ cd ..
399 $ cd ..
400 $ rm -rf sub
400 $ rm -rf sub
401 $ hg init main
401 $ hg init main
402 $ cd main
402 $ cd main
403 $ hg init s
403 $ hg init s
404 $ cd s
404 $ cd s
405 $ echo a > a
405 $ echo a > a
406 $ hg ci -Am1
406 $ hg ci -Am1
407 adding a
407 adding a
408 $ hg branch br
408 $ hg branch br
409 marked working directory as branch br
409 marked working directory as branch br
410 $ echo a >> a
410 $ echo a >> a
411 $ hg ci -m1
411 $ hg ci -m1
412 $ hg up default
412 $ hg up default
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 $ echo b > b
414 $ echo b > b
415 $ hg ci -Am1
415 $ hg ci -Am1
416 adding b
416 adding b
417 $ hg up br
417 $ hg up br
418 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
418 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
419 $ hg merge tip
419 $ hg merge tip
420 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
420 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
421 (branch merge, don't forget to commit)
421 (branch merge, don't forget to commit)
422 $ hg ci -m1
422 $ hg ci -m1
423 $ hg up 2
423 $ hg up 2
424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
424 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
425 $ echo c > c
425 $ echo c > c
426 $ hg ci -Am1
426 $ hg ci -Am1
427 adding c
427 adding c
428 $ hg up 3
428 $ hg up 3
429 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
429 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
430 $ hg merge 4
430 $ hg merge 4
431 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
431 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
432 (branch merge, don't forget to commit)
432 (branch merge, don't forget to commit)
433 $ hg ci -m1
433 $ hg ci -m1
434
434
435 # main repo layout:
435 # main repo layout:
436 #
436 #
437 # * <-- try to merge default into br again
437 # * <-- try to merge default into br again
438 # .`|
438 # .`|
439 # . o 5 br --> substate = 5
439 # . o 5 br --> substate = 5
440 # . |
440 # . |
441 # o | 4 default --> substate = 4
441 # o | 4 default --> substate = 4
442 # | |
442 # | |
443 # | o 3 br --> substate = 2
443 # | o 3 br --> substate = 2
444 # |/|
444 # |/|
445 # o | 2 default --> substate = 2
445 # o | 2 default --> substate = 2
446 # | |
446 # | |
447 # | o 1 br --> substate = 3
447 # | o 1 br --> substate = 3
448 # |/
448 # |/
449 # o 0 default --> substate = 2
449 # o 0 default --> substate = 2
450
450
451 $ cd ..
451 $ cd ..
452 $ echo 's = s' > .hgsub
452 $ echo 's = s' > .hgsub
453 $ hg -R s up 2
453 $ hg -R s up 2
454 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
454 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
455 $ hg ci -Am1
455 $ hg ci -Am1
456 adding .hgsub
456 adding .hgsub
457 committing subrepository s
457 committing subrepository s
458 $ hg branch br
458 $ hg branch br
459 marked working directory as branch br
459 marked working directory as branch br
460 $ echo b > b
460 $ echo b > b
461 $ hg -R s up 3
461 $ hg -R s up 3
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 $ hg ci -Am1
463 $ hg ci -Am1
464 adding b
464 adding b
465 committing subrepository s
465 committing subrepository s
466 $ hg up default
466 $ hg up default
467 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
467 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
468 $ echo c > c
468 $ echo c > c
469 $ hg ci -Am1
469 $ hg ci -Am1
470 adding c
470 adding c
471 $ hg up 1
471 $ hg up 1
472 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
472 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
473 $ hg merge 2
473 $ hg merge 2
474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 (branch merge, don't forget to commit)
475 (branch merge, don't forget to commit)
476 $ hg ci -m1
476 $ hg ci -m1
477 $ hg up 2
477 $ hg up 2
478 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
478 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
479 $ hg -R s up 4
479 $ hg -R s up 4
480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
481 $ echo d > d
481 $ echo d > d
482 $ hg ci -Am1
482 $ hg ci -Am1
483 adding d
483 adding d
484 committing subrepository s
484 committing subrepository s
485 $ hg up 3
485 $ hg up 3
486 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
486 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
487 $ hg -R s up 5
487 $ hg -R s up 5
488 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 $ echo e > e
489 $ echo e > e
490 $ hg ci -Am1
490 $ hg ci -Am1
491 adding e
491 adding e
492 committing subrepository s
492 committing subrepository s
493
493
494 $ hg up 5
494 $ hg up 5
495 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
495 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
496 $ hg merge 4 # try to merge default into br again
496 $ hg merge 4 # try to merge default into br again
497 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
497 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
498 (branch merge, don't forget to commit)
498 (branch merge, don't forget to commit)
499 $ cd ..
499 $ cd ..
500
500
501 test subrepo delete from .hgsubstate
501 test subrepo delete from .hgsubstate
502
502
503 $ hg init testdelete
503 $ hg init testdelete
504 $ mkdir testdelete/nested testdelete/nested2
504 $ mkdir testdelete/nested testdelete/nested2
505 $ hg init testdelete/nested
505 $ hg init testdelete/nested
506 $ hg init testdelete/nested2
506 $ hg init testdelete/nested2
507 $ echo test > testdelete/nested/foo
507 $ echo test > testdelete/nested/foo
508 $ echo test > testdelete/nested2/foo
508 $ echo test > testdelete/nested2/foo
509 $ hg -R testdelete/nested add
509 $ hg -R testdelete/nested add
510 adding testdelete/nested/foo
510 adding testdelete/nested/foo (glob)
511 $ hg -R testdelete/nested2 add
511 $ hg -R testdelete/nested2 add
512 adding testdelete/nested2/foo
512 adding testdelete/nested2/foo (glob)
513 $ hg -R testdelete/nested ci -m test
513 $ hg -R testdelete/nested ci -m test
514 $ hg -R testdelete/nested2 ci -m test
514 $ hg -R testdelete/nested2 ci -m test
515 $ echo nested = nested > testdelete/.hgsub
515 $ echo nested = nested > testdelete/.hgsub
516 $ echo nested2 = nested2 >> testdelete/.hgsub
516 $ echo nested2 = nested2 >> testdelete/.hgsub
517 $ hg -R testdelete add
517 $ hg -R testdelete add
518 adding testdelete/.hgsub
518 adding testdelete/.hgsub (glob)
519 $ hg -R testdelete ci -m "nested 1 & 2 added"
519 $ hg -R testdelete ci -m "nested 1 & 2 added"
520 committing subrepository nested
520 committing subrepository nested
521 committing subrepository nested2
521 committing subrepository nested2
522 $ echo nested = nested > testdelete/.hgsub
522 $ echo nested = nested > testdelete/.hgsub
523 $ hg -R testdelete ci -m "nested 2 deleted"
523 $ hg -R testdelete ci -m "nested 2 deleted"
524 $ cat testdelete/.hgsubstate
524 $ cat testdelete/.hgsubstate
525 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
525 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
526 $ hg -R testdelete remove testdelete/.hgsub
526 $ hg -R testdelete remove testdelete/.hgsub
527 $ hg -R testdelete ci -m ".hgsub deleted"
527 $ hg -R testdelete ci -m ".hgsub deleted"
528 $ cat testdelete/.hgsubstate
528 $ cat testdelete/.hgsubstate
529 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
529 bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested
530
530
531 test repository cloning
531 test repository cloning
532
532
533 $ mkdir mercurial mercurial2
533 $ mkdir mercurial mercurial2
534 $ hg init nested_absolute
534 $ hg init nested_absolute
535 $ echo test > nested_absolute/foo
535 $ echo test > nested_absolute/foo
536 $ hg -R nested_absolute add
536 $ hg -R nested_absolute add
537 adding nested_absolute/foo
537 adding nested_absolute/foo (glob)
538 $ hg -R nested_absolute ci -mtest
538 $ hg -R nested_absolute ci -mtest
539 $ cd mercurial
539 $ cd mercurial
540 $ hg init nested_relative
540 $ hg init nested_relative
541 $ echo test2 > nested_relative/foo2
541 $ echo test2 > nested_relative/foo2
542 $ hg -R nested_relative add
542 $ hg -R nested_relative add
543 adding nested_relative/foo2
543 adding nested_relative/foo2 (glob)
544 $ hg -R nested_relative ci -mtest2
544 $ hg -R nested_relative ci -mtest2
545 $ hg init main
545 $ hg init main
546 $ echo "nested_relative = ../nested_relative" > main/.hgsub
546 $ echo "nested_relative = ../nested_relative" > main/.hgsub
547 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
547 $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub
548 $ hg -R main add
548 $ hg -R main add
549 adding main/.hgsub
549 adding main/.hgsub (glob)
550 $ hg -R main ci -m "add subrepos"
550 $ hg -R main ci -m "add subrepos"
551 committing subrepository nested_absolute
551 committing subrepository nested_absolute
552 committing subrepository nested_relative
552 committing subrepository nested_relative
553 $ cd ..
553 $ cd ..
554 $ hg clone mercurial/main mercurial2/main
554 $ hg clone mercurial/main mercurial2/main
555 updating to branch default
555 updating to branch default
556 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
556 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
557 $ cat mercurial2/main/nested_absolute/.hg/hgrc \
558 > mercurial2/main/nested_relative/.hg/hgrc
558 > mercurial2/main/nested_relative/.hg/hgrc
559 [paths]
559 [paths]
560 default = $TESTTMP/sub/mercurial/nested_absolute
560 default = $TESTTMP/sub/mercurial/nested_absolute
561 [paths]
561 [paths]
562 default = $TESTTMP/sub/mercurial/nested_relative
562 default = $TESTTMP/sub/mercurial/nested_relative
563 $ rm -rf mercurial mercurial2
563 $ rm -rf mercurial mercurial2
564
564
565 Issue1977: multirepo push should fail if subrepo push fails
565 Issue1977: multirepo push should fail if subrepo push fails
566
566
567 $ hg init repo
567 $ hg init repo
568 $ hg init repo/s
568 $ hg init repo/s
569 $ echo a > repo/s/a
569 $ echo a > repo/s/a
570 $ hg -R repo/s ci -Am0
570 $ hg -R repo/s ci -Am0
571 adding a
571 adding a
572 $ echo s = s > repo/.hgsub
572 $ echo s = s > repo/.hgsub
573 $ hg -R repo ci -Am1
573 $ hg -R repo ci -Am1
574 adding .hgsub
574 adding .hgsub
575 committing subrepository s
575 committing subrepository s
576 $ hg clone repo repo2
576 $ hg clone repo repo2
577 updating to branch default
577 updating to branch default
578 cloning subrepo s from $TESTTMP/sub/repo/s
578 cloning subrepo s from $TESTTMP/sub/repo/s (glob)
579 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
579 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
580 $ hg -q -R repo2 pull -u
580 $ hg -q -R repo2 pull -u
581 $ echo 1 > repo2/s/a
581 $ echo 1 > repo2/s/a
582 $ hg -R repo2/s ci -m2
582 $ hg -R repo2/s ci -m2
583 $ hg -q -R repo2/s push
583 $ hg -q -R repo2/s push
584 $ hg -R repo2/s up -C 0
584 $ hg -R repo2/s up -C 0
585 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
585 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
586 $ echo 2 > repo2/s/a
586 $ echo 2 > repo2/s/a
587 $ hg -R repo2/s ci -m3
587 $ hg -R repo2/s ci -m3
588 created new head
588 created new head
589 $ hg -R repo2 ci -m3
589 $ hg -R repo2 ci -m3
590 committing subrepository s
590 committing subrepository s
591 $ hg -q -R repo2 push
591 $ hg -q -R repo2 push
592 abort: push creates new remote head 9d66565e64e1!
592 abort: push creates new remote head 9d66565e64e1!
593 (did you forget to merge? use push -f to force)
593 (did you forget to merge? use push -f to force)
594 [255]
594 [255]
595 $ hg -R repo update
595 $ hg -R repo update
596 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
596 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 $ rm -rf repo2 repo
597 $ rm -rf repo2 repo
598
598
599
599
600 Issue1852 subrepos with relative paths always push/pull relative to default
600 Issue1852 subrepos with relative paths always push/pull relative to default
601
601
602 Prepare a repo with subrepo
602 Prepare a repo with subrepo
603
603
604 $ hg init issue1852a
604 $ hg init issue1852a
605 $ cd issue1852a
605 $ cd issue1852a
606 $ hg init sub/repo
606 $ hg init sub/repo
607 $ echo test > sub/repo/foo
607 $ echo test > sub/repo/foo
608 $ hg -R sub/repo add sub/repo/foo
608 $ hg -R sub/repo add sub/repo/foo
609 $ echo sub/repo = sub/repo > .hgsub
609 $ echo sub/repo = sub/repo > .hgsub
610 $ hg add .hgsub
610 $ hg add .hgsub
611 $ hg ci -mtest
611 $ hg ci -mtest
612 committing subrepository sub/repo
612 committing subrepository sub/repo (glob)
613 $ echo test >> sub/repo/foo
613 $ echo test >> sub/repo/foo
614 $ hg ci -mtest
614 $ hg ci -mtest
615 committing subrepository sub/repo
615 committing subrepository sub/repo (glob)
616 $ cd ..
616 $ cd ..
617
617
618 Create repo without default path, pull top repo, and see what happens on update
618 Create repo without default path, pull top repo, and see what happens on update
619
619
620 $ hg init issue1852b
620 $ hg init issue1852b
621 $ hg -R issue1852b pull issue1852a
621 $ hg -R issue1852b pull issue1852a
622 pulling from issue1852a
622 pulling from issue1852a
623 requesting all changes
623 requesting all changes
624 adding changesets
624 adding changesets
625 adding manifests
625 adding manifests
626 adding file changes
626 adding file changes
627 added 2 changesets with 3 changes to 2 files
627 added 2 changesets with 3 changes to 2 files
628 (run 'hg update' to get a working copy)
628 (run 'hg update' to get a working copy)
629 $ hg -R issue1852b update
629 $ hg -R issue1852b update
630 abort: default path for subrepository sub/repo not found
630 abort: default path for subrepository sub/repo not found (glob)
631 [255]
631 [255]
632
632
633 Pull -u now doesn't help
633 Pull -u now doesn't help
634
634
635 $ hg -R issue1852b pull -u issue1852a
635 $ hg -R issue1852b pull -u issue1852a
636 pulling from issue1852a
636 pulling from issue1852a
637 searching for changes
637 searching for changes
638 no changes found
638 no changes found
639
639
640 Try the same, but with pull -u
640 Try the same, but with pull -u
641
641
642 $ hg init issue1852c
642 $ hg init issue1852c
643 $ hg -R issue1852c pull -r0 -u issue1852a
643 $ hg -R issue1852c pull -r0 -u issue1852a
644 pulling from issue1852a
644 pulling from issue1852a
645 adding changesets
645 adding changesets
646 adding manifests
646 adding manifests
647 adding file changes
647 adding file changes
648 added 1 changesets with 2 changes to 2 files
648 added 1 changesets with 2 changes to 2 files
649 cloning subrepo sub/repo from issue1852a/sub/repo
649 cloning subrepo sub/repo from issue1852a/sub/repo (glob)
650 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
650 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
651
651
652 Try to push from the other side
652 Try to push from the other side
653
653
654 $ hg -R issue1852a push `pwd`/issue1852c
654 $ hg -R issue1852a push `pwd`/issue1852c
655 pushing to $TESTTMP/sub/issue1852c
655 pushing to $TESTTMP/sub/issue1852c
656 pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo
656 pushing subrepo sub/repo to $TESTTMP/sub/issue1852c/sub/repo (glob)
657 searching for changes
657 searching for changes
658 no changes found
658 no changes found
659 searching for changes
659 searching for changes
660 adding changesets
660 adding changesets
661 adding manifests
661 adding manifests
662 adding file changes
662 adding file changes
663 added 1 changesets with 1 changes to 1 files
663 added 1 changesets with 1 changes to 1 files
664
664
665 Incoming and outgoing should not use the default path:
665 Incoming and outgoing should not use the default path:
666
666
667 $ hg clone -q issue1852a issue1852d
667 $ hg clone -q issue1852a issue1852d
668 $ hg -R issue1852d outgoing --subrepos issue1852c
668 $ hg -R issue1852d outgoing --subrepos issue1852c
669 comparing with issue1852c
669 comparing with issue1852c
670 searching for changes
670 searching for changes
671 no changes found
671 no changes found
672 comparing with issue1852c/sub/repo
672 comparing with issue1852c/sub/repo
673 searching for changes
673 searching for changes
674 no changes found
674 no changes found
675 [1]
675 [1]
676 $ hg -R issue1852d incoming --subrepos issue1852c
676 $ hg -R issue1852d incoming --subrepos issue1852c
677 comparing with issue1852c
677 comparing with issue1852c
678 searching for changes
678 searching for changes
679 no changes found
679 no changes found
680 comparing with issue1852c/sub/repo
680 comparing with issue1852c/sub/repo
681 searching for changes
681 searching for changes
682 no changes found
682 no changes found
683 [1]
683 [1]
684
684
685 Check status of files when none of them belong to the first
685 Check status of files when none of them belong to the first
686 subrepository:
686 subrepository:
687
687
688 $ hg init subrepo-status
688 $ hg init subrepo-status
689 $ cd subrepo-status
689 $ cd subrepo-status
690 $ hg init subrepo-1
690 $ hg init subrepo-1
691 $ hg init subrepo-2
691 $ hg init subrepo-2
692 $ cd subrepo-2
692 $ cd subrepo-2
693 $ touch file
693 $ touch file
694 $ hg add file
694 $ hg add file
695 $ cd ..
695 $ cd ..
696 $ echo subrepo-1 = subrepo-1 > .hgsub
696 $ echo subrepo-1 = subrepo-1 > .hgsub
697 $ echo subrepo-2 = subrepo-2 >> .hgsub
697 $ echo subrepo-2 = subrepo-2 >> .hgsub
698 $ hg add .hgsub
698 $ hg add .hgsub
699 $ hg ci -m 'Added subrepos'
699 $ hg ci -m 'Added subrepos'
700 committing subrepository subrepo-1
700 committing subrepository subrepo-1
701 committing subrepository subrepo-2
701 committing subrepository subrepo-2
702 $ hg st subrepo-2/file
702 $ hg st subrepo-2/file
703
703
704 Check hg update --clean
704 Check hg update --clean
705 $ cd $TESTTMP/sub/t
705 $ cd $TESTTMP/sub/t
706 $ rm -r t/t.orig
706 $ rm -r t/t.orig
707 $ hg status -S --all
707 $ hg status -S --all
708 C .hgsub
708 C .hgsub
709 C .hgsubstate
709 C .hgsubstate
710 C a
710 C a
711 C s/.hgsub
711 C s/.hgsub
712 C s/.hgsubstate
712 C s/.hgsubstate
713 C s/a
713 C s/a
714 C s/ss/a
714 C s/ss/a
715 C t/t
715 C t/t
716 $ echo c1 > s/a
716 $ echo c1 > s/a
717 $ cd s
717 $ cd s
718 $ echo c1 > b
718 $ echo c1 > b
719 $ echo c1 > c
719 $ echo c1 > c
720 $ hg add b
720 $ hg add b
721 $ cd ..
721 $ cd ..
722 $ hg status -S
722 $ hg status -S
723 M s/a
723 M s/a
724 A s/b
724 A s/b
725 ? s/c
725 ? s/c
726 $ hg update -C
726 $ hg update -C
727 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
727 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
728 $ hg status -S
728 $ hg status -S
729 ? s/b
729 ? s/b
730 ? s/c
730 ? s/c
731
731
732 Sticky subrepositories, no changes
732 Sticky subrepositories, no changes
733 $ cd $TESTTMP/sub/t
733 $ cd $TESTTMP/sub/t
734 $ hg id
734 $ hg id
735 925c17564ef8 tip
735 925c17564ef8 tip
736 $ hg -R s id
736 $ hg -R s id
737 12a213df6fa9 tip
737 12a213df6fa9 tip
738 $ hg -R t id
738 $ hg -R t id
739 52c0adc0515a tip
739 52c0adc0515a tip
740 $ hg update 11
740 $ hg update 11
741 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
742 $ hg id
742 $ hg id
743 365661e5936a
743 365661e5936a
744 $ hg -R s id
744 $ hg -R s id
745 fc627a69481f
745 fc627a69481f
746 $ hg -R t id
746 $ hg -R t id
747 e95bcfa18a35
747 e95bcfa18a35
748
748
749 Sticky subrepositorys, file changes
749 Sticky subrepositorys, file changes
750 $ touch s/f1
750 $ touch s/f1
751 $ touch t/f1
751 $ touch t/f1
752 $ hg add -S s/f1
752 $ hg add -S s/f1
753 $ hg add -S t/f1
753 $ hg add -S t/f1
754 $ hg id
754 $ hg id
755 365661e5936a
755 365661e5936a
756 $ hg -R s id
756 $ hg -R s id
757 fc627a69481f+
757 fc627a69481f+
758 $ hg -R t id
758 $ hg -R t id
759 e95bcfa18a35+
759 e95bcfa18a35+
760 $ hg update tip
760 $ hg update tip
761 subrepository sources for s differ
761 subrepository sources for s differ
762 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
762 use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
763 l
763 l
764 subrepository sources for t differ
764 subrepository sources for t differ
765 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
765 use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
766 l
766 l
767 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
767 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 $ hg id
768 $ hg id
769 925c17564ef8+ tip
769 925c17564ef8+ tip
770 $ hg -R s id
770 $ hg -R s id
771 fc627a69481f+
771 fc627a69481f+
772 $ hg -R t id
772 $ hg -R t id
773 e95bcfa18a35+
773 e95bcfa18a35+
774 $ hg update --clean tip
774 $ hg update --clean tip
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776
776
777 Sticky subrepository, revision updates
777 Sticky subrepository, revision updates
778 $ hg id
778 $ hg id
779 925c17564ef8 tip
779 925c17564ef8 tip
780 $ hg -R s id
780 $ hg -R s id
781 12a213df6fa9 tip
781 12a213df6fa9 tip
782 $ hg -R t id
782 $ hg -R t id
783 52c0adc0515a tip
783 52c0adc0515a tip
784 $ cd s
784 $ cd s
785 $ hg update -r -2
785 $ hg update -r -2
786 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
786 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 $ cd ../t
787 $ cd ../t
788 $ hg update -r 2
788 $ hg update -r 2
789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
790 $ cd ..
790 $ cd ..
791 $ hg update 10
791 $ hg update 10
792 subrepository sources for t differ (in checked out version)
792 subrepository sources for t differ (in checked out version)
793 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
793 use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
794 l
794 l
795 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 $ hg id
796 $ hg id
797 e45c8b14af55+
797 e45c8b14af55+
798 $ hg -R s id
798 $ hg -R s id
799 1c833a7a9e3a
799 1c833a7a9e3a
800 $ hg -R t id
800 $ hg -R t id
801 7af322bc1198
801 7af322bc1198
802
802
803 Sticky subrepository, file changes and revision updates
803 Sticky subrepository, file changes and revision updates
804 $ touch s/f1
804 $ touch s/f1
805 $ touch t/f1
805 $ touch t/f1
806 $ hg add -S s/f1
806 $ hg add -S s/f1
807 $ hg add -S t/f1
807 $ hg add -S t/f1
808 $ hg id
808 $ hg id
809 e45c8b14af55+
809 e45c8b14af55+
810 $ hg -R s id
810 $ hg -R s id
811 1c833a7a9e3a+
811 1c833a7a9e3a+
812 $ hg -R t id
812 $ hg -R t id
813 7af322bc1198+
813 7af322bc1198+
814 $ hg update tip
814 $ hg update tip
815 subrepository sources for s differ
815 subrepository sources for s differ
816 use (l)ocal source (1c833a7a9e3a) or (r)emote source (12a213df6fa9)?
816 use (l)ocal source (1c833a7a9e3a) or (r)emote source (12a213df6fa9)?
817 l
817 l
818 subrepository sources for t differ
818 subrepository sources for t differ
819 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
819 use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
820 l
820 l
821 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
821 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 $ hg id
822 $ hg id
823 925c17564ef8 tip
823 925c17564ef8 tip
824 $ hg -R s id
824 $ hg -R s id
825 1c833a7a9e3a+
825 1c833a7a9e3a+
826 $ hg -R t id
826 $ hg -R t id
827 7af322bc1198+
827 7af322bc1198+
828
828
829 Sticky repository, update --clean
829 Sticky repository, update --clean
830 $ hg update --clean tip
830 $ hg update --clean tip
831 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
831 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
832 $ hg id
832 $ hg id
833 925c17564ef8 tip
833 925c17564ef8 tip
834 $ hg -R s id
834 $ hg -R s id
835 12a213df6fa9 tip
835 12a213df6fa9 tip
836 $ hg -R t id
836 $ hg -R t id
837 52c0adc0515a tip
837 52c0adc0515a tip
838
838
839 Test subrepo already at intended revision:
839 Test subrepo already at intended revision:
840 $ cd s
840 $ cd s
841 $ hg update fc627a69481f
841 $ hg update fc627a69481f
842 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
842 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 $ cd ..
843 $ cd ..
844 $ hg update 11
844 $ hg update 11
845 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
846 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
846 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 $ hg id -n
847 $ hg id -n
848 11+
848 11+
849 $ hg -R s id
849 $ hg -R s id
850 fc627a69481f
850 fc627a69481f
851 $ hg -R t id
851 $ hg -R t id
852 e95bcfa18a35
852 e95bcfa18a35
853
853
854 Test that removing .hgsubstate doesn't break anything:
854 Test that removing .hgsubstate doesn't break anything:
855
855
856 $ hg rm -f .hgsubstate
856 $ hg rm -f .hgsubstate
857 $ hg ci -mrm
857 $ hg ci -mrm
858 committing subrepository s
858 committing subrepository s
859 committing subrepository t
859 committing subrepository t
860 created new head
860 created new head
861 $ hg log -vr tip
861 $ hg log -vr tip
862 changeset: 14:3941e0aa5236
862 changeset: 14:3941e0aa5236
863 tag: tip
863 tag: tip
864 parent: 11:365661e5936a
864 parent: 11:365661e5936a
865 user: test
865 user: test
866 date: Thu Jan 01 00:00:00 1970 +0000
866 date: Thu Jan 01 00:00:00 1970 +0000
867 description:
867 description:
868 rm
868 rm
869
869
870
870
871
871
872 Test that removing .hgsub removes .hgsubstate:
872 Test that removing .hgsub removes .hgsubstate:
873
873
874 $ hg rm .hgsub
874 $ hg rm .hgsub
875 $ hg ci -mrm2
875 $ hg ci -mrm2
876 $ hg log -vr tip
876 $ hg log -vr tip
877 changeset: 15:8b31de9d13d1
877 changeset: 15:8b31de9d13d1
878 tag: tip
878 tag: tip
879 user: test
879 user: test
880 date: Thu Jan 01 00:00:00 1970 +0000
880 date: Thu Jan 01 00:00:00 1970 +0000
881 files: .hgsub .hgsubstate
881 files: .hgsub .hgsubstate
882 description:
882 description:
883 rm2
883 rm2
884
884
885
885
886 Test behavior of add for explicit path in subrepo:
886 Test behavior of add for explicit path in subrepo:
887 $ cd ..
887 $ cd ..
888 $ hg init addtests
888 $ hg init addtests
889 $ cd addtests
889 $ cd addtests
890 $ echo s = s > .hgsub
890 $ echo s = s > .hgsub
891 $ hg add .hgsub
891 $ hg add .hgsub
892 $ hg init s
892 $ hg init s
893 $ hg ci -m0
893 $ hg ci -m0
894 committing subrepository s
894 committing subrepository s
895 Adding with an explicit path in a subrepo adds the file
895 Adding with an explicit path in a subrepo adds the file
896 $ echo c1 > f1
896 $ echo c1 > f1
897 $ echo c2 > s/f2
897 $ echo c2 > s/f2
898 $ hg st -S
898 $ hg st -S
899 ? f1
899 ? f1
900 ? s/f2
900 ? s/f2
901 $ hg add s/f2
901 $ hg add s/f2
902 $ hg st -S
902 $ hg st -S
903 A s/f2
903 A s/f2
904 ? f1
904 ? f1
905 $ hg ci -R s -m0
905 $ hg ci -R s -m0
906 $ hg ci -Am1
906 $ hg ci -Am1
907 adding f1
907 adding f1
908 committing subrepository s
908 committing subrepository s
909 Adding with an explicit path in a subrepo with -S has the same behavior
909 Adding with an explicit path in a subrepo with -S has the same behavior
910 $ echo c3 > f3
910 $ echo c3 > f3
911 $ echo c4 > s/f4
911 $ echo c4 > s/f4
912 $ hg st -S
912 $ hg st -S
913 ? f3
913 ? f3
914 ? s/f4
914 ? s/f4
915 $ hg add -S s/f4
915 $ hg add -S s/f4
916 $ hg st -S
916 $ hg st -S
917 A s/f4
917 A s/f4
918 ? f3
918 ? f3
919 $ hg ci -R s -m1
919 $ hg ci -R s -m1
920 $ hg ci -Ama2
920 $ hg ci -Ama2
921 adding f3
921 adding f3
922 committing subrepository s
922 committing subrepository s
923 Adding without a path or pattern silently ignores subrepos
923 Adding without a path or pattern silently ignores subrepos
924 $ echo c5 > f5
924 $ echo c5 > f5
925 $ echo c6 > s/f6
925 $ echo c6 > s/f6
926 $ echo c7 > s/f7
926 $ echo c7 > s/f7
927 $ hg st -S
927 $ hg st -S
928 ? f5
928 ? f5
929 ? s/f6
929 ? s/f6
930 ? s/f7
930 ? s/f7
931 $ hg add
931 $ hg add
932 adding f5
932 adding f5
933 $ hg st -S
933 $ hg st -S
934 A f5
934 A f5
935 ? s/f6
935 ? s/f6
936 ? s/f7
936 ? s/f7
937 $ hg ci -R s -Am2
937 $ hg ci -R s -Am2
938 adding f6
938 adding f6
939 adding f7
939 adding f7
940 $ hg ci -m3
940 $ hg ci -m3
941 committing subrepository s
941 committing subrepository s
942 Adding without a path or pattern with -S also adds files in subrepos
942 Adding without a path or pattern with -S also adds files in subrepos
943 $ echo c8 > f8
943 $ echo c8 > f8
944 $ echo c9 > s/f9
944 $ echo c9 > s/f9
945 $ echo c10 > s/f10
945 $ echo c10 > s/f10
946 $ hg st -S
946 $ hg st -S
947 ? f8
947 ? f8
948 ? s/f10
948 ? s/f10
949 ? s/f9
949 ? s/f9
950 $ hg add -S
950 $ hg add -S
951 adding f8
951 adding f8
952 adding s/f10
952 adding s/f10
953 adding s/f9
953 adding s/f9
954 $ hg st -S
954 $ hg st -S
955 A f8
955 A f8
956 A s/f10
956 A s/f10
957 A s/f9
957 A s/f9
958 $ hg ci -R s -m3
958 $ hg ci -R s -m3
959 $ hg ci -m4
959 $ hg ci -m4
960 committing subrepository s
960 committing subrepository s
961 Adding with a pattern silently ignores subrepos
961 Adding with a pattern silently ignores subrepos
962 $ echo c11 > fm11
962 $ echo c11 > fm11
963 $ echo c12 > fn12
963 $ echo c12 > fn12
964 $ echo c13 > s/fm13
964 $ echo c13 > s/fm13
965 $ echo c14 > s/fn14
965 $ echo c14 > s/fn14
966 $ hg st -S
966 $ hg st -S
967 ? fm11
967 ? fm11
968 ? fn12
968 ? fn12
969 ? s/fm13
969 ? s/fm13
970 ? s/fn14
970 ? s/fn14
971 $ hg add 'glob:**fm*'
971 $ hg add 'glob:**fm*'
972 adding fm11
972 adding fm11
973 $ hg st -S
973 $ hg st -S
974 A fm11
974 A fm11
975 ? fn12
975 ? fn12
976 ? s/fm13
976 ? s/fm13
977 ? s/fn14
977 ? s/fn14
978 $ hg ci -R s -Am4
978 $ hg ci -R s -Am4
979 adding fm13
979 adding fm13
980 adding fn14
980 adding fn14
981 $ hg ci -Am5
981 $ hg ci -Am5
982 adding fn12
982 adding fn12
983 committing subrepository s
983 committing subrepository s
984 Adding with a pattern with -S also adds matches in subrepos
984 Adding with a pattern with -S also adds matches in subrepos
985 $ echo c15 > fm15
985 $ echo c15 > fm15
986 $ echo c16 > fn16
986 $ echo c16 > fn16
987 $ echo c17 > s/fm17
987 $ echo c17 > s/fm17
988 $ echo c18 > s/fn18
988 $ echo c18 > s/fn18
989 $ hg st -S
989 $ hg st -S
990 ? fm15
990 ? fm15
991 ? fn16
991 ? fn16
992 ? s/fm17
992 ? s/fm17
993 ? s/fn18
993 ? s/fn18
994 $ hg add -S 'glob:**fm*'
994 $ hg add -S 'glob:**fm*'
995 adding fm15
995 adding fm15
996 adding s/fm17
996 adding s/fm17
997 $ hg st -S
997 $ hg st -S
998 A fm15
998 A fm15
999 A s/fm17
999 A s/fm17
1000 ? fn16
1000 ? fn16
1001 ? s/fn18
1001 ? s/fn18
1002 $ hg ci -R s -Am5
1002 $ hg ci -R s -Am5
1003 adding fn18
1003 adding fn18
1004 $ hg ci -Am6
1004 $ hg ci -Am6
1005 adding fn16
1005 adding fn16
1006 committing subrepository s
1006 committing subrepository s
1007 $ cd ..
1007 $ cd ..
@@ -1,207 +1,207 b''
1 Test basic functionality of url#rev syntax
1 Test basic functionality of url#rev syntax
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5 $ echo a > a
5 $ echo a > a
6 $ hg ci -qAm 'add a'
6 $ hg ci -qAm 'add a'
7 $ hg branch foo
7 $ hg branch foo
8 marked working directory as branch foo
8 marked working directory as branch foo
9 $ echo >> a
9 $ echo >> a
10 $ hg ci -m 'change a'
10 $ hg ci -m 'change a'
11 $ cd ..
11 $ cd ..
12
12
13 $ hg clone 'repo#foo' clone
13 $ hg clone 'repo#foo' clone
14 adding changesets
14 adding changesets
15 adding manifests
15 adding manifests
16 adding file changes
16 adding file changes
17 added 2 changesets with 2 changes to 1 files
17 added 2 changesets with 2 changes to 1 files
18 updating to branch foo
18 updating to branch foo
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
20
20
21 $ hg --cwd clone heads
21 $ hg --cwd clone heads
22 changeset: 1:cd2a86ecc814
22 changeset: 1:cd2a86ecc814
23 branch: foo
23 branch: foo
24 tag: tip
24 tag: tip
25 user: test
25 user: test
26 date: Thu Jan 01 00:00:00 1970 +0000
26 date: Thu Jan 01 00:00:00 1970 +0000
27 summary: change a
27 summary: change a
28
28
29 changeset: 0:1f0dee641bb7
29 changeset: 0:1f0dee641bb7
30 user: test
30 user: test
31 date: Thu Jan 01 00:00:00 1970 +0000
31 date: Thu Jan 01 00:00:00 1970 +0000
32 summary: add a
32 summary: add a
33
33
34 $ hg --cwd clone parents
34 $ hg --cwd clone parents
35 changeset: 1:cd2a86ecc814
35 changeset: 1:cd2a86ecc814
36 branch: foo
36 branch: foo
37 tag: tip
37 tag: tip
38 user: test
38 user: test
39 date: Thu Jan 01 00:00:00 1970 +0000
39 date: Thu Jan 01 00:00:00 1970 +0000
40 summary: change a
40 summary: change a
41
41
42 $ cat clone/.hg/hgrc
42 $ cat clone/.hg/hgrc
43 [paths]
43 [paths]
44 default = $TESTTMP/repo#foo
44 default = $TESTTMP/repo#foo (glob)
45
45
46 Changing original repo:
46 Changing original repo:
47
47
48 $ cd repo
48 $ cd repo
49
49
50 $ echo >> a
50 $ echo >> a
51 $ hg ci -m 'new head of branch foo'
51 $ hg ci -m 'new head of branch foo'
52
52
53 $ hg up -qC default
53 $ hg up -qC default
54 $ echo bar > bar
54 $ echo bar > bar
55 $ hg ci -qAm 'add bar'
55 $ hg ci -qAm 'add bar'
56
56
57 $ hg log
57 $ hg log
58 changeset: 3:4cd725637392
58 changeset: 3:4cd725637392
59 tag: tip
59 tag: tip
60 parent: 0:1f0dee641bb7
60 parent: 0:1f0dee641bb7
61 user: test
61 user: test
62 date: Thu Jan 01 00:00:00 1970 +0000
62 date: Thu Jan 01 00:00:00 1970 +0000
63 summary: add bar
63 summary: add bar
64
64
65 changeset: 2:faba9097cad4
65 changeset: 2:faba9097cad4
66 branch: foo
66 branch: foo
67 user: test
67 user: test
68 date: Thu Jan 01 00:00:00 1970 +0000
68 date: Thu Jan 01 00:00:00 1970 +0000
69 summary: new head of branch foo
69 summary: new head of branch foo
70
70
71 changeset: 1:cd2a86ecc814
71 changeset: 1:cd2a86ecc814
72 branch: foo
72 branch: foo
73 user: test
73 user: test
74 date: Thu Jan 01 00:00:00 1970 +0000
74 date: Thu Jan 01 00:00:00 1970 +0000
75 summary: change a
75 summary: change a
76
76
77 changeset: 0:1f0dee641bb7
77 changeset: 0:1f0dee641bb7
78 user: test
78 user: test
79 date: Thu Jan 01 00:00:00 1970 +0000
79 date: Thu Jan 01 00:00:00 1970 +0000
80 summary: add a
80 summary: add a
81
81
82 $ hg -q outgoing '../clone#foo'
82 $ hg -q outgoing '../clone#foo'
83 2:faba9097cad4
83 2:faba9097cad4
84
84
85 $ hg -q push '../clone#foo'
85 $ hg -q push '../clone#foo'
86
86
87 $ hg --cwd ../clone heads
87 $ hg --cwd ../clone heads
88 changeset: 2:faba9097cad4
88 changeset: 2:faba9097cad4
89 branch: foo
89 branch: foo
90 tag: tip
90 tag: tip
91 user: test
91 user: test
92 date: Thu Jan 01 00:00:00 1970 +0000
92 date: Thu Jan 01 00:00:00 1970 +0000
93 summary: new head of branch foo
93 summary: new head of branch foo
94
94
95 changeset: 0:1f0dee641bb7
95 changeset: 0:1f0dee641bb7
96 user: test
96 user: test
97 date: Thu Jan 01 00:00:00 1970 +0000
97 date: Thu Jan 01 00:00:00 1970 +0000
98 summary: add a
98 summary: add a
99
99
100 $ cd ..
100 $ cd ..
101
101
102 $ cd clone
102 $ cd clone
103 $ hg rollback
103 $ hg rollback
104 repository tip rolled back to revision 1 (undo push)
104 repository tip rolled back to revision 1 (undo push)
105
105
106 $ hg -q incoming
106 $ hg -q incoming
107 2:faba9097cad4
107 2:faba9097cad4
108
108
109 $ hg -q pull
109 $ hg -q pull
110
110
111 $ hg heads
111 $ hg heads
112 changeset: 2:faba9097cad4
112 changeset: 2:faba9097cad4
113 branch: foo
113 branch: foo
114 tag: tip
114 tag: tip
115 user: test
115 user: test
116 date: Thu Jan 01 00:00:00 1970 +0000
116 date: Thu Jan 01 00:00:00 1970 +0000
117 summary: new head of branch foo
117 summary: new head of branch foo
118
118
119 changeset: 0:1f0dee641bb7
119 changeset: 0:1f0dee641bb7
120 user: test
120 user: test
121 date: Thu Jan 01 00:00:00 1970 +0000
121 date: Thu Jan 01 00:00:00 1970 +0000
122 summary: add a
122 summary: add a
123
123
124 Pull should not have updated:
124 Pull should not have updated:
125
125
126 $ hg parents -q
126 $ hg parents -q
127 1:cd2a86ecc814
127 1:cd2a86ecc814
128
128
129 Going back to the default branch:
129 Going back to the default branch:
130
130
131 $ hg up -C 0
131 $ hg up -C 0
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133
133
134 $ hg parents
134 $ hg parents
135 changeset: 0:1f0dee641bb7
135 changeset: 0:1f0dee641bb7
136 user: test
136 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
137 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: add a
138 summary: add a
139
139
140 No new revs, no update:
140 No new revs, no update:
141
141
142 $ hg pull -qu
142 $ hg pull -qu
143
143
144 $ hg parents -q
144 $ hg parents -q
145 0:1f0dee641bb7
145 0:1f0dee641bb7
146
146
147 $ hg rollback
147 $ hg rollback
148 repository tip rolled back to revision 1 (undo pull)
148 repository tip rolled back to revision 1 (undo pull)
149
149
150 $ hg parents -q
150 $ hg parents -q
151 0:1f0dee641bb7
151 0:1f0dee641bb7
152
152
153 Pull -u takes us back to branch foo:
153 Pull -u takes us back to branch foo:
154
154
155 $ hg pull -qu
155 $ hg pull -qu
156
156
157 $ hg parents
157 $ hg parents
158 changeset: 2:faba9097cad4
158 changeset: 2:faba9097cad4
159 branch: foo
159 branch: foo
160 tag: tip
160 tag: tip
161 user: test
161 user: test
162 date: Thu Jan 01 00:00:00 1970 +0000
162 date: Thu Jan 01 00:00:00 1970 +0000
163 summary: new head of branch foo
163 summary: new head of branch foo
164
164
165 $ hg rollback
165 $ hg rollback
166 repository tip rolled back to revision 1 (undo pull)
166 repository tip rolled back to revision 1 (undo pull)
167 working directory now based on revision 0
167 working directory now based on revision 0
168
168
169 $ hg up -C 0
169 $ hg up -C 0
170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
171
171
172 $ hg parents -q
172 $ hg parents -q
173 0:1f0dee641bb7
173 0:1f0dee641bb7
174
174
175 $ hg heads -q
175 $ hg heads -q
176 1:cd2a86ecc814
176 1:cd2a86ecc814
177 0:1f0dee641bb7
177 0:1f0dee641bb7
178
178
179 $ hg pull -qur default default
179 $ hg pull -qur default default
180
180
181 $ hg parents
181 $ hg parents
182 changeset: 3:4cd725637392
182 changeset: 3:4cd725637392
183 tag: tip
183 tag: tip
184 parent: 0:1f0dee641bb7
184 parent: 0:1f0dee641bb7
185 user: test
185 user: test
186 date: Thu Jan 01 00:00:00 1970 +0000
186 date: Thu Jan 01 00:00:00 1970 +0000
187 summary: add bar
187 summary: add bar
188
188
189 $ hg heads
189 $ hg heads
190 changeset: 3:4cd725637392
190 changeset: 3:4cd725637392
191 tag: tip
191 tag: tip
192 parent: 0:1f0dee641bb7
192 parent: 0:1f0dee641bb7
193 user: test
193 user: test
194 date: Thu Jan 01 00:00:00 1970 +0000
194 date: Thu Jan 01 00:00:00 1970 +0000
195 summary: add bar
195 summary: add bar
196
196
197 changeset: 2:faba9097cad4
197 changeset: 2:faba9097cad4
198 branch: foo
198 branch: foo
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: new head of branch foo
201 summary: new head of branch foo
202
202
203 Test handling of invalid urls
203 Test handling of invalid urls
204
204
205 $ hg id http://foo/?bar
205 $ hg id http://foo/?bar
206 abort: unsupported URL component: "bar"
206 abort: unsupported URL component: "bar"
207 [255]
207 [255]
@@ -1,424 +1,424 b''
1
1
2 $ hg init t
2 $ hg init t
3 $ cd t
3 $ cd t
4 $ cat > unix2dos.py <<EOF
4 $ cat > unix2dos.py <<EOF
5 > import sys
5 > import sys
6 >
6 >
7 > for path in sys.argv[1:]:
7 > for path in sys.argv[1:]:
8 > data = file(path, 'rb').read()
8 > data = file(path, 'rb').read()
9 > data = data.replace('\n', '\r\n')
9 > data = data.replace('\n', '\r\n')
10 > file(path, 'wb').write(data)
10 > file(path, 'wb').write(data)
11 > EOF
11 > EOF
12 $ echo '[hooks]' >> .hg/hgrc
12 $ echo '[hooks]' >> .hg/hgrc
13 $ echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
13 $ echo 'pretxncommit.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
14 $ echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
14 $ echo 'pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf' >> .hg/hgrc
15 $ cat .hg/hgrc
15 $ cat .hg/hgrc
16 [hooks]
16 [hooks]
17 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
17 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
18 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
18 pretxnchangegroup.crlf = python:hgext.win32text.forbidcrlf
19
19
20 $ echo hello > f
20 $ echo hello > f
21 $ hg add f
21 $ hg add f
22
22
23 commit should succeed
23 commit should succeed
24
24
25 $ hg ci -m 1
25 $ hg ci -m 1
26
26
27 $ hg clone . ../zoz
27 $ hg clone . ../zoz
28 updating to branch default
28 updating to branch default
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 $ cp .hg/hgrc ../zoz/.hg
30 $ cp .hg/hgrc ../zoz/.hg
31 $ python unix2dos.py f
31 $ python unix2dos.py f
32
32
33 commit should fail
33 commit should fail
34
34
35 $ hg ci -m 2.1
35 $ hg ci -m 2.1
36 Attempt to commit or push text file(s) using CRLF line endings
36 Attempt to commit or push text file(s) using CRLF line endings
37 in f583ea08d42a: f
37 in f583ea08d42a: f
38 transaction abort!
38 transaction abort!
39 rollback completed
39 rollback completed
40 abort: pretxncommit.crlf hook failed
40 abort: pretxncommit.crlf hook failed
41 [255]
41 [255]
42
42
43 $ mv .hg/hgrc .hg/hgrc.bak
43 $ mv .hg/hgrc .hg/hgrc.bak
44
44
45 commits should succeed
45 commits should succeed
46
46
47 $ hg ci -m 2
47 $ hg ci -m 2
48 $ hg cp f g
48 $ hg cp f g
49 $ hg ci -m 2.2
49 $ hg ci -m 2.2
50
50
51 push should fail
51 push should fail
52
52
53 $ hg push ../zoz
53 $ hg push ../zoz
54 pushing to ../zoz
54 pushing to ../zoz
55 searching for changes
55 searching for changes
56 adding changesets
56 adding changesets
57 adding manifests
57 adding manifests
58 adding file changes
58 adding file changes
59 added 2 changesets with 2 changes to 2 files
59 added 2 changesets with 2 changes to 2 files
60 Attempt to commit or push text file(s) using CRLF line endings
60 Attempt to commit or push text file(s) using CRLF line endings
61 in bc2d09796734: g
61 in bc2d09796734: g
62 in b1aa5cde7ff4: f
62 in b1aa5cde7ff4: f
63
63
64 To prevent this mistake in your local repository,
64 To prevent this mistake in your local repository,
65 add to Mercurial.ini or .hg/hgrc:
65 add to Mercurial.ini or .hg/hgrc:
66
66
67 [hooks]
67 [hooks]
68 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
68 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
69
69
70 and also consider adding:
70 and also consider adding:
71
71
72 [extensions]
72 [extensions]
73 win32text =
73 win32text =
74 [encode]
74 [encode]
75 ** = cleverencode:
75 ** = cleverencode:
76 [decode]
76 [decode]
77 ** = cleverdecode:
77 ** = cleverdecode:
78 transaction abort!
78 transaction abort!
79 rollback completed
79 rollback completed
80 abort: pretxnchangegroup.crlf hook failed
80 abort: pretxnchangegroup.crlf hook failed
81 [255]
81 [255]
82
82
83 $ mv .hg/hgrc.bak .hg/hgrc
83 $ mv .hg/hgrc.bak .hg/hgrc
84 $ echo hello > f
84 $ echo hello > f
85 $ hg rm g
85 $ hg rm g
86
86
87 commit should succeed
87 commit should succeed
88
88
89 $ hg ci -m 2.3
89 $ hg ci -m 2.3
90
90
91 push should succeed
91 push should succeed
92
92
93 $ hg push ../zoz
93 $ hg push ../zoz
94 pushing to ../zoz
94 pushing to ../zoz
95 searching for changes
95 searching for changes
96 adding changesets
96 adding changesets
97 adding manifests
97 adding manifests
98 adding file changes
98 adding file changes
99 added 3 changesets with 3 changes to 2 files
99 added 3 changesets with 3 changes to 2 files
100
100
101 and now for something completely different
101 and now for something completely different
102
102
103 $ mkdir d
103 $ mkdir d
104 $ echo hello > d/f2
104 $ echo hello > d/f2
105 $ python unix2dos.py d/f2
105 $ python unix2dos.py d/f2
106 $ hg add d/f2
106 $ hg add d/f2
107 $ hg ci -m 3
107 $ hg ci -m 3
108 Attempt to commit or push text file(s) using CRLF line endings
108 Attempt to commit or push text file(s) using CRLF line endings
109 in 053ba1a3035a: d/f2
109 in 053ba1a3035a: d/f2
110 transaction abort!
110 transaction abort!
111 rollback completed
111 rollback completed
112 abort: pretxncommit.crlf hook failed
112 abort: pretxncommit.crlf hook failed
113 [255]
113 [255]
114 $ hg revert -a
114 $ hg revert -a
115 forgetting d/f2
115 forgetting d/f2
116 $ rm d/f2
116 $ rm d/f2
117
117
118 $ hg rem f
118 $ hg rem f
119 $ hg ci -m 4
119 $ hg ci -m 4
120
120
121 $ python -c 'file("bin", "wb").write("hello\x00\x0D\x0A")'
121 $ python -c 'file("bin", "wb").write("hello\x00\x0D\x0A")'
122 $ hg add bin
122 $ hg add bin
123 $ hg ci -m 5
123 $ hg ci -m 5
124 $ hg log -v
124 $ hg log -v
125 changeset: 5:f0b1c8d75fce
125 changeset: 5:f0b1c8d75fce
126 tag: tip
126 tag: tip
127 user: test
127 user: test
128 date: Thu Jan 01 00:00:00 1970 +0000
128 date: Thu Jan 01 00:00:00 1970 +0000
129 files: bin
129 files: bin
130 description:
130 description:
131 5
131 5
132
132
133
133
134 changeset: 4:77796dbcd4ad
134 changeset: 4:77796dbcd4ad
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 files: f
137 files: f
138 description:
138 description:
139 4
139 4
140
140
141
141
142 changeset: 3:7c1b5430b350
142 changeset: 3:7c1b5430b350
143 user: test
143 user: test
144 date: Thu Jan 01 00:00:00 1970 +0000
144 date: Thu Jan 01 00:00:00 1970 +0000
145 files: f g
145 files: f g
146 description:
146 description:
147 2.3
147 2.3
148
148
149
149
150 changeset: 2:bc2d09796734
150 changeset: 2:bc2d09796734
151 user: test
151 user: test
152 date: Thu Jan 01 00:00:00 1970 +0000
152 date: Thu Jan 01 00:00:00 1970 +0000
153 files: g
153 files: g
154 description:
154 description:
155 2.2
155 2.2
156
156
157
157
158 changeset: 1:b1aa5cde7ff4
158 changeset: 1:b1aa5cde7ff4
159 user: test
159 user: test
160 date: Thu Jan 01 00:00:00 1970 +0000
160 date: Thu Jan 01 00:00:00 1970 +0000
161 files: f
161 files: f
162 description:
162 description:
163 2
163 2
164
164
165
165
166 changeset: 0:fcf06d5c4e1d
166 changeset: 0:fcf06d5c4e1d
167 user: test
167 user: test
168 date: Thu Jan 01 00:00:00 1970 +0000
168 date: Thu Jan 01 00:00:00 1970 +0000
169 files: f
169 files: f
170 description:
170 description:
171 1
171 1
172
172
173
173
174 $ hg clone . dupe
174 $ hg clone . dupe
175 updating to branch default
175 updating to branch default
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
177
177
178 $ for x in a b c d; do echo content > dupe/$x; done
178 $ for x in a b c d; do echo content > dupe/$x; done
179 $ hg -R dupe add
179 $ hg -R dupe add
180 adding dupe/a
180 adding dupe/a
181 adding dupe/b
181 adding dupe/b
182 adding dupe/c
182 adding dupe/c
183 adding dupe/d
183 adding dupe/d
184 $ python unix2dos.py dupe/b dupe/c dupe/d
184 $ python unix2dos.py dupe/b dupe/c dupe/d
185 $ hg -R dupe ci -m a dupe/a
185 $ hg -R dupe ci -m a dupe/a
186 $ hg -R dupe ci -m b/c dupe/[bc]
186 $ hg -R dupe ci -m b/c dupe/[bc]
187 $ hg -R dupe ci -m d dupe/d
187 $ hg -R dupe ci -m d dupe/d
188 $ hg -R dupe log -v
188 $ hg -R dupe log -v
189 changeset: 8:67ac5962ab43
189 changeset: 8:67ac5962ab43
190 tag: tip
190 tag: tip
191 user: test
191 user: test
192 date: Thu Jan 01 00:00:00 1970 +0000
192 date: Thu Jan 01 00:00:00 1970 +0000
193 files: d
193 files: d
194 description:
194 description:
195 d
195 d
196
196
197
197
198 changeset: 7:68c127d1834e
198 changeset: 7:68c127d1834e
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 files: b c
201 files: b c
202 description:
202 description:
203 b/c
203 b/c
204
204
205
205
206 changeset: 6:adbf8bf7f31d
206 changeset: 6:adbf8bf7f31d
207 user: test
207 user: test
208 date: Thu Jan 01 00:00:00 1970 +0000
208 date: Thu Jan 01 00:00:00 1970 +0000
209 files: a
209 files: a
210 description:
210 description:
211 a
211 a
212
212
213
213
214 changeset: 5:f0b1c8d75fce
214 changeset: 5:f0b1c8d75fce
215 user: test
215 user: test
216 date: Thu Jan 01 00:00:00 1970 +0000
216 date: Thu Jan 01 00:00:00 1970 +0000
217 files: bin
217 files: bin
218 description:
218 description:
219 5
219 5
220
220
221
221
222 changeset: 4:77796dbcd4ad
222 changeset: 4:77796dbcd4ad
223 user: test
223 user: test
224 date: Thu Jan 01 00:00:00 1970 +0000
224 date: Thu Jan 01 00:00:00 1970 +0000
225 files: f
225 files: f
226 description:
226 description:
227 4
227 4
228
228
229
229
230 changeset: 3:7c1b5430b350
230 changeset: 3:7c1b5430b350
231 user: test
231 user: test
232 date: Thu Jan 01 00:00:00 1970 +0000
232 date: Thu Jan 01 00:00:00 1970 +0000
233 files: f g
233 files: f g
234 description:
234 description:
235 2.3
235 2.3
236
236
237
237
238 changeset: 2:bc2d09796734
238 changeset: 2:bc2d09796734
239 user: test
239 user: test
240 date: Thu Jan 01 00:00:00 1970 +0000
240 date: Thu Jan 01 00:00:00 1970 +0000
241 files: g
241 files: g
242 description:
242 description:
243 2.2
243 2.2
244
244
245
245
246 changeset: 1:b1aa5cde7ff4
246 changeset: 1:b1aa5cde7ff4
247 user: test
247 user: test
248 date: Thu Jan 01 00:00:00 1970 +0000
248 date: Thu Jan 01 00:00:00 1970 +0000
249 files: f
249 files: f
250 description:
250 description:
251 2
251 2
252
252
253
253
254 changeset: 0:fcf06d5c4e1d
254 changeset: 0:fcf06d5c4e1d
255 user: test
255 user: test
256 date: Thu Jan 01 00:00:00 1970 +0000
256 date: Thu Jan 01 00:00:00 1970 +0000
257 files: f
257 files: f
258 description:
258 description:
259 1
259 1
260
260
261
261
262 $ hg pull dupe
262 $ hg pull dupe
263 pulling from dupe
263 pulling from dupe
264 searching for changes
264 searching for changes
265 adding changesets
265 adding changesets
266 adding manifests
266 adding manifests
267 adding file changes
267 adding file changes
268 added 3 changesets with 4 changes to 4 files
268 added 3 changesets with 4 changes to 4 files
269 Attempt to commit or push text file(s) using CRLF line endings
269 Attempt to commit or push text file(s) using CRLF line endings
270 in 67ac5962ab43: d
270 in 67ac5962ab43: d
271 in 68c127d1834e: b
271 in 68c127d1834e: b
272 in 68c127d1834e: c
272 in 68c127d1834e: c
273
273
274 To prevent this mistake in your local repository,
274 To prevent this mistake in your local repository,
275 add to Mercurial.ini or .hg/hgrc:
275 add to Mercurial.ini or .hg/hgrc:
276
276
277 [hooks]
277 [hooks]
278 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
278 pretxncommit.crlf = python:hgext.win32text.forbidcrlf
279
279
280 and also consider adding:
280 and also consider adding:
281
281
282 [extensions]
282 [extensions]
283 win32text =
283 win32text =
284 [encode]
284 [encode]
285 ** = cleverencode:
285 ** = cleverencode:
286 [decode]
286 [decode]
287 ** = cleverdecode:
287 ** = cleverdecode:
288 transaction abort!
288 transaction abort!
289 rollback completed
289 rollback completed
290 abort: pretxnchangegroup.crlf hook failed
290 abort: pretxnchangegroup.crlf hook failed
291 [255]
291 [255]
292
292
293 $ hg log -v
293 $ hg log -v
294 changeset: 5:f0b1c8d75fce
294 changeset: 5:f0b1c8d75fce
295 tag: tip
295 tag: tip
296 user: test
296 user: test
297 date: Thu Jan 01 00:00:00 1970 +0000
297 date: Thu Jan 01 00:00:00 1970 +0000
298 files: bin
298 files: bin
299 description:
299 description:
300 5
300 5
301
301
302
302
303 changeset: 4:77796dbcd4ad
303 changeset: 4:77796dbcd4ad
304 user: test
304 user: test
305 date: Thu Jan 01 00:00:00 1970 +0000
305 date: Thu Jan 01 00:00:00 1970 +0000
306 files: f
306 files: f
307 description:
307 description:
308 4
308 4
309
309
310
310
311 changeset: 3:7c1b5430b350
311 changeset: 3:7c1b5430b350
312 user: test
312 user: test
313 date: Thu Jan 01 00:00:00 1970 +0000
313 date: Thu Jan 01 00:00:00 1970 +0000
314 files: f g
314 files: f g
315 description:
315 description:
316 2.3
316 2.3
317
317
318
318
319 changeset: 2:bc2d09796734
319 changeset: 2:bc2d09796734
320 user: test
320 user: test
321 date: Thu Jan 01 00:00:00 1970 +0000
321 date: Thu Jan 01 00:00:00 1970 +0000
322 files: g
322 files: g
323 description:
323 description:
324 2.2
324 2.2
325
325
326
326
327 changeset: 1:b1aa5cde7ff4
327 changeset: 1:b1aa5cde7ff4
328 user: test
328 user: test
329 date: Thu Jan 01 00:00:00 1970 +0000
329 date: Thu Jan 01 00:00:00 1970 +0000
330 files: f
330 files: f
331 description:
331 description:
332 2
332 2
333
333
334
334
335 changeset: 0:fcf06d5c4e1d
335 changeset: 0:fcf06d5c4e1d
336 user: test
336 user: test
337 date: Thu Jan 01 00:00:00 1970 +0000
337 date: Thu Jan 01 00:00:00 1970 +0000
338 files: f
338 files: f
339 description:
339 description:
340 1
340 1
341
341
342
342
343 $ rm .hg/hgrc
343 $ rm .hg/hgrc
344 $ (echo some; echo text) > f3
344 $ (echo some; echo text) > f3
345 $ python -c 'file("f4.bat", "wb").write("rem empty\x0D\x0A")'
345 $ python -c 'file("f4.bat", "wb").write("rem empty\x0D\x0A")'
346 $ hg add f3 f4.bat
346 $ hg add f3 f4.bat
347 $ hg ci -m 6
347 $ hg ci -m 6
348 $ cat bin
348 $ cat bin
349 hello\x00\r (esc)
349 hello\x00\r (esc)
350 $ cat f3
350 $ cat f3
351 some
351 some
352 text
352 text
353 $ cat f4.bat
353 $ cat f4.bat
354 rem empty\r (esc)
354 rem empty\r (esc)
355
355
356 $ echo '[extensions]' >> .hg/hgrc
356 $ echo '[extensions]' >> .hg/hgrc
357 $ echo 'win32text = ' >> .hg/hgrc
357 $ echo 'win32text = ' >> .hg/hgrc
358 $ echo '[decode]' >> .hg/hgrc
358 $ echo '[decode]' >> .hg/hgrc
359 $ echo '** = cleverdecode:' >> .hg/hgrc
359 $ echo '** = cleverdecode:' >> .hg/hgrc
360 $ echo '[encode]' >> .hg/hgrc
360 $ echo '[encode]' >> .hg/hgrc
361 $ echo '** = cleverencode:' >> .hg/hgrc
361 $ echo '** = cleverencode:' >> .hg/hgrc
362 $ cat .hg/hgrc
362 $ cat .hg/hgrc
363 [extensions]
363 [extensions]
364 win32text =
364 win32text =
365 [decode]
365 [decode]
366 ** = cleverdecode:
366 ** = cleverdecode:
367 [encode]
367 [encode]
368 ** = cleverencode:
368 ** = cleverencode:
369
369
370 Trigger deprecation warning:
370 Trigger deprecation warning:
371
371
372 $ hg id -t
372 $ hg id -t
373 win32text is deprecated: http://mercurial.selenic.com/wiki/Win32TextExtension
373 win32text is deprecated: http://mercurial.selenic.com/wiki/Win32TextExtension
374 tip
374 tip
375
375
376 Disable warning:
376 Disable warning:
377
377
378 $ echo '[win32text]' >> .hg/hgrc
378 $ echo '[win32text]' >> .hg/hgrc
379 $ echo 'warn = no' >> .hg/hgrc
379 $ echo 'warn = no' >> .hg/hgrc
380 $ hg id -t
380 $ hg id -t
381 tip
381 tip
382
382
383 $ rm f3 f4.bat bin
383 $ rm f3 f4.bat bin
384 $ hg co -C
384 $ hg co -C
385 WARNING: f4.bat already has CRLF line endings
385 WARNING: f4.bat already has CRLF line endings
386 and does not need EOL conversion by the win32text plugin.
386 and does not need EOL conversion by the win32text plugin.
387 Before your next commit, please reconsider your encode/decode settings in
387 Before your next commit, please reconsider your encode/decode settings in
388 Mercurial.ini or $TESTTMP/t/.hg/hgrc.
388 Mercurial.ini or $TESTTMP/t/.hg/hgrc. (glob)
389 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
390 $ cat bin
390 $ cat bin
391 hello\x00\r (esc)
391 hello\x00\r (esc)
392 $ cat f3
392 $ cat f3
393 some\r (esc)
393 some\r (esc)
394 text\r (esc)
394 text\r (esc)
395 $ cat f4.bat
395 $ cat f4.bat
396 rem empty\r (esc)
396 rem empty\r (esc)
397
397
398 $ python -c 'file("f5.sh", "wb").write("# empty\x0D\x0A")'
398 $ python -c 'file("f5.sh", "wb").write("# empty\x0D\x0A")'
399 $ hg add f5.sh
399 $ hg add f5.sh
400 $ hg ci -m 7
400 $ hg ci -m 7
401 $ cat f5.sh
401 $ cat f5.sh
402 # empty\r (esc)
402 # empty\r (esc)
403 $ hg cat f5.sh
403 $ hg cat f5.sh
404 # empty
404 # empty
405 $ echo '% just linefeed' > linefeed
405 $ echo '% just linefeed' > linefeed
406 $ hg ci -qAm 8 linefeed
406 $ hg ci -qAm 8 linefeed
407 $ cat linefeed
407 $ cat linefeed
408 % just linefeed
408 % just linefeed
409 $ hg cat linefeed
409 $ hg cat linefeed
410 % just linefeed
410 % just linefeed
411 $ hg st -q
411 $ hg st -q
412 $ hg revert -a linefeed
412 $ hg revert -a linefeed
413 no changes needed to linefeed
413 no changes needed to linefeed
414 $ cat linefeed
414 $ cat linefeed
415 % just linefeed
415 % just linefeed
416 $ hg st -q
416 $ hg st -q
417 $ echo modified >> linefeed
417 $ echo modified >> linefeed
418 $ hg st -q
418 $ hg st -q
419 M linefeed
419 M linefeed
420 $ hg revert -a
420 $ hg revert -a
421 reverting linefeed
421 reverting linefeed
422 $ hg st -q
422 $ hg st -q
423 $ cat linefeed
423 $ cat linefeed
424 % just linefeed\r (esc)
424 % just linefeed\r (esc)
General Comments 0
You need to be logged in to leave comments. Login now