Show More
@@ -1,309 +1,309 | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | """Test the running system for features availability. Exit with zero |
|
2 | """Test the running system for features availability. Exit with zero | |
3 | if all features are there, non-zero otherwise. If a feature name is |
|
3 | if all features are there, non-zero otherwise. If a feature name is | |
4 | prefixed with "no-", the absence of feature is tested. |
|
4 | prefixed with "no-", the absence of feature is tested. | |
5 | """ |
|
5 | """ | |
6 | import optparse |
|
6 | import optparse | |
7 | import os |
|
7 | import os | |
8 | import re |
|
8 | import re | |
9 | import sys |
|
9 | import sys | |
10 | import tempfile |
|
10 | import tempfile | |
11 |
|
11 | |||
12 | tempprefix = 'hg-hghave-' |
|
12 | tempprefix = 'hg-hghave-' | |
13 |
|
13 | |||
14 | def matchoutput(cmd, regexp, ignorestatus=False): |
|
14 | def matchoutput(cmd, regexp, ignorestatus=False): | |
15 | """Return True if cmd executes successfully and its output |
|
15 | """Return True if cmd executes successfully and its output | |
16 | is matched by the supplied regular expression. |
|
16 | is matched by the supplied regular expression. | |
17 | """ |
|
17 | """ | |
18 | r = re.compile(regexp) |
|
18 | r = re.compile(regexp) | |
19 | fh = os.popen(cmd) |
|
19 | fh = os.popen(cmd) | |
20 | s = fh.read() |
|
20 | s = fh.read() | |
21 | try: |
|
21 | try: | |
22 | ret = fh.close() |
|
22 | ret = fh.close() | |
23 | except IOError: |
|
23 | except IOError: | |
24 | # Happen in Windows test environment |
|
24 | # Happen in Windows test environment | |
25 | ret = 1 |
|
25 | ret = 1 | |
26 | return (ignorestatus or ret is None) and r.search(s) |
|
26 | return (ignorestatus or ret is None) and r.search(s) | |
27 |
|
27 | |||
28 | def has_baz(): |
|
28 | def has_baz(): | |
29 | return matchoutput('baz --version 2>&1', r'baz Bazaar version') |
|
29 | return matchoutput('baz --version 2>&1', r'baz Bazaar version') | |
30 |
|
30 | |||
31 | def has_bzr(): |
|
31 | def has_bzr(): | |
32 | try: |
|
32 | try: | |
33 | import bzrlib |
|
33 | import bzrlib | |
34 | return bzrlib.__doc__ != None |
|
34 | return bzrlib.__doc__ != None | |
35 | except ImportError: |
|
35 | except ImportError: | |
36 | return False |
|
36 | return False | |
37 |
|
37 | |||
38 | def has_bzr114(): |
|
38 | def has_bzr114(): | |
39 | try: |
|
39 | try: | |
40 | import bzrlib |
|
40 | import bzrlib | |
41 | return (bzrlib.__doc__ != None |
|
41 | return (bzrlib.__doc__ != None | |
42 | and bzrlib.version_info[:2] >= (1, 14)) |
|
42 | and bzrlib.version_info[:2] >= (1, 14)) | |
43 | except ImportError: |
|
43 | except ImportError: | |
44 | return False |
|
44 | return False | |
45 |
|
45 | |||
46 | def has_cvs(): |
|
46 | def has_cvs(): | |
47 | re = r'Concurrent Versions System.*?server' |
|
47 | re = r'Concurrent Versions System.*?server' | |
48 | return matchoutput('cvs --version 2>&1', re) |
|
48 | return matchoutput('cvs --version 2>&1', re) | |
49 |
|
49 | |||
50 | def has_darcs(): |
|
50 | def has_darcs(): | |
51 | return matchoutput('darcs --version', r'2\.[2-9]', True) |
|
51 | return matchoutput('darcs --version', r'2\.[2-9]', True) | |
52 |
|
52 | |||
53 | def has_mtn(): |
|
53 | def has_mtn(): | |
54 | return matchoutput('mtn --version', r'monotone', True) and not matchoutput( |
|
54 | return matchoutput('mtn --version', r'monotone', True) and not matchoutput( | |
55 | 'mtn --version', r'monotone 0\.', True) |
|
55 | 'mtn --version', r'monotone 0\.', True) | |
56 |
|
56 | |||
57 | def has_eol_in_paths(): |
|
57 | def has_eol_in_paths(): | |
58 | try: |
|
58 | try: | |
59 | fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') |
|
59 | fd, path = tempfile.mkstemp(prefix=tempprefix, suffix='\n\r') | |
60 | os.close(fd) |
|
60 | os.close(fd) | |
61 | os.remove(path) |
|
61 | os.remove(path) | |
62 | return True |
|
62 | return True | |
63 | except: |
|
63 | except: | |
64 | return False |
|
64 | return False | |
65 |
|
65 | |||
66 | def has_executablebit(): |
|
66 | def has_executablebit(): | |
67 | fd, path = tempfile.mkstemp(prefix=tempprefix) |
|
67 | fd, path = tempfile.mkstemp(prefix=tempprefix) | |
68 | os.close(fd) |
|
68 | os.close(fd) | |
69 | try: |
|
69 | try: | |
70 | s = os.lstat(path).st_mode |
|
70 | s = os.lstat(path).st_mode | |
71 | os.chmod(path, s | 0100) |
|
71 | os.chmod(path, s | 0100) | |
72 | return (os.lstat(path).st_mode & 0100 != 0) |
|
72 | return (os.lstat(path).st_mode & 0100 != 0) | |
73 | finally: |
|
73 | finally: | |
74 | os.remove(path) |
|
74 | os.remove(path) | |
75 |
|
75 | |||
76 | def has_icasefs(): |
|
76 | def has_icasefs(): | |
77 | # Stolen from mercurial.util |
|
77 | # Stolen from mercurial.util | |
78 | fd, path = tempfile.mkstemp(prefix=tempprefix, dir='.') |
|
78 | fd, path = tempfile.mkstemp(prefix=tempprefix, dir='.') | |
79 | os.close(fd) |
|
79 | os.close(fd) | |
80 | try: |
|
80 | try: | |
81 | s1 = os.stat(path) |
|
81 | s1 = os.stat(path) | |
82 | d, b = os.path.split(path) |
|
82 | d, b = os.path.split(path) | |
83 | p2 = os.path.join(d, b.upper()) |
|
83 | p2 = os.path.join(d, b.upper()) | |
84 | if path == p2: |
|
84 | if path == p2: | |
85 | p2 = os.path.join(d, b.lower()) |
|
85 | p2 = os.path.join(d, b.lower()) | |
86 | try: |
|
86 | try: | |
87 | s2 = os.stat(p2) |
|
87 | s2 = os.stat(p2) | |
88 | return s2 == s1 |
|
88 | return s2 == s1 | |
89 | except: |
|
89 | except: | |
90 | return False |
|
90 | return False | |
91 | finally: |
|
91 | finally: | |
92 | os.remove(path) |
|
92 | os.remove(path) | |
93 |
|
93 | |||
94 | def has_inotify(): |
|
94 | def has_inotify(): | |
95 | try: |
|
95 | try: | |
96 | import hgext.inotify.linux.watcher |
|
96 | import hgext.inotify.linux.watcher | |
97 | return True |
|
97 | return True | |
98 | except ImportError: |
|
98 | except ImportError: | |
99 | return False |
|
99 | return False | |
100 |
|
100 | |||
101 | def has_fifo(): |
|
101 | def has_fifo(): | |
102 | return hasattr(os, "mkfifo") |
|
102 | return hasattr(os, "mkfifo") | |
103 |
|
103 | |||
104 | def has_cacheable_fs(): |
|
104 | def has_cacheable_fs(): | |
105 | from mercurial import util |
|
105 | from mercurial import util | |
106 |
|
106 | |||
107 | fd, path = tempfile.mkstemp(prefix=tempprefix) |
|
107 | fd, path = tempfile.mkstemp(prefix=tempprefix) | |
108 | os.close(fd) |
|
108 | os.close(fd) | |
109 | try: |
|
109 | try: | |
110 | return util.cachestat(path).cacheable() |
|
110 | return util.cachestat(path).cacheable() | |
111 | finally: |
|
111 | finally: | |
112 | os.remove(path) |
|
112 | os.remove(path) | |
113 |
|
113 | |||
114 | def has_lsprof(): |
|
114 | def has_lsprof(): | |
115 | try: |
|
115 | try: | |
116 | import _lsprof |
|
116 | import _lsprof | |
117 | return True |
|
117 | return True | |
118 | except ImportError: |
|
118 | except ImportError: | |
119 | return False |
|
119 | return False | |
120 |
|
120 | |||
121 | def has_gettext(): |
|
121 | def has_gettext(): | |
122 | return matchoutput('msgfmt --version', 'GNU gettext-tools') |
|
122 | return matchoutput('msgfmt --version', 'GNU gettext-tools') | |
123 |
|
123 | |||
124 | def has_git(): |
|
124 | def has_git(): | |
125 | return matchoutput('git --version 2>&1', r'^git version') |
|
125 | return matchoutput('git --version 2>&1', r'^git version') | |
126 |
|
126 | |||
127 | def has_docutils(): |
|
127 | def has_docutils(): | |
128 | try: |
|
128 | try: | |
129 | from docutils.core import publish_cmdline |
|
129 | from docutils.core import publish_cmdline | |
130 | return True |
|
130 | return True | |
131 | except ImportError: |
|
131 | except ImportError: | |
132 | return False |
|
132 | return False | |
133 |
|
133 | |||
134 | def getsvnversion(): |
|
134 | def getsvnversion(): | |
135 | m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)') |
|
135 | m = matchoutput('svn --version 2>&1', r'^svn,\s+version\s+(\d+)\.(\d+)') | |
136 | if not m: |
|
136 | if not m: | |
137 | return (0, 0) |
|
137 | return (0, 0) | |
138 | return (int(m.group(1)), int(m.group(2))) |
|
138 | return (int(m.group(1)), int(m.group(2))) | |
139 |
|
139 | |||
140 | def has_svn15(): |
|
140 | def has_svn15(): | |
141 | return getsvnversion() >= (1, 5) |
|
141 | return getsvnversion() >= (1, 5) | |
142 |
|
142 | |||
143 | def has_svn13(): |
|
143 | def has_svn13(): | |
144 | return getsvnversion() >= (1, 3) |
|
144 | return getsvnversion() >= (1, 3) | |
145 |
|
145 | |||
146 | def has_svn(): |
|
146 | def has_svn(): | |
147 | return matchoutput('svn --version 2>&1', r'^svn, version') and \ |
|
147 | return matchoutput('svn --version 2>&1', r'^svn, version') and \ | |
148 | matchoutput('svnadmin --version 2>&1', r'^svnadmin, version') |
|
148 | matchoutput('svnadmin --version 2>&1', r'^svnadmin, version') | |
149 |
|
149 | |||
150 | def has_svn_bindings(): |
|
150 | def has_svn_bindings(): | |
151 | try: |
|
151 | try: | |
152 | import svn.core |
|
152 | import svn.core | |
153 | version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR |
|
153 | version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR | |
154 | if version < (1, 4): |
|
154 | if version < (1, 4): | |
155 | return False |
|
155 | return False | |
156 | return True |
|
156 | return True | |
157 | except ImportError: |
|
157 | except ImportError: | |
158 | return False |
|
158 | return False | |
159 |
|
159 | |||
160 | def has_p4(): |
|
160 | def has_p4(): | |
161 | return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/') |
|
161 | return matchoutput('p4 -V', r'Rev\. P4/') and matchoutput('p4d -V', r'Rev\. P4D/') | |
162 |
|
162 | |||
163 | def has_symlink(): |
|
163 | def has_symlink(): | |
164 | return hasattr(os, "symlink") |
|
164 | return hasattr(os, "symlink") # FIXME: should also check file system and os | |
165 |
|
165 | |||
166 | def has_tla(): |
|
166 | def has_tla(): | |
167 | return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') |
|
167 | return matchoutput('tla --version 2>&1', r'The GNU Arch Revision') | |
168 |
|
168 | |||
169 | def has_gpg(): |
|
169 | def has_gpg(): | |
170 | return matchoutput('gpg --version 2>&1', r'GnuPG') |
|
170 | return matchoutput('gpg --version 2>&1', r'GnuPG') | |
171 |
|
171 | |||
172 | def has_unix_permissions(): |
|
172 | def has_unix_permissions(): | |
173 | d = tempfile.mkdtemp(prefix=tempprefix, dir=".") |
|
173 | d = tempfile.mkdtemp(prefix=tempprefix, dir=".") | |
174 | try: |
|
174 | try: | |
175 | fname = os.path.join(d, 'foo') |
|
175 | fname = os.path.join(d, 'foo') | |
176 | for umask in (077, 007, 022): |
|
176 | for umask in (077, 007, 022): | |
177 | os.umask(umask) |
|
177 | os.umask(umask) | |
178 | f = open(fname, 'w') |
|
178 | f = open(fname, 'w') | |
179 | f.close() |
|
179 | f.close() | |
180 | mode = os.stat(fname).st_mode |
|
180 | mode = os.stat(fname).st_mode | |
181 | os.unlink(fname) |
|
181 | os.unlink(fname) | |
182 | if mode & 0777 != ~umask & 0666: |
|
182 | if mode & 0777 != ~umask & 0666: | |
183 | return False |
|
183 | return False | |
184 | return True |
|
184 | return True | |
185 | finally: |
|
185 | finally: | |
186 | os.rmdir(d) |
|
186 | os.rmdir(d) | |
187 |
|
187 | |||
188 | def has_pyflakes(): |
|
188 | def has_pyflakes(): | |
189 | return matchoutput('echo "import re" 2>&1 | pyflakes', |
|
189 | return matchoutput('echo "import re" 2>&1 | pyflakes', | |
190 | r"<stdin>:1: 're' imported but unused", |
|
190 | r"<stdin>:1: 're' imported but unused", | |
191 | True) |
|
191 | True) | |
192 |
|
192 | |||
193 | def has_pygments(): |
|
193 | def has_pygments(): | |
194 | try: |
|
194 | try: | |
195 | import pygments |
|
195 | import pygments | |
196 | return True |
|
196 | return True | |
197 | except ImportError: |
|
197 | except ImportError: | |
198 | return False |
|
198 | return False | |
199 |
|
199 | |||
200 | def has_outer_repo(): |
|
200 | def has_outer_repo(): | |
201 | return matchoutput('hg root 2>&1', r'') |
|
201 | return matchoutput('hg root 2>&1', r'') | |
202 |
|
202 | |||
203 | def has_ssl(): |
|
203 | def has_ssl(): | |
204 | try: |
|
204 | try: | |
205 | import ssl |
|
205 | import ssl | |
206 | import OpenSSL |
|
206 | import OpenSSL | |
207 | OpenSSL.SSL.Context |
|
207 | OpenSSL.SSL.Context | |
208 | return True |
|
208 | return True | |
209 | except ImportError: |
|
209 | except ImportError: | |
210 | return False |
|
210 | return False | |
211 |
|
211 | |||
212 | checks = { |
|
212 | checks = { | |
213 | "baz": (has_baz, "GNU Arch baz client"), |
|
213 | "baz": (has_baz, "GNU Arch baz client"), | |
214 | "bzr": (has_bzr, "Canonical's Bazaar client"), |
|
214 | "bzr": (has_bzr, "Canonical's Bazaar client"), | |
215 | "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"), |
|
215 | "bzr114": (has_bzr114, "Canonical's Bazaar client >= 1.14"), | |
216 | "cacheable": (has_cacheable_fs, "cacheable filesystem"), |
|
216 | "cacheable": (has_cacheable_fs, "cacheable filesystem"), | |
217 | "cvs": (has_cvs, "cvs client/server"), |
|
217 | "cvs": (has_cvs, "cvs client/server"), | |
218 | "darcs": (has_darcs, "darcs client"), |
|
218 | "darcs": (has_darcs, "darcs client"), | |
219 | "docutils": (has_docutils, "Docutils text processing library"), |
|
219 | "docutils": (has_docutils, "Docutils text processing library"), | |
220 | "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), |
|
220 | "eol-in-paths": (has_eol_in_paths, "end-of-lines in paths"), | |
221 | "execbit": (has_executablebit, "executable bit"), |
|
221 | "execbit": (has_executablebit, "executable bit"), | |
222 | "fifo": (has_fifo, "named pipes"), |
|
222 | "fifo": (has_fifo, "named pipes"), | |
223 | "gettext": (has_gettext, "GNU Gettext (msgfmt)"), |
|
223 | "gettext": (has_gettext, "GNU Gettext (msgfmt)"), | |
224 | "git": (has_git, "git command line client"), |
|
224 | "git": (has_git, "git command line client"), | |
225 | "gpg": (has_gpg, "gpg client"), |
|
225 | "gpg": (has_gpg, "gpg client"), | |
226 | "icasefs": (has_icasefs, "case insensitive file system"), |
|
226 | "icasefs": (has_icasefs, "case insensitive file system"), | |
227 | "inotify": (has_inotify, "inotify extension support"), |
|
227 | "inotify": (has_inotify, "inotify extension support"), | |
228 | "lsprof": (has_lsprof, "python lsprof module"), |
|
228 | "lsprof": (has_lsprof, "python lsprof module"), | |
229 | "mtn": (has_mtn, "monotone client (>= 1.0)"), |
|
229 | "mtn": (has_mtn, "monotone client (>= 1.0)"), | |
230 | "outer-repo": (has_outer_repo, "outer repo"), |
|
230 | "outer-repo": (has_outer_repo, "outer repo"), | |
231 | "p4": (has_p4, "Perforce server and client"), |
|
231 | "p4": (has_p4, "Perforce server and client"), | |
232 | "pyflakes": (has_pyflakes, "Pyflakes python linter"), |
|
232 | "pyflakes": (has_pyflakes, "Pyflakes python linter"), | |
233 | "pygments": (has_pygments, "Pygments source highlighting library"), |
|
233 | "pygments": (has_pygments, "Pygments source highlighting library"), | |
234 | "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"), |
|
234 | "ssl": (has_ssl, "python >= 2.6 ssl module and python OpenSSL"), | |
235 | "svn": (has_svn, "subversion client and admin tools"), |
|
235 | "svn": (has_svn, "subversion client and admin tools"), | |
236 | "svn13": (has_svn13, "subversion client and admin tools >= 1.3"), |
|
236 | "svn13": (has_svn13, "subversion client and admin tools >= 1.3"), | |
237 | "svn15": (has_svn15, "subversion client and admin tools >= 1.5"), |
|
237 | "svn15": (has_svn15, "subversion client and admin tools >= 1.5"), | |
238 | "svn-bindings": (has_svn_bindings, "subversion python bindings"), |
|
238 | "svn-bindings": (has_svn_bindings, "subversion python bindings"), | |
239 | "symlink": (has_symlink, "symbolic links"), |
|
239 | "symlink": (has_symlink, "symbolic links"), | |
240 | "tla": (has_tla, "GNU Arch tla client"), |
|
240 | "tla": (has_tla, "GNU Arch tla client"), | |
241 | "unix-permissions": (has_unix_permissions, "unix-style permissions"), |
|
241 | "unix-permissions": (has_unix_permissions, "unix-style permissions"), | |
242 | } |
|
242 | } | |
243 |
|
243 | |||
244 | def list_features(): |
|
244 | def list_features(): | |
245 | for name, feature in checks.iteritems(): |
|
245 | for name, feature in checks.iteritems(): | |
246 | desc = feature[1] |
|
246 | desc = feature[1] | |
247 | print name + ':', desc |
|
247 | print name + ':', desc | |
248 |
|
248 | |||
249 | def test_features(): |
|
249 | def test_features(): | |
250 | failed = 0 |
|
250 | failed = 0 | |
251 | for name, feature in checks.iteritems(): |
|
251 | for name, feature in checks.iteritems(): | |
252 | check, _ = feature |
|
252 | check, _ = feature | |
253 | try: |
|
253 | try: | |
254 | check() |
|
254 | check() | |
255 | except Exception, e: |
|
255 | except Exception, e: | |
256 | print "feature %s failed: %s" % (name, e) |
|
256 | print "feature %s failed: %s" % (name, e) | |
257 | failed += 1 |
|
257 | failed += 1 | |
258 | return failed |
|
258 | return failed | |
259 |
|
259 | |||
260 | parser = optparse.OptionParser("%prog [options] [features]") |
|
260 | parser = optparse.OptionParser("%prog [options] [features]") | |
261 | parser.add_option("--test-features", action="store_true", |
|
261 | parser.add_option("--test-features", action="store_true", | |
262 | help="test available features") |
|
262 | help="test available features") | |
263 | parser.add_option("--list-features", action="store_true", |
|
263 | parser.add_option("--list-features", action="store_true", | |
264 | help="list available features") |
|
264 | help="list available features") | |
265 | parser.add_option("-q", "--quiet", action="store_true", |
|
265 | parser.add_option("-q", "--quiet", action="store_true", | |
266 | help="check features silently") |
|
266 | help="check features silently") | |
267 |
|
267 | |||
268 | if __name__ == '__main__': |
|
268 | if __name__ == '__main__': | |
269 | options, args = parser.parse_args() |
|
269 | options, args = parser.parse_args() | |
270 | if options.list_features: |
|
270 | if options.list_features: | |
271 | list_features() |
|
271 | list_features() | |
272 | sys.exit(0) |
|
272 | sys.exit(0) | |
273 |
|
273 | |||
274 | if options.test_features: |
|
274 | if options.test_features: | |
275 | sys.exit(test_features()) |
|
275 | sys.exit(test_features()) | |
276 |
|
276 | |||
277 | quiet = options.quiet |
|
277 | quiet = options.quiet | |
278 |
|
278 | |||
279 | failures = 0 |
|
279 | failures = 0 | |
280 |
|
280 | |||
281 | def error(msg): |
|
281 | def error(msg): | |
282 | global failures |
|
282 | global failures | |
283 | if not quiet: |
|
283 | if not quiet: | |
284 | sys.stderr.write(msg + '\n') |
|
284 | sys.stderr.write(msg + '\n') | |
285 | failures += 1 |
|
285 | failures += 1 | |
286 |
|
286 | |||
287 | for feature in args: |
|
287 | for feature in args: | |
288 | negate = feature.startswith('no-') |
|
288 | negate = feature.startswith('no-') | |
289 | if negate: |
|
289 | if negate: | |
290 | feature = feature[3:] |
|
290 | feature = feature[3:] | |
291 |
|
291 | |||
292 | if feature not in checks: |
|
292 | if feature not in checks: | |
293 | error('skipped: unknown feature: ' + feature) |
|
293 | error('skipped: unknown feature: ' + feature) | |
294 | continue |
|
294 | continue | |
295 |
|
295 | |||
296 | check, desc = checks[feature] |
|
296 | check, desc = checks[feature] | |
297 | try: |
|
297 | try: | |
298 | available = check() |
|
298 | available = check() | |
299 | except Exception, e: |
|
299 | except Exception, e: | |
300 | error('hghave check failed: ' + feature) |
|
300 | error('hghave check failed: ' + feature) | |
301 | continue |
|
301 | continue | |
302 |
|
302 | |||
303 | if not negate and not available: |
|
303 | if not negate and not available: | |
304 | error('skipped: missing feature: ' + desc) |
|
304 | error('skipped: missing feature: ' + desc) | |
305 | elif negate and available: |
|
305 | elif negate and available: | |
306 | error('skipped: system supports %s' % desc) |
|
306 | error('skipped: system supports %s' % desc) | |
307 |
|
307 | |||
308 | if failures != 0: |
|
308 | if failures != 0: | |
309 | sys.exit(1) |
|
309 | sys.exit(1) |
@@ -1,82 +1,84 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ hg init |
|
3 | $ hg init | |
2 |
|
4 | |||
3 | should fail |
|
5 | should fail | |
4 |
|
6 | |||
5 | $ hg add .hg/00changelog.i |
|
7 | $ hg add .hg/00changelog.i | |
6 | abort: path contains illegal component: .hg/00changelog.i |
|
8 | abort: path contains illegal component: .hg/00changelog.i | |
7 | [255] |
|
9 | [255] | |
8 |
|
10 | |||
9 | $ mkdir a |
|
11 | $ mkdir a | |
10 | $ echo a > a/a |
|
12 | $ echo a > a/a | |
11 | $ hg ci -Ama |
|
13 | $ hg ci -Ama | |
12 | adding a/a |
|
14 | adding a/a | |
13 | $ ln -s a b |
|
15 | $ ln -s a b | |
14 | $ echo b > a/b |
|
16 | $ echo b > a/b | |
15 |
|
17 | |||
16 | should fail |
|
18 | should fail | |
17 |
|
19 | |||
18 | $ hg add b/b |
|
20 | $ hg add b/b | |
19 | abort: path 'b/b' traverses symbolic link 'b' |
|
21 | abort: path 'b/b' traverses symbolic link 'b' | |
20 | [255] |
|
22 | [255] | |
21 |
|
23 | |||
22 | should succeed |
|
24 | should succeed | |
23 |
|
25 | |||
24 | $ hg add b |
|
26 | $ hg add b | |
25 |
|
27 | |||
26 | should still fail - maybe |
|
28 | should still fail - maybe | |
27 |
|
29 | |||
28 | $ hg add b/b |
|
30 | $ hg add b/b | |
29 | abort: path 'b/b' traverses symbolic link 'b' |
|
31 | abort: path 'b/b' traverses symbolic link 'b' | |
30 | [255] |
|
32 | [255] | |
31 |
|
33 | |||
32 | unbundle tampered bundle |
|
34 | unbundle tampered bundle | |
33 |
|
35 | |||
34 | $ hg init target |
|
36 | $ hg init target | |
35 | $ cd target |
|
37 | $ cd target | |
36 | $ hg unbundle $TESTDIR/bundles/tampered.hg |
|
38 | $ hg unbundle $TESTDIR/bundles/tampered.hg | |
37 | adding changesets |
|
39 | adding changesets | |
38 | adding manifests |
|
40 | adding manifests | |
39 | adding file changes |
|
41 | adding file changes | |
40 | added 5 changesets with 6 changes to 6 files (+4 heads) |
|
42 | added 5 changesets with 6 changes to 6 files (+4 heads) | |
41 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
43 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
42 |
|
44 | |||
43 | attack .hg/test |
|
45 | attack .hg/test | |
44 |
|
46 | |||
45 | $ hg manifest -r0 |
|
47 | $ hg manifest -r0 | |
46 | .hg/test |
|
48 | .hg/test | |
47 | $ hg update -Cr0 |
|
49 | $ hg update -Cr0 | |
48 | abort: path contains illegal component: .hg/test |
|
50 | abort: path contains illegal component: .hg/test | |
49 | [255] |
|
51 | [255] | |
50 |
|
52 | |||
51 | attack foo/.hg/test |
|
53 | attack foo/.hg/test | |
52 |
|
54 | |||
53 | $ hg manifest -r1 |
|
55 | $ hg manifest -r1 | |
54 | foo/.hg/test |
|
56 | foo/.hg/test | |
55 | $ hg update -Cr1 |
|
57 | $ hg update -Cr1 | |
56 | abort: path 'foo/.hg/test' is inside nested repo 'foo' |
|
58 | abort: path 'foo/.hg/test' is inside nested repo 'foo' | |
57 | [255] |
|
59 | [255] | |
58 |
|
60 | |||
59 | attack back/test where back symlinks to .. |
|
61 | attack back/test where back symlinks to .. | |
60 |
|
62 | |||
61 | $ hg manifest -r2 |
|
63 | $ hg manifest -r2 | |
62 | back |
|
64 | back | |
63 | back/test |
|
65 | back/test | |
64 | $ hg update -Cr2 |
|
66 | $ hg update -Cr2 | |
65 | abort: path 'back/test' traverses symbolic link 'back' |
|
67 | abort: path 'back/test' traverses symbolic link 'back' | |
66 | [255] |
|
68 | [255] | |
67 |
|
69 | |||
68 | attack ../test |
|
70 | attack ../test | |
69 |
|
71 | |||
70 | $ hg manifest -r3 |
|
72 | $ hg manifest -r3 | |
71 | ../test |
|
73 | ../test | |
72 | $ hg update -Cr3 |
|
74 | $ hg update -Cr3 | |
73 | abort: path contains illegal component: ../test |
|
75 | abort: path contains illegal component: ../test | |
74 | [255] |
|
76 | [255] | |
75 |
|
77 | |||
76 | attack /tmp/test |
|
78 | attack /tmp/test | |
77 |
|
79 | |||
78 | $ hg manifest -r4 |
|
80 | $ hg manifest -r4 | |
79 | /tmp/test |
|
81 | /tmp/test | |
80 | $ hg update -Cr4 |
|
82 | $ hg update -Cr4 | |
81 | abort: No such file or directory: $TESTTMP/target//tmp/test |
|
83 | abort: No such file or directory: $TESTTMP/target//tmp/test | |
82 | [255] |
|
84 | [255] |
@@ -1,281 +1,283 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | commit date test |
|
3 | commit date test | |
2 |
|
4 | |||
3 | $ hg init test |
|
5 | $ hg init test | |
4 | $ cd test |
|
6 | $ cd test | |
5 | $ echo foo > foo |
|
7 | $ echo foo > foo | |
6 | $ hg add foo |
|
8 | $ hg add foo | |
7 | $ HGEDITOR=true hg commit -m "" |
|
9 | $ HGEDITOR=true hg commit -m "" | |
8 | abort: empty commit message |
|
10 | abort: empty commit message | |
9 | [255] |
|
11 | [255] | |
10 | $ hg commit -d '0 0' -m commit-1 |
|
12 | $ hg commit -d '0 0' -m commit-1 | |
11 | $ echo foo >> foo |
|
13 | $ echo foo >> foo | |
12 | $ hg commit -d '1 4444444' -m commit-3 |
|
14 | $ hg commit -d '1 4444444' -m commit-3 | |
13 | abort: impossible time zone offset: 4444444 |
|
15 | abort: impossible time zone offset: 4444444 | |
14 | [255] |
|
16 | [255] | |
15 | $ hg commit -d '1 15.1' -m commit-4 |
|
17 | $ hg commit -d '1 15.1' -m commit-4 | |
16 | abort: invalid date: '1\t15.1' |
|
18 | abort: invalid date: '1\t15.1' | |
17 | [255] |
|
19 | [255] | |
18 | $ hg commit -d 'foo bar' -m commit-5 |
|
20 | $ hg commit -d 'foo bar' -m commit-5 | |
19 | abort: invalid date: 'foo bar' |
|
21 | abort: invalid date: 'foo bar' | |
20 | [255] |
|
22 | [255] | |
21 | $ hg commit -d ' 1 4444' -m commit-6 |
|
23 | $ hg commit -d ' 1 4444' -m commit-6 | |
22 | $ hg commit -d '111111111111 0' -m commit-7 |
|
24 | $ hg commit -d '111111111111 0' -m commit-7 | |
23 | abort: date exceeds 32 bits: 111111111111 |
|
25 | abort: date exceeds 32 bits: 111111111111 | |
24 | [255] |
|
26 | [255] | |
25 | $ hg commit -d '-7654321 3600' -m commit-7 |
|
27 | $ hg commit -d '-7654321 3600' -m commit-7 | |
26 | abort: negative date value: -7654321 |
|
28 | abort: negative date value: -7654321 | |
27 | [255] |
|
29 | [255] | |
28 |
|
30 | |||
29 | commit added file that has been deleted |
|
31 | commit added file that has been deleted | |
30 |
|
32 | |||
31 | $ echo bar > bar |
|
33 | $ echo bar > bar | |
32 | $ hg add bar |
|
34 | $ hg add bar | |
33 | $ rm bar |
|
35 | $ rm bar | |
34 | $ hg commit -m commit-8 |
|
36 | $ hg commit -m commit-8 | |
35 | nothing changed (1 missing files, see 'hg status') |
|
37 | nothing changed (1 missing files, see 'hg status') | |
36 | [1] |
|
38 | [1] | |
37 | $ hg commit -m commit-8-2 bar |
|
39 | $ hg commit -m commit-8-2 bar | |
38 | abort: bar: file not found! |
|
40 | abort: bar: file not found! | |
39 | [255] |
|
41 | [255] | |
40 |
|
42 | |||
41 | $ hg -q revert -a --no-backup |
|
43 | $ hg -q revert -a --no-backup | |
42 |
|
44 | |||
43 | $ mkdir dir |
|
45 | $ mkdir dir | |
44 | $ echo boo > dir/file |
|
46 | $ echo boo > dir/file | |
45 | $ hg add |
|
47 | $ hg add | |
46 | adding dir/file |
|
48 | adding dir/file | |
47 | $ hg -v commit -m commit-9 dir |
|
49 | $ hg -v commit -m commit-9 dir | |
48 | dir/file |
|
50 | dir/file | |
49 | committed changeset 2:d2a76177cb42 |
|
51 | committed changeset 2:d2a76177cb42 | |
50 |
|
52 | |||
51 | $ echo > dir.file |
|
53 | $ echo > dir.file | |
52 | $ hg add |
|
54 | $ hg add | |
53 | adding dir.file |
|
55 | adding dir.file | |
54 | $ hg commit -m commit-10 dir dir.file |
|
56 | $ hg commit -m commit-10 dir dir.file | |
55 | abort: dir: no match under directory! |
|
57 | abort: dir: no match under directory! | |
56 | [255] |
|
58 | [255] | |
57 |
|
59 | |||
58 | $ echo >> dir/file |
|
60 | $ echo >> dir/file | |
59 | $ mkdir bleh |
|
61 | $ mkdir bleh | |
60 | $ mkdir dir2 |
|
62 | $ mkdir dir2 | |
61 | $ cd bleh |
|
63 | $ cd bleh | |
62 | $ hg commit -m commit-11 . |
|
64 | $ hg commit -m commit-11 . | |
63 | abort: bleh: no match under directory! |
|
65 | abort: bleh: no match under directory! | |
64 | [255] |
|
66 | [255] | |
65 | $ hg commit -m commit-12 ../dir ../dir2 |
|
67 | $ hg commit -m commit-12 ../dir ../dir2 | |
66 | abort: dir2: no match under directory! |
|
68 | abort: dir2: no match under directory! | |
67 | [255] |
|
69 | [255] | |
68 | $ hg -v commit -m commit-13 ../dir |
|
70 | $ hg -v commit -m commit-13 ../dir | |
69 | dir/file |
|
71 | dir/file | |
70 | committed changeset 3:1cd62a2d8db5 |
|
72 | committed changeset 3:1cd62a2d8db5 | |
71 | $ cd .. |
|
73 | $ cd .. | |
72 |
|
74 | |||
73 | $ hg commit -m commit-14 does-not-exist |
|
75 | $ hg commit -m commit-14 does-not-exist | |
74 | abort: does-not-exist: No such file or directory |
|
76 | abort: does-not-exist: No such file or directory | |
75 | [255] |
|
77 | [255] | |
76 | $ ln -s foo baz |
|
78 | $ ln -s foo baz | |
77 | $ hg commit -m commit-15 baz |
|
79 | $ hg commit -m commit-15 baz | |
78 | abort: baz: file not tracked! |
|
80 | abort: baz: file not tracked! | |
79 | [255] |
|
81 | [255] | |
80 | $ touch quux |
|
82 | $ touch quux | |
81 | $ hg commit -m commit-16 quux |
|
83 | $ hg commit -m commit-16 quux | |
82 | abort: quux: file not tracked! |
|
84 | abort: quux: file not tracked! | |
83 | [255] |
|
85 | [255] | |
84 | $ echo >> dir/file |
|
86 | $ echo >> dir/file | |
85 | $ hg -v commit -m commit-17 dir/file |
|
87 | $ hg -v commit -m commit-17 dir/file | |
86 | dir/file |
|
88 | dir/file | |
87 | committed changeset 4:49176991390e |
|
89 | committed changeset 4:49176991390e | |
88 |
|
90 | |||
89 | An empty date was interpreted as epoch origin |
|
91 | An empty date was interpreted as epoch origin | |
90 |
|
92 | |||
91 | $ echo foo >> foo |
|
93 | $ echo foo >> foo | |
92 | $ hg commit -d '' -m commit-no-date |
|
94 | $ hg commit -d '' -m commit-no-date | |
93 | $ hg tip --template '{date|isodate}\n' | grep '1970' |
|
95 | $ hg tip --template '{date|isodate}\n' | grep '1970' | |
94 | [1] |
|
96 | [1] | |
95 |
|
97 | |||
96 | Make sure we do not obscure unknown requires file entries (issue2649) |
|
98 | Make sure we do not obscure unknown requires file entries (issue2649) | |
97 |
|
99 | |||
98 | $ echo foo >> foo |
|
100 | $ echo foo >> foo | |
99 | $ echo fake >> .hg/requires |
|
101 | $ echo fake >> .hg/requires | |
100 | $ hg commit -m bla |
|
102 | $ hg commit -m bla | |
101 | abort: unknown repository format: requires features 'fake' (upgrade Mercurial)! |
|
103 | abort: unknown repository format: requires features 'fake' (upgrade Mercurial)! | |
102 | [255] |
|
104 | [255] | |
103 |
|
105 | |||
104 | $ cd .. |
|
106 | $ cd .. | |
105 |
|
107 | |||
106 |
|
108 | |||
107 | partial subdir commit test |
|
109 | partial subdir commit test | |
108 |
|
110 | |||
109 | $ hg init test2 |
|
111 | $ hg init test2 | |
110 | $ cd test2 |
|
112 | $ cd test2 | |
111 | $ mkdir foo |
|
113 | $ mkdir foo | |
112 | $ echo foo > foo/foo |
|
114 | $ echo foo > foo/foo | |
113 | $ mkdir bar |
|
115 | $ mkdir bar | |
114 | $ echo bar > bar/bar |
|
116 | $ echo bar > bar/bar | |
115 | $ hg add |
|
117 | $ hg add | |
116 | adding bar/bar |
|
118 | adding bar/bar | |
117 | adding foo/foo |
|
119 | adding foo/foo | |
118 | $ hg ci -m commit-subdir-1 foo |
|
120 | $ hg ci -m commit-subdir-1 foo | |
119 | $ hg ci -m commit-subdir-2 bar |
|
121 | $ hg ci -m commit-subdir-2 bar | |
120 |
|
122 | |||
121 | subdir log 1 |
|
123 | subdir log 1 | |
122 |
|
124 | |||
123 | $ hg log -v foo |
|
125 | $ hg log -v foo | |
124 | changeset: 0:f97e73a25882 |
|
126 | changeset: 0:f97e73a25882 | |
125 | user: test |
|
127 | user: test | |
126 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
128 | date: Thu Jan 01 00:00:00 1970 +0000 | |
127 | files: foo/foo |
|
129 | files: foo/foo | |
128 | description: |
|
130 | description: | |
129 | commit-subdir-1 |
|
131 | commit-subdir-1 | |
130 |
|
132 | |||
131 |
|
133 | |||
132 |
|
134 | |||
133 | subdir log 2 |
|
135 | subdir log 2 | |
134 |
|
136 | |||
135 | $ hg log -v bar |
|
137 | $ hg log -v bar | |
136 | changeset: 1:aa809156d50d |
|
138 | changeset: 1:aa809156d50d | |
137 | tag: tip |
|
139 | tag: tip | |
138 | user: test |
|
140 | user: test | |
139 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
141 | date: Thu Jan 01 00:00:00 1970 +0000 | |
140 | files: bar/bar |
|
142 | files: bar/bar | |
141 | description: |
|
143 | description: | |
142 | commit-subdir-2 |
|
144 | commit-subdir-2 | |
143 |
|
145 | |||
144 |
|
146 | |||
145 |
|
147 | |||
146 | full log |
|
148 | full log | |
147 |
|
149 | |||
148 | $ hg log -v |
|
150 | $ hg log -v | |
149 | changeset: 1:aa809156d50d |
|
151 | changeset: 1:aa809156d50d | |
150 | tag: tip |
|
152 | tag: tip | |
151 | user: test |
|
153 | user: test | |
152 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
154 | date: Thu Jan 01 00:00:00 1970 +0000 | |
153 | files: bar/bar |
|
155 | files: bar/bar | |
154 | description: |
|
156 | description: | |
155 | commit-subdir-2 |
|
157 | commit-subdir-2 | |
156 |
|
158 | |||
157 |
|
159 | |||
158 | changeset: 0:f97e73a25882 |
|
160 | changeset: 0:f97e73a25882 | |
159 | user: test |
|
161 | user: test | |
160 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
162 | date: Thu Jan 01 00:00:00 1970 +0000 | |
161 | files: foo/foo |
|
163 | files: foo/foo | |
162 | description: |
|
164 | description: | |
163 | commit-subdir-1 |
|
165 | commit-subdir-1 | |
164 |
|
166 | |||
165 |
|
167 | |||
166 | $ cd .. |
|
168 | $ cd .. | |
167 |
|
169 | |||
168 |
|
170 | |||
169 | dot and subdir commit test |
|
171 | dot and subdir commit test | |
170 |
|
172 | |||
171 | $ hg init test3 |
|
173 | $ hg init test3 | |
172 | $ cd test3 |
|
174 | $ cd test3 | |
173 | $ mkdir foo |
|
175 | $ mkdir foo | |
174 | $ echo foo content > foo/plain-file |
|
176 | $ echo foo content > foo/plain-file | |
175 | $ hg add foo/plain-file |
|
177 | $ hg add foo/plain-file | |
176 | $ hg ci -m commit-foo-subdir foo |
|
178 | $ hg ci -m commit-foo-subdir foo | |
177 | $ echo modified foo content > foo/plain-file |
|
179 | $ echo modified foo content > foo/plain-file | |
178 | $ hg ci -m commit-foo-dot . |
|
180 | $ hg ci -m commit-foo-dot . | |
179 |
|
181 | |||
180 | full log |
|
182 | full log | |
181 |
|
183 | |||
182 | $ hg log -v |
|
184 | $ hg log -v | |
183 | changeset: 1:95b38e3a5b2e |
|
185 | changeset: 1:95b38e3a5b2e | |
184 | tag: tip |
|
186 | tag: tip | |
185 | user: test |
|
187 | user: test | |
186 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
188 | date: Thu Jan 01 00:00:00 1970 +0000 | |
187 | files: foo/plain-file |
|
189 | files: foo/plain-file | |
188 | description: |
|
190 | description: | |
189 | commit-foo-dot |
|
191 | commit-foo-dot | |
190 |
|
192 | |||
191 |
|
193 | |||
192 | changeset: 0:65d4e9386227 |
|
194 | changeset: 0:65d4e9386227 | |
193 | user: test |
|
195 | user: test | |
194 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
196 | date: Thu Jan 01 00:00:00 1970 +0000 | |
195 | files: foo/plain-file |
|
197 | files: foo/plain-file | |
196 | description: |
|
198 | description: | |
197 | commit-foo-subdir |
|
199 | commit-foo-subdir | |
198 |
|
200 | |||
199 |
|
201 | |||
200 |
|
202 | |||
201 | subdir log |
|
203 | subdir log | |
202 |
|
204 | |||
203 | $ cd foo |
|
205 | $ cd foo | |
204 | $ hg log . |
|
206 | $ hg log . | |
205 | changeset: 1:95b38e3a5b2e |
|
207 | changeset: 1:95b38e3a5b2e | |
206 | tag: tip |
|
208 | tag: tip | |
207 | user: test |
|
209 | user: test | |
208 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
210 | date: Thu Jan 01 00:00:00 1970 +0000 | |
209 | summary: commit-foo-dot |
|
211 | summary: commit-foo-dot | |
210 |
|
212 | |||
211 | changeset: 0:65d4e9386227 |
|
213 | changeset: 0:65d4e9386227 | |
212 | user: test |
|
214 | user: test | |
213 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
215 | date: Thu Jan 01 00:00:00 1970 +0000 | |
214 | summary: commit-foo-subdir |
|
216 | summary: commit-foo-subdir | |
215 |
|
217 | |||
216 | $ cd .. |
|
218 | $ cd .. | |
217 | $ cd .. |
|
219 | $ cd .. | |
218 |
|
220 | |||
219 | Issue1049: Hg permits partial commit of merge without warning |
|
221 | Issue1049: Hg permits partial commit of merge without warning | |
220 |
|
222 | |||
221 | $ cd .. |
|
223 | $ cd .. | |
222 | $ hg init issue1049 |
|
224 | $ hg init issue1049 | |
223 | $ cd issue1049 |
|
225 | $ cd issue1049 | |
224 | $ echo a > a |
|
226 | $ echo a > a | |
225 | $ hg ci -Ama |
|
227 | $ hg ci -Ama | |
226 | adding a |
|
228 | adding a | |
227 | $ echo a >> a |
|
229 | $ echo a >> a | |
228 | $ hg ci -mb |
|
230 | $ hg ci -mb | |
229 | $ hg up 0 |
|
231 | $ hg up 0 | |
230 | 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 | |
231 | $ echo b >> a |
|
233 | $ echo b >> a | |
232 | $ hg ci -mc |
|
234 | $ hg ci -mc | |
233 | created new head |
|
235 | created new head | |
234 | $ HGMERGE=true hg merge |
|
236 | $ HGMERGE=true hg merge | |
235 | merging a |
|
237 | merging a | |
236 | 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 | |
237 | (branch merge, don't forget to commit) |
|
239 | (branch merge, don't forget to commit) | |
238 |
|
240 | |||
239 | should fail because we are specifying a file name |
|
241 | should fail because we are specifying a file name | |
240 |
|
242 | |||
241 | $ hg ci -mmerge a |
|
243 | $ hg ci -mmerge a | |
242 | 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) | |
243 | [255] |
|
245 | [255] | |
244 |
|
246 | |||
245 | should fail because we are specifying a pattern |
|
247 | should fail because we are specifying a pattern | |
246 |
|
248 | |||
247 | $ hg ci -mmerge -I a |
|
249 | $ hg ci -mmerge -I a | |
248 | 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) | |
249 | [255] |
|
251 | [255] | |
250 |
|
252 | |||
251 | should succeed |
|
253 | should succeed | |
252 |
|
254 | |||
253 | $ hg ci -mmerge |
|
255 | $ hg ci -mmerge | |
254 | $ cd .. |
|
256 | $ cd .. | |
255 |
|
257 | |||
256 |
|
258 | |||
257 | test commit message content |
|
259 | test commit message content | |
258 |
|
260 | |||
259 | $ hg init commitmsg |
|
261 | $ hg init commitmsg | |
260 | $ cd commitmsg |
|
262 | $ cd commitmsg | |
261 | $ echo changed > changed |
|
263 | $ echo changed > changed | |
262 | $ echo removed > removed |
|
264 | $ echo removed > removed | |
263 | $ hg ci -qAm init |
|
265 | $ hg ci -qAm init | |
264 |
|
266 | |||
265 | $ hg rm removed |
|
267 | $ hg rm removed | |
266 | $ echo changed >> changed |
|
268 | $ echo changed >> changed | |
267 | $ echo added > added |
|
269 | $ echo added > added | |
268 | $ hg add added |
|
270 | $ hg add added | |
269 | $ HGEDITOR=cat hg ci -A |
|
271 | $ HGEDITOR=cat hg ci -A | |
270 |
|
272 | |||
271 |
|
273 | |||
272 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
274 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
273 | HG: Leave message empty to abort commit. |
|
275 | HG: Leave message empty to abort commit. | |
274 | HG: -- |
|
276 | HG: -- | |
275 | HG: user: test |
|
277 | HG: user: test | |
276 | HG: branch 'default' |
|
278 | HG: branch 'default' | |
277 | HG: added added |
|
279 | HG: added added | |
278 | HG: changed changed |
|
280 | HG: changed changed | |
279 | HG: removed removed |
|
281 | HG: removed removed | |
280 | abort: empty commit message |
|
282 | abort: empty commit message | |
281 | [255] |
|
283 | [255] |
@@ -1,209 +1,210 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
1 |
|
2 | |||
2 | $ . "$TESTDIR/bzr-definitions" |
|
3 | $ . "$TESTDIR/bzr-definitions" | |
3 |
|
4 | |||
4 | create and rename on the same file in the same step |
|
5 | create and rename on the same file in the same step | |
5 |
|
6 | |||
6 | $ mkdir test-createandrename |
|
7 | $ mkdir test-createandrename | |
7 | $ cd test-createandrename |
|
8 | $ cd test-createandrename | |
8 | $ bzr init -q source |
|
9 | $ bzr init -q source | |
9 | $ cd source |
|
10 | $ cd source | |
10 | $ echo a > a |
|
11 | $ echo a > a | |
11 | $ echo c > c |
|
12 | $ echo c > c | |
12 | $ echo e > e |
|
13 | $ echo e > e | |
13 | $ bzr add -q a c e |
|
14 | $ bzr add -q a c e | |
14 | $ bzr commit -q -m 'Initial add: a, c, e' |
|
15 | $ bzr commit -q -m 'Initial add: a, c, e' | |
15 | $ bzr mv a b |
|
16 | $ bzr mv a b | |
16 | a => b |
|
17 | a => b | |
17 | $ bzr mv c d |
|
18 | $ bzr mv c d | |
18 | c => d |
|
19 | c => d | |
19 | $ bzr mv e f |
|
20 | $ bzr mv e f | |
20 | e => f |
|
21 | e => f | |
21 | $ echo a2 >> a |
|
22 | $ echo a2 >> a | |
22 | $ mkdir e |
|
23 | $ mkdir e | |
23 | $ bzr add -q a e |
|
24 | $ bzr add -q a e | |
24 | $ bzr commit -q -m 'rename a into b, create a, rename c into d' |
|
25 | $ bzr commit -q -m 'rename a into b, create a, rename c into d' | |
25 | $ cd .. |
|
26 | $ cd .. | |
26 | $ hg convert source source-hg |
|
27 | $ hg convert source source-hg | |
27 | initializing destination source-hg repository |
|
28 | initializing destination source-hg repository | |
28 | scanning source... |
|
29 | scanning source... | |
29 | sorting... |
|
30 | sorting... | |
30 | converting... |
|
31 | converting... | |
31 | 1 Initial add: a, c, e |
|
32 | 1 Initial add: a, c, e | |
32 | 0 rename a into b, create a, rename c into d |
|
33 | 0 rename a into b, create a, rename c into d | |
33 | $ glog -R source-hg |
|
34 | $ glog -R source-hg | |
34 | o 1 "rename a into b, create a, rename c into d" files: a b c d e f |
|
35 | o 1 "rename a into b, create a, rename c into d" files: a b c d e f | |
35 | | |
|
36 | | | |
36 | o 0 "Initial add: a, c, e" files: a c e |
|
37 | o 0 "Initial add: a, c, e" files: a c e | |
37 |
|
38 | |||
38 |
|
39 | |||
39 | manifest |
|
40 | manifest | |
40 |
|
41 | |||
41 | $ hg manifest -R source-hg -r tip |
|
42 | $ hg manifest -R source-hg -r tip | |
42 | a |
|
43 | a | |
43 | b |
|
44 | b | |
44 | d |
|
45 | d | |
45 | f |
|
46 | f | |
46 |
|
47 | |||
47 | test --rev option |
|
48 | test --rev option | |
48 |
|
49 | |||
49 | $ hg convert -r 1 source source-1-hg |
|
50 | $ hg convert -r 1 source source-1-hg | |
50 | initializing destination source-1-hg repository |
|
51 | initializing destination source-1-hg repository | |
51 | scanning source... |
|
52 | scanning source... | |
52 | sorting... |
|
53 | sorting... | |
53 | converting... |
|
54 | converting... | |
54 | 0 Initial add: a, c, e |
|
55 | 0 Initial add: a, c, e | |
55 | $ glog -R source-1-hg |
|
56 | $ glog -R source-1-hg | |
56 | o 0 "Initial add: a, c, e" files: a c e |
|
57 | o 0 "Initial add: a, c, e" files: a c e | |
57 |
|
58 | |||
58 |
|
59 | |||
59 | test with filemap |
|
60 | test with filemap | |
60 |
|
61 | |||
61 | $ cat > filemap <<EOF |
|
62 | $ cat > filemap <<EOF | |
62 | > exclude a |
|
63 | > exclude a | |
63 | > EOF |
|
64 | > EOF | |
64 | $ hg convert --filemap filemap source source-filemap-hg |
|
65 | $ hg convert --filemap filemap source source-filemap-hg | |
65 | initializing destination source-filemap-hg repository |
|
66 | initializing destination source-filemap-hg repository | |
66 | scanning source... |
|
67 | scanning source... | |
67 | sorting... |
|
68 | sorting... | |
68 | converting... |
|
69 | converting... | |
69 | 1 Initial add: a, c, e |
|
70 | 1 Initial add: a, c, e | |
70 | 0 rename a into b, create a, rename c into d |
|
71 | 0 rename a into b, create a, rename c into d | |
71 | $ hg -R source-filemap-hg manifest -r tip |
|
72 | $ hg -R source-filemap-hg manifest -r tip | |
72 | b |
|
73 | b | |
73 | d |
|
74 | d | |
74 | f |
|
75 | f | |
75 |
|
76 | |||
76 | convert from lightweight checkout |
|
77 | convert from lightweight checkout | |
77 |
|
78 | |||
78 | $ bzr checkout --lightweight source source-light |
|
79 | $ bzr checkout --lightweight source source-light | |
79 | $ hg convert source-light source-light-hg |
|
80 | $ hg convert source-light source-light-hg | |
80 | initializing destination source-light-hg repository |
|
81 | initializing destination source-light-hg repository | |
81 | warning: lightweight checkouts may cause conversion failures, try with a regular branch instead. |
|
82 | warning: lightweight checkouts may cause conversion failures, try with a regular branch instead. | |
82 | scanning source... |
|
83 | scanning source... | |
83 | sorting... |
|
84 | sorting... | |
84 | converting... |
|
85 | converting... | |
85 | 1 Initial add: a, c, e |
|
86 | 1 Initial add: a, c, e | |
86 | 0 rename a into b, create a, rename c into d |
|
87 | 0 rename a into b, create a, rename c into d | |
87 |
|
88 | |||
88 | lightweight manifest |
|
89 | lightweight manifest | |
89 |
|
90 | |||
90 | $ hg manifest -R source-light-hg -r tip |
|
91 | $ hg manifest -R source-light-hg -r tip | |
91 | a |
|
92 | a | |
92 | b |
|
93 | b | |
93 | d |
|
94 | d | |
94 | f |
|
95 | f | |
95 |
|
96 | |||
96 | extract timestamps that look just like hg's {date|isodate}: |
|
97 | extract timestamps that look just like hg's {date|isodate}: | |
97 | yyyy-mm-dd HH:MM zzzz (no seconds!) |
|
98 | yyyy-mm-dd HH:MM zzzz (no seconds!) | |
98 | compare timestamps |
|
99 | compare timestamps | |
99 |
|
100 | |||
100 | $ cd source |
|
101 | $ cd source | |
101 | $ bzr log | \ |
|
102 | $ bzr log | \ | |
102 | > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \ |
|
103 | > sed '/timestamp/!d;s/.\{15\}\([0-9: -]\{16\}\):.. \(.[0-9]\{4\}\)/\1 \2/' \ | |
103 | > > ../bzr-timestamps |
|
104 | > > ../bzr-timestamps | |
104 | $ cd .. |
|
105 | $ cd .. | |
105 | $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps |
|
106 | $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps | |
106 | $ diff -u bzr-timestamps hg-timestamps |
|
107 | $ diff -u bzr-timestamps hg-timestamps | |
107 | $ cd .. |
|
108 | $ cd .. | |
108 |
|
109 | |||
109 | merge |
|
110 | merge | |
110 |
|
111 | |||
111 | $ mkdir test-merge |
|
112 | $ mkdir test-merge | |
112 | $ cd test-merge |
|
113 | $ cd test-merge | |
113 | $ cat > helper.py <<EOF |
|
114 | $ cat > helper.py <<EOF | |
114 | > import sys |
|
115 | > import sys | |
115 | > from bzrlib import workingtree |
|
116 | > from bzrlib import workingtree | |
116 | > wt = workingtree.WorkingTree.open('.') |
|
117 | > wt = workingtree.WorkingTree.open('.') | |
117 | > |
|
118 | > | |
118 | > message, stamp = sys.argv[1:] |
|
119 | > message, stamp = sys.argv[1:] | |
119 | > wt.commit(message, timestamp=int(stamp)) |
|
120 | > wt.commit(message, timestamp=int(stamp)) | |
120 | > EOF |
|
121 | > EOF | |
121 | $ bzr init -q source |
|
122 | $ bzr init -q source | |
122 | $ cd source |
|
123 | $ cd source | |
123 | $ echo content > a |
|
124 | $ echo content > a | |
124 | $ echo content2 > b |
|
125 | $ echo content2 > b | |
125 | $ bzr add -q a b |
|
126 | $ bzr add -q a b | |
126 | $ bzr commit -q -m 'Initial add' |
|
127 | $ bzr commit -q -m 'Initial add' | |
127 | $ cd .. |
|
128 | $ cd .. | |
128 | $ bzr branch -q source source-improve |
|
129 | $ bzr branch -q source source-improve | |
129 | $ cd source |
|
130 | $ cd source | |
130 | $ echo more >> a |
|
131 | $ echo more >> a | |
131 | $ python ../helper.py 'Editing a' 100 |
|
132 | $ python ../helper.py 'Editing a' 100 | |
132 | $ cd ../source-improve |
|
133 | $ cd ../source-improve | |
133 | $ echo content3 >> b |
|
134 | $ echo content3 >> b | |
134 | $ python ../helper.py 'Editing b' 200 |
|
135 | $ python ../helper.py 'Editing b' 200 | |
135 | $ cd ../source |
|
136 | $ cd ../source | |
136 | $ bzr merge -q ../source-improve |
|
137 | $ bzr merge -q ../source-improve | |
137 | $ bzr commit -q -m 'Merged improve branch' |
|
138 | $ bzr commit -q -m 'Merged improve branch' | |
138 | $ cd .. |
|
139 | $ cd .. | |
139 | $ hg convert --datesort source source-hg |
|
140 | $ hg convert --datesort source source-hg | |
140 | initializing destination source-hg repository |
|
141 | initializing destination source-hg repository | |
141 | scanning source... |
|
142 | scanning source... | |
142 | sorting... |
|
143 | sorting... | |
143 | converting... |
|
144 | converting... | |
144 | 3 Initial add |
|
145 | 3 Initial add | |
145 | 2 Editing a |
|
146 | 2 Editing a | |
146 | 1 Editing b |
|
147 | 1 Editing b | |
147 | 0 Merged improve branch |
|
148 | 0 Merged improve branch | |
148 | $ glog -R source-hg |
|
149 | $ glog -R source-hg | |
149 | o 3 "Merged improve branch" files: |
|
150 | o 3 "Merged improve branch" files: | |
150 | |\ |
|
151 | |\ | |
151 | | o 2 "Editing b" files: b |
|
152 | | o 2 "Editing b" files: b | |
152 | | | |
|
153 | | | | |
153 | o | 1 "Editing a" files: a |
|
154 | o | 1 "Editing a" files: a | |
154 | |/ |
|
155 | |/ | |
155 | o 0 "Initial add" files: a b |
|
156 | o 0 "Initial add" files: a b | |
156 |
|
157 | |||
157 | $ cd .. |
|
158 | $ cd .. | |
158 |
|
159 | |||
159 | symlinks and executable files |
|
160 | symlinks and executable files | |
160 |
|
161 | |||
161 | $ mkdir test-symlinks |
|
162 | $ mkdir test-symlinks | |
162 | $ cd test-symlinks |
|
163 | $ cd test-symlinks | |
163 | $ bzr init -q source |
|
164 | $ bzr init -q source | |
164 | $ cd source |
|
165 | $ cd source | |
165 | $ touch program |
|
166 | $ touch program | |
166 | $ chmod +x program |
|
167 | $ chmod +x program | |
167 | $ ln -s program altname |
|
168 | $ ln -s program altname | |
168 | $ mkdir d |
|
169 | $ mkdir d | |
169 | $ echo a > d/a |
|
170 | $ echo a > d/a | |
170 | $ ln -s a syma |
|
171 | $ ln -s a syma | |
171 | $ bzr add -q altname program syma d/a |
|
172 | $ bzr add -q altname program syma d/a | |
172 | $ bzr commit -q -m 'Initial setup' |
|
173 | $ bzr commit -q -m 'Initial setup' | |
173 | $ touch newprog |
|
174 | $ touch newprog | |
174 | $ chmod +x newprog |
|
175 | $ chmod +x newprog | |
175 | $ rm altname |
|
176 | $ rm altname | |
176 | $ ln -s newprog altname |
|
177 | $ ln -s newprog altname | |
177 | $ chmod -x program |
|
178 | $ chmod -x program | |
178 | $ bzr add -q newprog |
|
179 | $ bzr add -q newprog | |
179 | $ bzr commit -q -m 'Symlink changed, x bits changed' |
|
180 | $ bzr commit -q -m 'Symlink changed, x bits changed' | |
180 | $ cd .. |
|
181 | $ cd .. | |
181 | $ hg convert source source-hg |
|
182 | $ hg convert source source-hg | |
182 | initializing destination source-hg repository |
|
183 | initializing destination source-hg repository | |
183 | scanning source... |
|
184 | scanning source... | |
184 | sorting... |
|
185 | sorting... | |
185 | converting... |
|
186 | converting... | |
186 | 1 Initial setup |
|
187 | 1 Initial setup | |
187 | 0 Symlink changed, x bits changed |
|
188 | 0 Symlink changed, x bits changed | |
188 | $ manifest source-hg 0 |
|
189 | $ manifest source-hg 0 | |
189 | % manifest of 0 |
|
190 | % manifest of 0 | |
190 | 644 @ altname |
|
191 | 644 @ altname | |
191 | 644 d/a |
|
192 | 644 d/a | |
192 | 755 * program |
|
193 | 755 * program | |
193 | 644 @ syma |
|
194 | 644 @ syma | |
194 | $ manifest source-hg tip |
|
195 | $ manifest source-hg tip | |
195 | % manifest of tip |
|
196 | % manifest of tip | |
196 | 644 @ altname |
|
197 | 644 @ altname | |
197 | 644 d/a |
|
198 | 644 d/a | |
198 | 755 * newprog |
|
199 | 755 * newprog | |
199 | 644 program |
|
200 | 644 program | |
200 | 644 @ syma |
|
201 | 644 @ syma | |
201 | $ cd source-hg |
|
202 | $ cd source-hg | |
202 |
|
203 | |||
203 | test the symlinks can be recreated |
|
204 | test the symlinks can be recreated | |
204 |
|
205 | |||
205 | $ hg up |
|
206 | $ hg up | |
206 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
207 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
207 | $ hg cat syma; echo |
|
208 | $ hg cat syma; echo | |
208 | a |
|
209 | a | |
209 |
|
210 |
@@ -1,549 +1,548 | |||||
1 |
|
1 | $ "$TESTDIR/hghave" svn13 no-outer-repo symlink || exit 80 | ||
2 | $ "$TESTDIR/hghave" svn13 no-outer-repo || exit 80 |
|
|||
3 |
|
2 | |||
4 | $ fixpath() |
|
3 | $ fixpath() | |
5 | > { |
|
4 | > { | |
6 | > tr '\\' / |
|
5 | > tr '\\' / | |
7 | > } |
|
6 | > } | |
8 | $ svnupanddisplay() |
|
7 | $ svnupanddisplay() | |
9 | > { |
|
8 | > { | |
10 | > ( |
|
9 | > ( | |
11 | > cd $1; |
|
10 | > cd $1; | |
12 | > svn up; |
|
11 | > svn up; | |
13 | > svn st -v | fixpath | sed 's/ */ /g' |
|
12 | > svn st -v | fixpath | sed 's/ */ /g' | |
14 | > limit='' |
|
13 | > limit='' | |
15 | > if [ $2 -gt 0 ]; then |
|
14 | > if [ $2 -gt 0 ]; then | |
16 | > limit="--limit=$2" |
|
15 | > limit="--limit=$2" | |
17 | > fi |
|
16 | > fi | |
18 | > svn log --xml -v $limit \ |
|
17 | > svn log --xml -v $limit \ | |
19 | > | fixpath \ |
|
18 | > | fixpath \ | |
20 | > | sed 's,<date>.*,<date/>,' \ |
|
19 | > | sed 's,<date>.*,<date/>,' \ | |
21 | > | grep -v 'kind="' |
|
20 | > | grep -v 'kind="' | |
22 | > ) |
|
21 | > ) | |
23 | > } |
|
22 | > } | |
24 |
|
23 | |||
25 | $ cat >> $HGRCPATH <<EOF |
|
24 | $ cat >> $HGRCPATH <<EOF | |
26 | > [extensions] |
|
25 | > [extensions] | |
27 | > convert = |
|
26 | > convert = | |
28 | > graphlog = |
|
27 | > graphlog = | |
29 | > EOF |
|
28 | > EOF | |
30 |
|
29 | |||
31 | $ hg init a |
|
30 | $ hg init a | |
32 |
|
31 | |||
33 | Add |
|
32 | Add | |
34 |
|
33 | |||
35 | $ echo a > a/a |
|
34 | $ echo a > a/a | |
36 | $ mkdir -p a/d1/d2 |
|
35 | $ mkdir -p a/d1/d2 | |
37 | $ echo b > a/d1/d2/b |
|
36 | $ echo b > a/d1/d2/b | |
38 | $ ln -s a/missing a/link |
|
37 | $ ln -s a/missing a/link | |
39 | $ hg --cwd a ci -d '0 0' -A -m 'add a file' |
|
38 | $ hg --cwd a ci -d '0 0' -A -m 'add a file' | |
40 | adding a |
|
39 | adding a | |
41 | adding d1/d2/b |
|
40 | adding d1/d2/b | |
42 | adding link |
|
41 | adding link | |
43 |
|
42 | |||
44 | Modify |
|
43 | Modify | |
45 |
|
44 | |||
46 | $ "$TESTDIR/svn-safe-append.py" a a/a |
|
45 | $ "$TESTDIR/svn-safe-append.py" a a/a | |
47 | $ hg --cwd a ci -d '1 0' -m 'modify a file' |
|
46 | $ hg --cwd a ci -d '1 0' -m 'modify a file' | |
48 | $ hg --cwd a tip -q |
|
47 | $ hg --cwd a tip -q | |
49 | 1:8231f652da37 |
|
48 | 1:8231f652da37 | |
50 |
|
49 | |||
51 | $ hg convert -d svn a |
|
50 | $ hg convert -d svn a | |
52 | assuming destination a-hg |
|
51 | assuming destination a-hg | |
53 | initializing svn repository 'a-hg' |
|
52 | initializing svn repository 'a-hg' | |
54 | initializing svn working copy 'a-hg-wc' |
|
53 | initializing svn working copy 'a-hg-wc' | |
55 | scanning source... |
|
54 | scanning source... | |
56 | sorting... |
|
55 | sorting... | |
57 | converting... |
|
56 | converting... | |
58 | 1 add a file |
|
57 | 1 add a file | |
59 | 0 modify a file |
|
58 | 0 modify a file | |
60 | $ svnupanddisplay a-hg-wc 2 |
|
59 | $ svnupanddisplay a-hg-wc 2 | |
61 | At revision 2. |
|
60 | At revision 2. | |
62 | 2 2 test . |
|
61 | 2 2 test . | |
63 | 2 2 test a |
|
62 | 2 2 test a | |
64 | 2 1 test d1 |
|
63 | 2 1 test d1 | |
65 | 2 1 test d1/d2 |
|
64 | 2 1 test d1/d2 | |
66 | 2 1 test d1/d2/b |
|
65 | 2 1 test d1/d2/b | |
67 | 2 1 test link |
|
66 | 2 1 test link | |
68 | <?xml version="1.0"?> |
|
67 | <?xml version="1.0"?> | |
69 | <log> |
|
68 | <log> | |
70 | <logentry |
|
69 | <logentry | |
71 | revision="2"> |
|
70 | revision="2"> | |
72 | <author>test</author> |
|
71 | <author>test</author> | |
73 | <date/> |
|
72 | <date/> | |
74 | <paths> |
|
73 | <paths> | |
75 | <path |
|
74 | <path | |
76 | action="M">/a</path> |
|
75 | action="M">/a</path> | |
77 | </paths> |
|
76 | </paths> | |
78 | <msg>modify a file</msg> |
|
77 | <msg>modify a file</msg> | |
79 | </logentry> |
|
78 | </logentry> | |
80 | <logentry |
|
79 | <logentry | |
81 | revision="1"> |
|
80 | revision="1"> | |
82 | <author>test</author> |
|
81 | <author>test</author> | |
83 | <date/> |
|
82 | <date/> | |
84 | <paths> |
|
83 | <paths> | |
85 | <path |
|
84 | <path | |
86 | action="A">/a</path> |
|
85 | action="A">/a</path> | |
87 | <path |
|
86 | <path | |
88 | action="A">/d1</path> |
|
87 | action="A">/d1</path> | |
89 | <path |
|
88 | <path | |
90 | action="A">/d1/d2</path> |
|
89 | action="A">/d1/d2</path> | |
91 | <path |
|
90 | <path | |
92 | action="A">/d1/d2/b</path> |
|
91 | action="A">/d1/d2/b</path> | |
93 | <path |
|
92 | <path | |
94 | action="A">/link</path> |
|
93 | action="A">/link</path> | |
95 | </paths> |
|
94 | </paths> | |
96 | <msg>add a file</msg> |
|
95 | <msg>add a file</msg> | |
97 | </logentry> |
|
96 | </logentry> | |
98 | </log> |
|
97 | </log> | |
99 | $ ls a a-hg-wc |
|
98 | $ ls a a-hg-wc | |
100 | a: |
|
99 | a: | |
101 | a |
|
100 | a | |
102 | d1 |
|
101 | d1 | |
103 | link |
|
102 | link | |
104 |
|
103 | |||
105 | a-hg-wc: |
|
104 | a-hg-wc: | |
106 | a |
|
105 | a | |
107 | d1 |
|
106 | d1 | |
108 | link |
|
107 | link | |
109 | $ cmp a/a a-hg-wc/a |
|
108 | $ cmp a/a a-hg-wc/a | |
110 |
|
109 | |||
111 | Rename |
|
110 | Rename | |
112 |
|
111 | |||
113 | $ hg --cwd a mv a b |
|
112 | $ hg --cwd a mv a b | |
114 | $ hg --cwd a mv link newlink |
|
113 | $ hg --cwd a mv link newlink | |
115 |
|
114 | |||
116 | $ hg --cwd a ci -d '2 0' -m 'rename a file' |
|
115 | $ hg --cwd a ci -d '2 0' -m 'rename a file' | |
117 | $ hg --cwd a tip -q |
|
116 | $ hg --cwd a tip -q | |
118 | 2:a67e26ccec09 |
|
117 | 2:a67e26ccec09 | |
119 |
|
118 | |||
120 | $ hg convert -d svn a |
|
119 | $ hg convert -d svn a | |
121 | assuming destination a-hg |
|
120 | assuming destination a-hg | |
122 | initializing svn working copy 'a-hg-wc' |
|
121 | initializing svn working copy 'a-hg-wc' | |
123 | scanning source... |
|
122 | scanning source... | |
124 | sorting... |
|
123 | sorting... | |
125 | converting... |
|
124 | converting... | |
126 | 0 rename a file |
|
125 | 0 rename a file | |
127 | $ svnupanddisplay a-hg-wc 1 |
|
126 | $ svnupanddisplay a-hg-wc 1 | |
128 | At revision 3. |
|
127 | At revision 3. | |
129 | 3 3 test . |
|
128 | 3 3 test . | |
130 | 3 3 test b |
|
129 | 3 3 test b | |
131 | 3 1 test d1 |
|
130 | 3 1 test d1 | |
132 | 3 1 test d1/d2 |
|
131 | 3 1 test d1/d2 | |
133 | 3 1 test d1/d2/b |
|
132 | 3 1 test d1/d2/b | |
134 | 3 3 test newlink |
|
133 | 3 3 test newlink | |
135 | <?xml version="1.0"?> |
|
134 | <?xml version="1.0"?> | |
136 | <log> |
|
135 | <log> | |
137 | <logentry |
|
136 | <logentry | |
138 | revision="3"> |
|
137 | revision="3"> | |
139 | <author>test</author> |
|
138 | <author>test</author> | |
140 | <date/> |
|
139 | <date/> | |
141 | <paths> |
|
140 | <paths> | |
142 | <path |
|
141 | <path | |
143 | action="D">/a</path> |
|
142 | action="D">/a</path> | |
144 | <path |
|
143 | <path | |
145 | copyfrom-path="/a" |
|
144 | copyfrom-path="/a" | |
146 | copyfrom-rev="2" |
|
145 | copyfrom-rev="2" | |
147 | action="A">/b</path> |
|
146 | action="A">/b</path> | |
148 | <path |
|
147 | <path | |
149 | copyfrom-path="/link" |
|
148 | copyfrom-path="/link" | |
150 | copyfrom-rev="2" |
|
149 | copyfrom-rev="2" | |
151 | action="A">/newlink</path> |
|
150 | action="A">/newlink</path> | |
152 | <path |
|
151 | <path | |
153 | action="D">/link</path> |
|
152 | action="D">/link</path> | |
154 | </paths> |
|
153 | </paths> | |
155 | <msg>rename a file</msg> |
|
154 | <msg>rename a file</msg> | |
156 | </logentry> |
|
155 | </logentry> | |
157 | </log> |
|
156 | </log> | |
158 | $ ls a a-hg-wc |
|
157 | $ ls a a-hg-wc | |
159 | a: |
|
158 | a: | |
160 | b |
|
159 | b | |
161 | d1 |
|
160 | d1 | |
162 | newlink |
|
161 | newlink | |
163 |
|
162 | |||
164 | a-hg-wc: |
|
163 | a-hg-wc: | |
165 | b |
|
164 | b | |
166 | d1 |
|
165 | d1 | |
167 | newlink |
|
166 | newlink | |
168 |
|
167 | |||
169 | Copy |
|
168 | Copy | |
170 |
|
169 | |||
171 | $ hg --cwd a cp b c |
|
170 | $ hg --cwd a cp b c | |
172 |
|
171 | |||
173 | $ hg --cwd a ci -d '3 0' -m 'copy a file' |
|
172 | $ hg --cwd a ci -d '3 0' -m 'copy a file' | |
174 | $ hg --cwd a tip -q |
|
173 | $ hg --cwd a tip -q | |
175 | 3:0cf087b9ab02 |
|
174 | 3:0cf087b9ab02 | |
176 |
|
175 | |||
177 | $ hg convert -d svn a |
|
176 | $ hg convert -d svn a | |
178 | assuming destination a-hg |
|
177 | assuming destination a-hg | |
179 | initializing svn working copy 'a-hg-wc' |
|
178 | initializing svn working copy 'a-hg-wc' | |
180 | scanning source... |
|
179 | scanning source... | |
181 | sorting... |
|
180 | sorting... | |
182 | converting... |
|
181 | converting... | |
183 | 0 copy a file |
|
182 | 0 copy a file | |
184 | $ svnupanddisplay a-hg-wc 1 |
|
183 | $ svnupanddisplay a-hg-wc 1 | |
185 | At revision 4. |
|
184 | At revision 4. | |
186 | 4 4 test . |
|
185 | 4 4 test . | |
187 | 4 3 test b |
|
186 | 4 3 test b | |
188 | 4 4 test c |
|
187 | 4 4 test c | |
189 | 4 1 test d1 |
|
188 | 4 1 test d1 | |
190 | 4 1 test d1/d2 |
|
189 | 4 1 test d1/d2 | |
191 | 4 1 test d1/d2/b |
|
190 | 4 1 test d1/d2/b | |
192 | 4 3 test newlink |
|
191 | 4 3 test newlink | |
193 | <?xml version="1.0"?> |
|
192 | <?xml version="1.0"?> | |
194 | <log> |
|
193 | <log> | |
195 | <logentry |
|
194 | <logentry | |
196 | revision="4"> |
|
195 | revision="4"> | |
197 | <author>test</author> |
|
196 | <author>test</author> | |
198 | <date/> |
|
197 | <date/> | |
199 | <paths> |
|
198 | <paths> | |
200 | <path |
|
199 | <path | |
201 | copyfrom-path="/b" |
|
200 | copyfrom-path="/b" | |
202 | copyfrom-rev="3" |
|
201 | copyfrom-rev="3" | |
203 | action="A">/c</path> |
|
202 | action="A">/c</path> | |
204 | </paths> |
|
203 | </paths> | |
205 | <msg>copy a file</msg> |
|
204 | <msg>copy a file</msg> | |
206 | </logentry> |
|
205 | </logentry> | |
207 | </log> |
|
206 | </log> | |
208 | $ ls a a-hg-wc |
|
207 | $ ls a a-hg-wc | |
209 | a: |
|
208 | a: | |
210 | b |
|
209 | b | |
211 | c |
|
210 | c | |
212 | d1 |
|
211 | d1 | |
213 | newlink |
|
212 | newlink | |
214 |
|
213 | |||
215 | a-hg-wc: |
|
214 | a-hg-wc: | |
216 | b |
|
215 | b | |
217 | c |
|
216 | c | |
218 | d1 |
|
217 | d1 | |
219 | newlink |
|
218 | newlink | |
220 |
|
219 | |||
221 | $ hg --cwd a rm b |
|
220 | $ hg --cwd a rm b | |
222 |
|
221 | |||
223 | Remove |
|
222 | Remove | |
224 |
|
223 | |||
225 | $ hg --cwd a ci -d '4 0' -m 'remove a file' |
|
224 | $ hg --cwd a ci -d '4 0' -m 'remove a file' | |
226 | $ hg --cwd a tip -q |
|
225 | $ hg --cwd a tip -q | |
227 | 4:07b2e34a5b17 |
|
226 | 4:07b2e34a5b17 | |
228 |
|
227 | |||
229 | $ hg convert -d svn a |
|
228 | $ hg convert -d svn a | |
230 | assuming destination a-hg |
|
229 | assuming destination a-hg | |
231 | initializing svn working copy 'a-hg-wc' |
|
230 | initializing svn working copy 'a-hg-wc' | |
232 | scanning source... |
|
231 | scanning source... | |
233 | sorting... |
|
232 | sorting... | |
234 | converting... |
|
233 | converting... | |
235 | 0 remove a file |
|
234 | 0 remove a file | |
236 | $ svnupanddisplay a-hg-wc 1 |
|
235 | $ svnupanddisplay a-hg-wc 1 | |
237 | At revision 5. |
|
236 | At revision 5. | |
238 | 5 5 test . |
|
237 | 5 5 test . | |
239 | 5 4 test c |
|
238 | 5 4 test c | |
240 | 5 1 test d1 |
|
239 | 5 1 test d1 | |
241 | 5 1 test d1/d2 |
|
240 | 5 1 test d1/d2 | |
242 | 5 1 test d1/d2/b |
|
241 | 5 1 test d1/d2/b | |
243 | 5 3 test newlink |
|
242 | 5 3 test newlink | |
244 | <?xml version="1.0"?> |
|
243 | <?xml version="1.0"?> | |
245 | <log> |
|
244 | <log> | |
246 | <logentry |
|
245 | <logentry | |
247 | revision="5"> |
|
246 | revision="5"> | |
248 | <author>test</author> |
|
247 | <author>test</author> | |
249 | <date/> |
|
248 | <date/> | |
250 | <paths> |
|
249 | <paths> | |
251 | <path |
|
250 | <path | |
252 | action="D">/b</path> |
|
251 | action="D">/b</path> | |
253 | </paths> |
|
252 | </paths> | |
254 | <msg>remove a file</msg> |
|
253 | <msg>remove a file</msg> | |
255 | </logentry> |
|
254 | </logentry> | |
256 | </log> |
|
255 | </log> | |
257 | $ ls a a-hg-wc |
|
256 | $ ls a a-hg-wc | |
258 | a: |
|
257 | a: | |
259 | c |
|
258 | c | |
260 | d1 |
|
259 | d1 | |
261 | newlink |
|
260 | newlink | |
262 |
|
261 | |||
263 | a-hg-wc: |
|
262 | a-hg-wc: | |
264 | c |
|
263 | c | |
265 | d1 |
|
264 | d1 | |
266 | newlink |
|
265 | newlink | |
267 |
|
266 | |||
268 | Exectutable |
|
267 | Exectutable | |
269 |
|
268 | |||
270 | $ chmod +x a/c |
|
269 | $ chmod +x a/c | |
271 | $ hg --cwd a ci -d '5 0' -m 'make a file executable' |
|
270 | $ hg --cwd a ci -d '5 0' -m 'make a file executable' | |
272 | $ hg --cwd a tip -q |
|
271 | $ hg --cwd a tip -q | |
273 | 5:31093672760b |
|
272 | 5:31093672760b | |
274 |
|
273 | |||
275 | $ hg convert -d svn a |
|
274 | $ hg convert -d svn a | |
276 | assuming destination a-hg |
|
275 | assuming destination a-hg | |
277 | initializing svn working copy 'a-hg-wc' |
|
276 | initializing svn working copy 'a-hg-wc' | |
278 | scanning source... |
|
277 | scanning source... | |
279 | sorting... |
|
278 | sorting... | |
280 | converting... |
|
279 | converting... | |
281 | 0 make a file executable |
|
280 | 0 make a file executable | |
282 | $ svnupanddisplay a-hg-wc 1 |
|
281 | $ svnupanddisplay a-hg-wc 1 | |
283 | At revision 6. |
|
282 | At revision 6. | |
284 | 6 6 test . |
|
283 | 6 6 test . | |
285 | 6 6 test c |
|
284 | 6 6 test c | |
286 | 6 1 test d1 |
|
285 | 6 1 test d1 | |
287 | 6 1 test d1/d2 |
|
286 | 6 1 test d1/d2 | |
288 | 6 1 test d1/d2/b |
|
287 | 6 1 test d1/d2/b | |
289 | 6 3 test newlink |
|
288 | 6 3 test newlink | |
290 | <?xml version="1.0"?> |
|
289 | <?xml version="1.0"?> | |
291 | <log> |
|
290 | <log> | |
292 | <logentry |
|
291 | <logentry | |
293 | revision="6"> |
|
292 | revision="6"> | |
294 | <author>test</author> |
|
293 | <author>test</author> | |
295 | <date/> |
|
294 | <date/> | |
296 | <paths> |
|
295 | <paths> | |
297 | <path |
|
296 | <path | |
298 | action="M">/c</path> |
|
297 | action="M">/c</path> | |
299 | </paths> |
|
298 | </paths> | |
300 | <msg>make a file executable</msg> |
|
299 | <msg>make a file executable</msg> | |
301 | </logentry> |
|
300 | </logentry> | |
302 | </log> |
|
301 | </log> | |
303 | $ test -x a-hg-wc/c |
|
302 | $ test -x a-hg-wc/c | |
304 |
|
303 | |||
305 | Executable in new directory |
|
304 | Executable in new directory | |
306 |
|
305 | |||
307 | $ rm -rf a a-hg a-hg-wc |
|
306 | $ rm -rf a a-hg a-hg-wc | |
308 | $ hg init a |
|
307 | $ hg init a | |
309 |
|
308 | |||
310 | $ mkdir a/d1 |
|
309 | $ mkdir a/d1 | |
311 | $ echo a > a/d1/a |
|
310 | $ echo a > a/d1/a | |
312 | $ chmod +x a/d1/a |
|
311 | $ chmod +x a/d1/a | |
313 | $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory' |
|
312 | $ hg --cwd a ci -d '0 0' -A -m 'add executable file in new directory' | |
314 | adding d1/a |
|
313 | adding d1/a | |
315 |
|
314 | |||
316 | $ hg convert -d svn a |
|
315 | $ hg convert -d svn a | |
317 | assuming destination a-hg |
|
316 | assuming destination a-hg | |
318 | initializing svn repository 'a-hg' |
|
317 | initializing svn repository 'a-hg' | |
319 | initializing svn working copy 'a-hg-wc' |
|
318 | initializing svn working copy 'a-hg-wc' | |
320 | scanning source... |
|
319 | scanning source... | |
321 | sorting... |
|
320 | sorting... | |
322 | converting... |
|
321 | converting... | |
323 | 0 add executable file in new directory |
|
322 | 0 add executable file in new directory | |
324 | $ svnupanddisplay a-hg-wc 1 |
|
323 | $ svnupanddisplay a-hg-wc 1 | |
325 | At revision 1. |
|
324 | At revision 1. | |
326 | 1 1 test . |
|
325 | 1 1 test . | |
327 | 1 1 test d1 |
|
326 | 1 1 test d1 | |
328 | 1 1 test d1/a |
|
327 | 1 1 test d1/a | |
329 | <?xml version="1.0"?> |
|
328 | <?xml version="1.0"?> | |
330 | <log> |
|
329 | <log> | |
331 | <logentry |
|
330 | <logentry | |
332 | revision="1"> |
|
331 | revision="1"> | |
333 | <author>test</author> |
|
332 | <author>test</author> | |
334 | <date/> |
|
333 | <date/> | |
335 | <paths> |
|
334 | <paths> | |
336 | <path |
|
335 | <path | |
337 | action="A">/d1</path> |
|
336 | action="A">/d1</path> | |
338 | <path |
|
337 | <path | |
339 | action="A">/d1/a</path> |
|
338 | action="A">/d1/a</path> | |
340 | </paths> |
|
339 | </paths> | |
341 | <msg>add executable file in new directory</msg> |
|
340 | <msg>add executable file in new directory</msg> | |
342 | </logentry> |
|
341 | </logentry> | |
343 | </log> |
|
342 | </log> | |
344 | $ test -x a-hg-wc/d1/a |
|
343 | $ test -x a-hg-wc/d1/a | |
345 |
|
344 | |||
346 | Copy to new directory |
|
345 | Copy to new directory | |
347 |
|
346 | |||
348 | $ mkdir a/d2 |
|
347 | $ mkdir a/d2 | |
349 | $ hg --cwd a cp d1/a d2/a |
|
348 | $ hg --cwd a cp d1/a d2/a | |
350 | $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory' |
|
349 | $ hg --cwd a ci -d '1 0' -A -m 'copy file to new directory' | |
351 |
|
350 | |||
352 | $ hg convert -d svn a |
|
351 | $ hg convert -d svn a | |
353 | assuming destination a-hg |
|
352 | assuming destination a-hg | |
354 | initializing svn working copy 'a-hg-wc' |
|
353 | initializing svn working copy 'a-hg-wc' | |
355 | scanning source... |
|
354 | scanning source... | |
356 | sorting... |
|
355 | sorting... | |
357 | converting... |
|
356 | converting... | |
358 | 0 copy file to new directory |
|
357 | 0 copy file to new directory | |
359 | $ svnupanddisplay a-hg-wc 1 |
|
358 | $ svnupanddisplay a-hg-wc 1 | |
360 | At revision 2. |
|
359 | At revision 2. | |
361 | 2 2 test . |
|
360 | 2 2 test . | |
362 | 2 1 test d1 |
|
361 | 2 1 test d1 | |
363 | 2 1 test d1/a |
|
362 | 2 1 test d1/a | |
364 | 2 2 test d2 |
|
363 | 2 2 test d2 | |
365 | 2 2 test d2/a |
|
364 | 2 2 test d2/a | |
366 | <?xml version="1.0"?> |
|
365 | <?xml version="1.0"?> | |
367 | <log> |
|
366 | <log> | |
368 | <logentry |
|
367 | <logentry | |
369 | revision="2"> |
|
368 | revision="2"> | |
370 | <author>test</author> |
|
369 | <author>test</author> | |
371 | <date/> |
|
370 | <date/> | |
372 | <paths> |
|
371 | <paths> | |
373 | <path |
|
372 | <path | |
374 | action="A">/d2</path> |
|
373 | action="A">/d2</path> | |
375 | <path |
|
374 | <path | |
376 | copyfrom-path="/d1/a" |
|
375 | copyfrom-path="/d1/a" | |
377 | copyfrom-rev="1" |
|
376 | copyfrom-rev="1" | |
378 | action="A">/d2/a</path> |
|
377 | action="A">/d2/a</path> | |
379 | </paths> |
|
378 | </paths> | |
380 | <msg>copy file to new directory</msg> |
|
379 | <msg>copy file to new directory</msg> | |
381 | </logentry> |
|
380 | </logentry> | |
382 | </log> |
|
381 | </log> | |
383 |
|
382 | |||
384 | Branchy history |
|
383 | Branchy history | |
385 |
|
384 | |||
386 | $ hg init b |
|
385 | $ hg init b | |
387 | $ echo base > b/b |
|
386 | $ echo base > b/b | |
388 | $ hg --cwd b ci -d '0 0' -Ambase |
|
387 | $ hg --cwd b ci -d '0 0' -Ambase | |
389 | adding b |
|
388 | adding b | |
390 |
|
389 | |||
391 | $ "$TESTDIR/svn-safe-append.py" left-1 b/b |
|
390 | $ "$TESTDIR/svn-safe-append.py" left-1 b/b | |
392 | $ echo left-1 > b/left-1 |
|
391 | $ echo left-1 > b/left-1 | |
393 | $ hg --cwd b ci -d '1 0' -Amleft-1 |
|
392 | $ hg --cwd b ci -d '1 0' -Amleft-1 | |
394 | adding left-1 |
|
393 | adding left-1 | |
395 |
|
394 | |||
396 | $ "$TESTDIR/svn-safe-append.py" left-2 b/b |
|
395 | $ "$TESTDIR/svn-safe-append.py" left-2 b/b | |
397 | $ echo left-2 > b/left-2 |
|
396 | $ echo left-2 > b/left-2 | |
398 | $ hg --cwd b ci -d '2 0' -Amleft-2 |
|
397 | $ hg --cwd b ci -d '2 0' -Amleft-2 | |
399 | adding left-2 |
|
398 | adding left-2 | |
400 |
|
399 | |||
401 | $ hg --cwd b up 0 |
|
400 | $ hg --cwd b up 0 | |
402 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
401 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
403 |
|
402 | |||
404 | $ "$TESTDIR/svn-safe-append.py" right-1 b/b |
|
403 | $ "$TESTDIR/svn-safe-append.py" right-1 b/b | |
405 | $ echo right-1 > b/right-1 |
|
404 | $ echo right-1 > b/right-1 | |
406 | $ hg --cwd b ci -d '3 0' -Amright-1 |
|
405 | $ hg --cwd b ci -d '3 0' -Amright-1 | |
407 | adding right-1 |
|
406 | adding right-1 | |
408 | created new head |
|
407 | created new head | |
409 |
|
408 | |||
410 | $ "$TESTDIR/svn-safe-append.py" right-2 b/b |
|
409 | $ "$TESTDIR/svn-safe-append.py" right-2 b/b | |
411 | $ echo right-2 > b/right-2 |
|
410 | $ echo right-2 > b/right-2 | |
412 | $ hg --cwd b ci -d '4 0' -Amright-2 |
|
411 | $ hg --cwd b ci -d '4 0' -Amright-2 | |
413 | adding right-2 |
|
412 | adding right-2 | |
414 |
|
413 | |||
415 | $ hg --cwd b up -C 2 |
|
414 | $ hg --cwd b up -C 2 | |
416 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
415 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
417 | $ hg --cwd b merge |
|
416 | $ hg --cwd b merge | |
418 | merging b |
|
417 | merging b | |
419 | warning: conflicts during merge. |
|
418 | warning: conflicts during merge. | |
420 | merging b failed! |
|
419 | merging b failed! | |
421 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
420 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
422 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
421 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon | |
423 | [1] |
|
422 | [1] | |
424 | $ hg --cwd b revert -r 2 b |
|
423 | $ hg --cwd b revert -r 2 b | |
425 | $ hg resolve -m b |
|
424 | $ hg resolve -m b | |
426 | $ hg --cwd b ci -d '5 0' -m 'merge' |
|
425 | $ hg --cwd b ci -d '5 0' -m 'merge' | |
427 |
|
426 | |||
428 | Expect 4 changes |
|
427 | Expect 4 changes | |
429 |
|
428 | |||
430 | $ hg convert -d svn b |
|
429 | $ hg convert -d svn b | |
431 | assuming destination b-hg |
|
430 | assuming destination b-hg | |
432 | initializing svn repository 'b-hg' |
|
431 | initializing svn repository 'b-hg' | |
433 | initializing svn working copy 'b-hg-wc' |
|
432 | initializing svn working copy 'b-hg-wc' | |
434 | scanning source... |
|
433 | scanning source... | |
435 | sorting... |
|
434 | sorting... | |
436 | converting... |
|
435 | converting... | |
437 | 5 base |
|
436 | 5 base | |
438 | 4 left-1 |
|
437 | 4 left-1 | |
439 | 3 left-2 |
|
438 | 3 left-2 | |
440 | 2 right-1 |
|
439 | 2 right-1 | |
441 | 1 right-2 |
|
440 | 1 right-2 | |
442 | 0 merge |
|
441 | 0 merge | |
443 |
|
442 | |||
444 | $ svnupanddisplay b-hg-wc 0 |
|
443 | $ svnupanddisplay b-hg-wc 0 | |
445 | At revision 4. |
|
444 | At revision 4. | |
446 | 4 4 test . |
|
445 | 4 4 test . | |
447 | 4 3 test b |
|
446 | 4 3 test b | |
448 | 4 2 test left-1 |
|
447 | 4 2 test left-1 | |
449 | 4 3 test left-2 |
|
448 | 4 3 test left-2 | |
450 | 4 4 test right-1 |
|
449 | 4 4 test right-1 | |
451 | 4 4 test right-2 |
|
450 | 4 4 test right-2 | |
452 | <?xml version="1.0"?> |
|
451 | <?xml version="1.0"?> | |
453 | <log> |
|
452 | <log> | |
454 | <logentry |
|
453 | <logentry | |
455 | revision="4"> |
|
454 | revision="4"> | |
456 | <author>test</author> |
|
455 | <author>test</author> | |
457 | <date/> |
|
456 | <date/> | |
458 | <paths> |
|
457 | <paths> | |
459 | <path |
|
458 | <path | |
460 | action="A">/right-1</path> |
|
459 | action="A">/right-1</path> | |
461 | <path |
|
460 | <path | |
462 | action="A">/right-2</path> |
|
461 | action="A">/right-2</path> | |
463 | </paths> |
|
462 | </paths> | |
464 | <msg>merge</msg> |
|
463 | <msg>merge</msg> | |
465 | </logentry> |
|
464 | </logentry> | |
466 | <logentry |
|
465 | <logentry | |
467 | revision="3"> |
|
466 | revision="3"> | |
468 | <author>test</author> |
|
467 | <author>test</author> | |
469 | <date/> |
|
468 | <date/> | |
470 | <paths> |
|
469 | <paths> | |
471 | <path |
|
470 | <path | |
472 | action="M">/b</path> |
|
471 | action="M">/b</path> | |
473 | <path |
|
472 | <path | |
474 | action="A">/left-2</path> |
|
473 | action="A">/left-2</path> | |
475 | </paths> |
|
474 | </paths> | |
476 | <msg>left-2</msg> |
|
475 | <msg>left-2</msg> | |
477 | </logentry> |
|
476 | </logentry> | |
478 | <logentry |
|
477 | <logentry | |
479 | revision="2"> |
|
478 | revision="2"> | |
480 | <author>test</author> |
|
479 | <author>test</author> | |
481 | <date/> |
|
480 | <date/> | |
482 | <paths> |
|
481 | <paths> | |
483 | <path |
|
482 | <path | |
484 | action="M">/b</path> |
|
483 | action="M">/b</path> | |
485 | <path |
|
484 | <path | |
486 | action="A">/left-1</path> |
|
485 | action="A">/left-1</path> | |
487 | </paths> |
|
486 | </paths> | |
488 | <msg>left-1</msg> |
|
487 | <msg>left-1</msg> | |
489 | </logentry> |
|
488 | </logentry> | |
490 | <logentry |
|
489 | <logentry | |
491 | revision="1"> |
|
490 | revision="1"> | |
492 | <author>test</author> |
|
491 | <author>test</author> | |
493 | <date/> |
|
492 | <date/> | |
494 | <paths> |
|
493 | <paths> | |
495 | <path |
|
494 | <path | |
496 | action="A">/b</path> |
|
495 | action="A">/b</path> | |
497 | </paths> |
|
496 | </paths> | |
498 | <msg>base</msg> |
|
497 | <msg>base</msg> | |
499 | </logentry> |
|
498 | </logentry> | |
500 | </log> |
|
499 | </log> | |
501 |
|
500 | |||
502 | Tags are not supported, but must not break conversion |
|
501 | Tags are not supported, but must not break conversion | |
503 |
|
502 | |||
504 | $ rm -rf a a-hg a-hg-wc |
|
503 | $ rm -rf a a-hg a-hg-wc | |
505 | $ hg init a |
|
504 | $ hg init a | |
506 | $ echo a > a/a |
|
505 | $ echo a > a/a | |
507 | $ hg --cwd a ci -d '0 0' -A -m 'Add file a' |
|
506 | $ hg --cwd a ci -d '0 0' -A -m 'Add file a' | |
508 | adding a |
|
507 | adding a | |
509 | $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0 |
|
508 | $ hg --cwd a tag -d '1 0' -m 'Tagged as v1.0' v1.0 | |
510 |
|
509 | |||
511 | $ hg convert -d svn a |
|
510 | $ hg convert -d svn a | |
512 | assuming destination a-hg |
|
511 | assuming destination a-hg | |
513 | initializing svn repository 'a-hg' |
|
512 | initializing svn repository 'a-hg' | |
514 | initializing svn working copy 'a-hg-wc' |
|
513 | initializing svn working copy 'a-hg-wc' | |
515 | scanning source... |
|
514 | scanning source... | |
516 | sorting... |
|
515 | sorting... | |
517 | converting... |
|
516 | converting... | |
518 | 1 Add file a |
|
517 | 1 Add file a | |
519 | 0 Tagged as v1.0 |
|
518 | 0 Tagged as v1.0 | |
520 | writing Subversion tags is not yet implemented |
|
519 | writing Subversion tags is not yet implemented | |
521 | $ svnupanddisplay a-hg-wc 2 |
|
520 | $ svnupanddisplay a-hg-wc 2 | |
522 | At revision 2. |
|
521 | At revision 2. | |
523 | 2 2 test . |
|
522 | 2 2 test . | |
524 | 2 1 test a |
|
523 | 2 1 test a | |
525 | 2 2 test .hgtags |
|
524 | 2 2 test .hgtags | |
526 | <?xml version="1.0"?> |
|
525 | <?xml version="1.0"?> | |
527 | <log> |
|
526 | <log> | |
528 | <logentry |
|
527 | <logentry | |
529 | revision="2"> |
|
528 | revision="2"> | |
530 | <author>test</author> |
|
529 | <author>test</author> | |
531 | <date/> |
|
530 | <date/> | |
532 | <paths> |
|
531 | <paths> | |
533 | <path |
|
532 | <path | |
534 | action="A">/.hgtags</path> |
|
533 | action="A">/.hgtags</path> | |
535 | </paths> |
|
534 | </paths> | |
536 | <msg>Tagged as v1.0</msg> |
|
535 | <msg>Tagged as v1.0</msg> | |
537 | </logentry> |
|
536 | </logentry> | |
538 | <logentry |
|
537 | <logentry | |
539 | revision="1"> |
|
538 | revision="1"> | |
540 | <author>test</author> |
|
539 | <author>test</author> | |
541 | <date/> |
|
540 | <date/> | |
542 | <paths> |
|
541 | <paths> | |
543 | <path |
|
542 | <path | |
544 | action="A">/a</path> |
|
543 | action="A">/a</path> | |
545 | </paths> |
|
544 | </paths> | |
546 | <msg>Add file a</msg> |
|
545 | <msg>Add file a</msg> | |
547 | </logentry> |
|
546 | </logentry> | |
548 | </log> |
|
547 | </log> | |
549 | $ rm -rf a a-hg a-hg-wc |
|
548 | $ rm -rf a a-hg a-hg-wc |
@@ -1,135 +1,135 | |||||
1 |
|
1 | |||
2 | $ "$TESTDIR/hghave" tla || exit 80 |
|
2 | $ "$TESTDIR/hghave" tla symlink || exit 80 | |
3 | $ tla my-id "mercurial <mercurial@selenic.com>" |
|
3 | $ tla my-id "mercurial <mercurial@selenic.com>" | |
4 | $ echo "[extensions]" >> $HGRCPATH |
|
4 | $ echo "[extensions]" >> $HGRCPATH | |
5 | $ echo "convert=" >> $HGRCPATH |
|
5 | $ echo "convert=" >> $HGRCPATH | |
6 | $ echo 'graphlog =' >> $HGRCPATH |
|
6 | $ echo 'graphlog =' >> $HGRCPATH | |
7 |
|
7 | |||
8 | create tla archive |
|
8 | create tla archive | |
9 |
|
9 | |||
10 | $ tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla |
|
10 | $ tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla | |
11 |
|
11 | |||
12 | initialize tla repo |
|
12 | initialize tla repo | |
13 |
|
13 | |||
14 | $ mkdir tla-repo |
|
14 | $ mkdir tla-repo | |
15 | $ cd tla-repo/ |
|
15 | $ cd tla-repo/ | |
16 | $ tla init-tree tla@mercurial--convert/tla--test--0 |
|
16 | $ tla init-tree tla@mercurial--convert/tla--test--0 | |
17 | $ tla import |
|
17 | $ tla import | |
18 | * creating version tla@mercurial--convert/tla--test--0 |
|
18 | * creating version tla@mercurial--convert/tla--test--0 | |
19 | * imported tla@mercurial--convert/tla--test--0 |
|
19 | * imported tla@mercurial--convert/tla--test--0 | |
20 |
|
20 | |||
21 | create initial files |
|
21 | create initial files | |
22 |
|
22 | |||
23 | $ echo 'this is a file' > a |
|
23 | $ echo 'this is a file' > a | |
24 | $ tla add a |
|
24 | $ tla add a | |
25 | $ mkdir src |
|
25 | $ mkdir src | |
26 | $ tla add src |
|
26 | $ tla add src | |
27 | $ cd src |
|
27 | $ cd src | |
28 | $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
28 | $ dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null | |
29 | $ tla add b |
|
29 | $ tla add b | |
30 | $ tla commit -s "added a file, src and src/b (binary)" |
|
30 | $ tla commit -s "added a file, src and src/b (binary)" | |
31 | A/ .arch-ids |
|
31 | A/ .arch-ids | |
32 | A/ src |
|
32 | A/ src | |
33 | A/ src/.arch-ids |
|
33 | A/ src/.arch-ids | |
34 | A .arch-ids/a.id |
|
34 | A .arch-ids/a.id | |
35 | A a |
|
35 | A a | |
36 | A src/.arch-ids/=id |
|
36 | A src/.arch-ids/=id | |
37 | A src/.arch-ids/b.id |
|
37 | A src/.arch-ids/b.id | |
38 | A src/b |
|
38 | A src/b | |
39 | * update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1) |
|
39 | * update pristine tree (tla@mercurial--convert/tla--test--0--base-0 => tla--test--0--patch-1) | |
40 | * committed tla@mercurial--convert/tla--test--0--patch-1 |
|
40 | * committed tla@mercurial--convert/tla--test--0--patch-1 | |
41 |
|
41 | |||
42 | create link file and modify a |
|
42 | create link file and modify a | |
43 |
|
43 | |||
44 | $ ln -s ../a a-link |
|
44 | $ ln -s ../a a-link | |
45 | $ tla add a-link |
|
45 | $ tla add a-link | |
46 | $ echo 'this a modification to a' >> ../a |
|
46 | $ echo 'this a modification to a' >> ../a | |
47 | $ tla commit -s "added link to a and modify a" |
|
47 | $ tla commit -s "added link to a and modify a" | |
48 | A src/.arch-ids/a-link.id |
|
48 | A src/.arch-ids/a-link.id | |
49 | A src/a-link |
|
49 | A src/a-link | |
50 | M a |
|
50 | M a | |
51 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2) |
|
51 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-1 => tla--test--0--patch-2) | |
52 | * committed tla@mercurial--convert/tla--test--0--patch-2 |
|
52 | * committed tla@mercurial--convert/tla--test--0--patch-2 | |
53 |
|
53 | |||
54 | create second link and modify b |
|
54 | create second link and modify b | |
55 |
|
55 | |||
56 | $ ln -s ../a a-link-2 |
|
56 | $ ln -s ../a a-link-2 | |
57 | $ tla add a-link-2 |
|
57 | $ tla add a-link-2 | |
58 | $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null |
|
58 | $ dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null | |
59 | $ tla commit -s "added second link and modify b" |
|
59 | $ tla commit -s "added second link and modify b" | |
60 | A src/.arch-ids/a-link-2.id |
|
60 | A src/.arch-ids/a-link-2.id | |
61 | A src/a-link-2 |
|
61 | A src/a-link-2 | |
62 | Mb src/b |
|
62 | Mb src/b | |
63 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3) |
|
63 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-2 => tla--test--0--patch-3) | |
64 | * committed tla@mercurial--convert/tla--test--0--patch-3 |
|
64 | * committed tla@mercurial--convert/tla--test--0--patch-3 | |
65 |
|
65 | |||
66 | b file to link and a-link-2 to regular file |
|
66 | b file to link and a-link-2 to regular file | |
67 |
|
67 | |||
68 | $ rm -f a-link-2 |
|
68 | $ rm -f a-link-2 | |
69 | $ echo 'this is now a regular file' > a-link-2 |
|
69 | $ echo 'this is now a regular file' > a-link-2 | |
70 | $ ln -sf ../a b |
|
70 | $ ln -sf ../a b | |
71 | $ tla commit -s "file to link and link to file test" |
|
71 | $ tla commit -s "file to link and link to file test" | |
72 | fl src/b |
|
72 | fl src/b | |
73 | lf src/a-link-2 |
|
73 | lf src/a-link-2 | |
74 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4) |
|
74 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-3 => tla--test--0--patch-4) | |
75 | * committed tla@mercurial--convert/tla--test--0--patch-4 |
|
75 | * committed tla@mercurial--convert/tla--test--0--patch-4 | |
76 |
|
76 | |||
77 | move a-link-2 file and src directory |
|
77 | move a-link-2 file and src directory | |
78 |
|
78 | |||
79 | $ cd .. |
|
79 | $ cd .. | |
80 | $ tla mv src/a-link-2 c |
|
80 | $ tla mv src/a-link-2 c | |
81 | $ tla mv src test |
|
81 | $ tla mv src test | |
82 | $ tla commit -s "move and rename a-link-2 file and src directory" |
|
82 | $ tla commit -s "move and rename a-link-2 file and src directory" | |
83 | D/ src/.arch-ids |
|
83 | D/ src/.arch-ids | |
84 | A/ test/.arch-ids |
|
84 | A/ test/.arch-ids | |
85 | /> src test |
|
85 | /> src test | |
86 | => src/.arch-ids/a-link-2.id .arch-ids/c.id |
|
86 | => src/.arch-ids/a-link-2.id .arch-ids/c.id | |
87 | => src/a-link-2 c |
|
87 | => src/a-link-2 c | |
88 | => src/.arch-ids/=id test/.arch-ids/=id |
|
88 | => src/.arch-ids/=id test/.arch-ids/=id | |
89 | => src/.arch-ids/a-link.id test/.arch-ids/a-link.id |
|
89 | => src/.arch-ids/a-link.id test/.arch-ids/a-link.id | |
90 | => src/.arch-ids/b.id test/.arch-ids/b.id |
|
90 | => src/.arch-ids/b.id test/.arch-ids/b.id | |
91 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5) |
|
91 | * update pristine tree (tla@mercurial--convert/tla--test--0--patch-4 => tla--test--0--patch-5) | |
92 | * committed tla@mercurial--convert/tla--test--0--patch-5 |
|
92 | * committed tla@mercurial--convert/tla--test--0--patch-5 | |
93 | $ cd .. |
|
93 | $ cd .. | |
94 |
|
94 | |||
95 | converting tla repo to Mercurial |
|
95 | converting tla repo to Mercurial | |
96 |
|
96 | |||
97 | $ hg convert tla-repo tla-repo-hg |
|
97 | $ hg convert tla-repo tla-repo-hg | |
98 | initializing destination tla-repo-hg repository |
|
98 | initializing destination tla-repo-hg repository | |
99 | analyzing tree version tla@mercurial--convert/tla--test--0... |
|
99 | analyzing tree version tla@mercurial--convert/tla--test--0... | |
100 | scanning source... |
|
100 | scanning source... | |
101 | sorting... |
|
101 | sorting... | |
102 | converting... |
|
102 | converting... | |
103 | 5 initial import |
|
103 | 5 initial import | |
104 | 4 added a file, src and src/b (binary) |
|
104 | 4 added a file, src and src/b (binary) | |
105 | 3 added link to a and modify a |
|
105 | 3 added link to a and modify a | |
106 | 2 added second link and modify b |
|
106 | 2 added second link and modify b | |
107 | 1 file to link and link to file test |
|
107 | 1 file to link and link to file test | |
108 | 0 move and rename a-link-2 file and src directory |
|
108 | 0 move and rename a-link-2 file and src directory | |
109 | $ tla register-archive -d tla@mercurial--convert |
|
109 | $ tla register-archive -d tla@mercurial--convert | |
110 | $ glog() |
|
110 | $ glog() | |
111 | > { |
|
111 | > { | |
112 | > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" |
|
112 | > hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" | |
113 | > } |
|
113 | > } | |
114 |
|
114 | |||
115 | show graph log |
|
115 | show graph log | |
116 |
|
116 | |||
117 | $ glog -R tla-repo-hg |
|
117 | $ glog -R tla-repo-hg | |
118 | o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b |
|
118 | o 5 "move and rename a-link-2 file and src directory" files: c src/a-link src/a-link-2 src/b test/a-link test/b | |
119 | | |
|
119 | | | |
120 | o 4 "file to link and link to file test" files: src/a-link-2 src/b |
|
120 | o 4 "file to link and link to file test" files: src/a-link-2 src/b | |
121 | | |
|
121 | | | |
122 | o 3 "added second link and modify b" files: src/a-link-2 src/b |
|
122 | o 3 "added second link and modify b" files: src/a-link-2 src/b | |
123 | | |
|
123 | | | |
124 | o 2 "added link to a and modify a" files: a src/a-link |
|
124 | o 2 "added link to a and modify a" files: a src/a-link | |
125 | | |
|
125 | | | |
126 | o 1 "added a file, src and src/b (binary)" files: a src/b |
|
126 | o 1 "added a file, src and src/b (binary)" files: a src/b | |
127 | | |
|
127 | | | |
128 | o 0 "initial import" files: |
|
128 | o 0 "initial import" files: | |
129 |
|
129 | |||
130 | $ hg up -q -R tla-repo-hg |
|
130 | $ hg up -q -R tla-repo-hg | |
131 | $ hg -R tla-repo-hg manifest --debug |
|
131 | $ hg -R tla-repo-hg manifest --debug | |
132 | c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a |
|
132 | c4072c4b72e1cabace081888efa148ee80ca3cbb 644 a | |
133 | 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c |
|
133 | 0201ac32a3a8e86e303dff60366382a54b48a72e 644 c | |
134 | c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link |
|
134 | c0067ba5ff0b7c9a3eb17270839d04614c435623 644 @ test/a-link | |
135 | 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b |
|
135 | 375f4263d86feacdea7e3c27100abd1560f2a973 644 @ test/b |
@@ -1,196 +1,198 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ echo "[extensions]" >> $HGRCPATH |
|
3 | $ echo "[extensions]" >> $HGRCPATH | |
2 | $ echo "extdiff=" >> $HGRCPATH |
|
4 | $ echo "extdiff=" >> $HGRCPATH | |
3 |
|
5 | |||
4 | $ hg init a |
|
6 | $ hg init a | |
5 | $ cd a |
|
7 | $ cd a | |
6 | $ echo a > a |
|
8 | $ echo a > a | |
7 | $ echo b > b |
|
9 | $ echo b > b | |
8 | $ hg add |
|
10 | $ hg add | |
9 | adding a |
|
11 | adding a | |
10 | adding b |
|
12 | adding b | |
11 |
|
13 | |||
12 | Should diff cloned directories: |
|
14 | Should diff cloned directories: | |
13 |
|
15 | |||
14 | $ hg extdiff -o -r $opt |
|
16 | $ hg extdiff -o -r $opt | |
15 | Only in a: a |
|
17 | Only in a: a | |
16 | Only in a: b |
|
18 | Only in a: b | |
17 | [1] |
|
19 | [1] | |
18 |
|
20 | |||
19 | $ echo "[extdiff]" >> $HGRCPATH |
|
21 | $ echo "[extdiff]" >> $HGRCPATH | |
20 | $ echo "cmd.falabala=echo" >> $HGRCPATH |
|
22 | $ echo "cmd.falabala=echo" >> $HGRCPATH | |
21 | $ echo "opts.falabala=diffing" >> $HGRCPATH |
|
23 | $ echo "opts.falabala=diffing" >> $HGRCPATH | |
22 |
|
24 | |||
23 | $ hg falabala |
|
25 | $ hg falabala | |
24 | diffing a.000000000000 a |
|
26 | diffing a.000000000000 a | |
25 | [1] |
|
27 | [1] | |
26 |
|
28 | |||
27 | $ hg help falabala |
|
29 | $ hg help falabala | |
28 | hg falabala [OPTION]... [FILE]... |
|
30 | hg falabala [OPTION]... [FILE]... | |
29 |
|
31 | |||
30 | use 'echo' to diff repository (or selected files) |
|
32 | use 'echo' to diff repository (or selected files) | |
31 |
|
33 | |||
32 | Show differences between revisions for the specified files, using the |
|
34 | Show differences between revisions for the specified files, using the | |
33 | 'echo' program. |
|
35 | 'echo' program. | |
34 |
|
36 | |||
35 | When two revision arguments are given, then changes are shown between |
|
37 | When two revision arguments are given, then changes are shown between | |
36 | those revisions. If only one revision is specified then that revision is |
|
38 | those revisions. If only one revision is specified then that revision is | |
37 | compared to the working directory, and, when no revisions are specified, |
|
39 | compared to the working directory, and, when no revisions are specified, | |
38 | the working directory files are compared to its parent. |
|
40 | the working directory files are compared to its parent. | |
39 |
|
41 | |||
40 | options: |
|
42 | options: | |
41 |
|
43 | |||
42 | -o --option OPT [+] pass option to comparison program |
|
44 | -o --option OPT [+] pass option to comparison program | |
43 | -r --rev REV [+] revision |
|
45 | -r --rev REV [+] revision | |
44 | -c --change REV change made by revision |
|
46 | -c --change REV change made by revision | |
45 | -I --include PATTERN [+] include names matching the given patterns |
|
47 | -I --include PATTERN [+] include names matching the given patterns | |
46 | -X --exclude PATTERN [+] exclude names matching the given patterns |
|
48 | -X --exclude PATTERN [+] exclude names matching the given patterns | |
47 |
|
49 | |||
48 | [+] marked option can be specified multiple times |
|
50 | [+] marked option can be specified multiple times | |
49 |
|
51 | |||
50 | use "hg -v help falabala" to show more info |
|
52 | use "hg -v help falabala" to show more info | |
51 |
|
53 | |||
52 | $ hg ci -d '0 0' -mtest1 |
|
54 | $ hg ci -d '0 0' -mtest1 | |
53 |
|
55 | |||
54 | $ echo b >> a |
|
56 | $ echo b >> a | |
55 | $ hg ci -d '1 0' -mtest2 |
|
57 | $ hg ci -d '1 0' -mtest2 | |
56 |
|
58 | |||
57 | Should diff cloned files directly: |
|
59 | Should diff cloned files directly: | |
58 |
|
60 | |||
59 | $ hg falabala -r 0:1 |
|
61 | $ hg falabala -r 0:1 | |
60 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
62 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
61 | [1] |
|
63 | [1] | |
62 |
|
64 | |||
63 | Test diff during merge: |
|
65 | Test diff during merge: | |
64 |
|
66 | |||
65 | $ hg update -C 0 |
|
67 | $ hg update -C 0 | |
66 | 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 | |
67 | $ echo c >> c |
|
69 | $ echo c >> c | |
68 | $ hg add c |
|
70 | $ hg add c | |
69 | $ hg ci -m "new branch" -d '1 0' |
|
71 | $ hg ci -m "new branch" -d '1 0' | |
70 | created new head |
|
72 | created new head | |
71 | $ hg merge 1 |
|
73 | $ hg merge 1 | |
72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
74 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
73 | (branch merge, don't forget to commit) |
|
75 | (branch merge, don't forget to commit) | |
74 |
|
76 | |||
75 | Should diff cloned file against wc file: |
|
77 | Should diff cloned file against wc file: | |
76 |
|
78 | |||
77 | $ hg falabala |
|
79 | $ hg falabala | |
78 | diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) |
|
80 | diffing */extdiff.*/a.2a13a4d2da36/a */a/a (glob) | |
79 | [1] |
|
81 | [1] | |
80 |
|
82 | |||
81 |
|
83 | |||
82 | Test --change option: |
|
84 | Test --change option: | |
83 |
|
85 | |||
84 | $ hg ci -d '2 0' -mtest3 |
|
86 | $ hg ci -d '2 0' -mtest3 | |
85 | $ hg falabala -c 1 |
|
87 | $ hg falabala -c 1 | |
86 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
88 | diffing */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
87 | [1] |
|
89 | [1] | |
88 |
|
90 | |||
89 | Check diff are made from the first parent: |
|
91 | Check diff are made from the first parent: | |
90 |
|
92 | |||
91 | $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" |
|
93 | $ hg falabala -c 3 || echo "diff-like tools yield a non-zero exit code" | |
92 | diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) |
|
94 | diffing */extdiff.*/a.2a13a4d2da36/a a.46c0e4daeb72/a (glob) | |
93 | diff-like tools yield a non-zero exit code |
|
95 | diff-like tools yield a non-zero exit code | |
94 |
|
96 | |||
95 | Test extdiff of multiple files in tmp dir: |
|
97 | Test extdiff of multiple files in tmp dir: | |
96 |
|
98 | |||
97 | $ hg update -C 0 > /dev/null |
|
99 | $ hg update -C 0 > /dev/null | |
98 | $ echo changed > a |
|
100 | $ echo changed > a | |
99 | $ echo changed > b |
|
101 | $ echo changed > b | |
100 | $ chmod +x b |
|
102 | $ chmod +x b | |
101 |
|
103 | |||
102 | Diff in working directory, before: |
|
104 | Diff in working directory, before: | |
103 |
|
105 | |||
104 | $ hg diff --git |
|
106 | $ hg diff --git | |
105 | diff --git a/a b/a |
|
107 | diff --git a/a b/a | |
106 | --- a/a |
|
108 | --- a/a | |
107 | +++ b/a |
|
109 | +++ b/a | |
108 | @@ -1,1 +1,1 @@ |
|
110 | @@ -1,1 +1,1 @@ | |
109 | -a |
|
111 | -a | |
110 | +changed |
|
112 | +changed | |
111 | diff --git a/b b/b |
|
113 | diff --git a/b b/b | |
112 | old mode 100644 |
|
114 | old mode 100644 | |
113 | new mode 100755 |
|
115 | new mode 100755 | |
114 | --- a/b |
|
116 | --- a/b | |
115 | +++ b/b |
|
117 | +++ b/b | |
116 | @@ -1,1 +1,1 @@ |
|
118 | @@ -1,1 +1,1 @@ | |
117 | -b |
|
119 | -b | |
118 | +changed |
|
120 | +changed | |
119 |
|
121 | |||
120 |
|
122 | |||
121 | Edit with extdiff -p: |
|
123 | Edit with extdiff -p: | |
122 |
|
124 | |||
123 | Prepare custom diff/edit tool: |
|
125 | Prepare custom diff/edit tool: | |
124 |
|
126 | |||
125 | $ cat > 'diff tool.py' << EOT |
|
127 | $ cat > 'diff tool.py' << EOT | |
126 | > #!/usr/bin/env python |
|
128 | > #!/usr/bin/env python | |
127 | > import time |
|
129 | > import time | |
128 | > time.sleep(1) # avoid unchanged-timestamp problems |
|
130 | > time.sleep(1) # avoid unchanged-timestamp problems | |
129 | > file('a/a', 'ab').write('edited\n') |
|
131 | > file('a/a', 'ab').write('edited\n') | |
130 | > file('a/b', 'ab').write('edited\n') |
|
132 | > file('a/b', 'ab').write('edited\n') | |
131 | > EOT |
|
133 | > EOT | |
132 |
|
134 | |||
133 | $ chmod +x 'diff tool.py' |
|
135 | $ chmod +x 'diff tool.py' | |
134 |
|
136 | |||
135 | will change to /tmp/extdiff.TMP and populate directories a.TMP and a |
|
137 | will change to /tmp/extdiff.TMP and populate directories a.TMP and a | |
136 | and start tool |
|
138 | and start tool | |
137 |
|
139 | |||
138 | $ hg extdiff -p "`pwd`/diff tool.py" |
|
140 | $ hg extdiff -p "`pwd`/diff tool.py" | |
139 | [1] |
|
141 | [1] | |
140 |
|
142 | |||
141 | Diff in working directory, after: |
|
143 | Diff in working directory, after: | |
142 |
|
144 | |||
143 | $ hg diff --git |
|
145 | $ hg diff --git | |
144 | diff --git a/a b/a |
|
146 | diff --git a/a b/a | |
145 | --- a/a |
|
147 | --- a/a | |
146 | +++ b/a |
|
148 | +++ b/a | |
147 | @@ -1,1 +1,2 @@ |
|
149 | @@ -1,1 +1,2 @@ | |
148 | -a |
|
150 | -a | |
149 | +changed |
|
151 | +changed | |
150 | +edited |
|
152 | +edited | |
151 | diff --git a/b b/b |
|
153 | diff --git a/b b/b | |
152 | old mode 100644 |
|
154 | old mode 100644 | |
153 | new mode 100755 |
|
155 | new mode 100755 | |
154 | --- a/b |
|
156 | --- a/b | |
155 | +++ b/b |
|
157 | +++ b/b | |
156 | @@ -1,1 +1,2 @@ |
|
158 | @@ -1,1 +1,2 @@ | |
157 | -b |
|
159 | -b | |
158 | +changed |
|
160 | +changed | |
159 | +edited |
|
161 | +edited | |
160 |
|
162 | |||
161 | Test extdiff with --option: |
|
163 | Test extdiff with --option: | |
162 |
|
164 | |||
163 | $ hg extdiff -p echo -o this -c 1 |
|
165 | $ hg extdiff -p echo -o this -c 1 | |
164 | this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
166 | this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
165 | [1] |
|
167 | [1] | |
166 |
|
168 | |||
167 | $ hg falabala -o this -c 1 |
|
169 | $ hg falabala -o this -c 1 | |
168 | diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
170 | diffing this */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
169 | [1] |
|
171 | [1] | |
170 |
|
172 | |||
171 | Test with revsets: |
|
173 | Test with revsets: | |
172 |
|
174 | |||
173 | $ hg extdif -p echo -c "rev(1)" |
|
175 | $ hg extdif -p echo -c "rev(1)" | |
174 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
176 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
175 | [1] |
|
177 | [1] | |
176 |
|
178 | |||
177 | $ hg extdif -p echo -r "0::1" |
|
179 | $ hg extdif -p echo -r "0::1" | |
178 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) |
|
180 | */extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob) | |
179 | [1] |
|
181 | [1] | |
180 |
|
182 | |||
181 | $ cd .. |
|
183 | $ cd .. | |
182 |
|
184 | |||
183 | Test symlinks handling (issue1909) |
|
185 | Test symlinks handling (issue1909) | |
184 |
|
186 | |||
185 | $ hg init testsymlinks |
|
187 | $ hg init testsymlinks | |
186 | $ cd testsymlinks |
|
188 | $ cd testsymlinks | |
187 | $ echo a > a |
|
189 | $ echo a > a | |
188 | $ hg ci -Am adda |
|
190 | $ hg ci -Am adda | |
189 | adding a |
|
191 | adding a | |
190 | $ echo a >> a |
|
192 | $ echo a >> a | |
191 | $ ln -s missing linka |
|
193 | $ ln -s missing linka | |
192 | $ hg add linka |
|
194 | $ hg add linka | |
193 | $ hg falabala -r 0 --traceback |
|
195 | $ hg falabala -r 0 --traceback | |
194 | diffing testsymlinks.07f494440405 testsymlinks |
|
196 | diffing testsymlinks.07f494440405 testsymlinks | |
195 | [1] |
|
197 | [1] | |
196 | $ cd .. |
|
198 | $ cd .. |
@@ -1,256 +1,258 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ echo "[extensions]" >> $HGRCPATH |
|
3 | $ echo "[extensions]" >> $HGRCPATH | |
2 | $ echo "purge=" >> $HGRCPATH |
|
4 | $ echo "purge=" >> $HGRCPATH | |
3 | $ echo "graphlog=" >> $HGRCPATH |
|
5 | $ echo "graphlog=" >> $HGRCPATH | |
4 |
|
6 | |||
5 | $ shortlog() { |
|
7 | $ shortlog() { | |
6 | > hg glog --template '{rev}:{node|short} {author} {date|hgdate} - {branch} - {desc|firstline}\n' |
|
8 | > hg glog --template '{rev}:{node|short} {author} {date|hgdate} - {branch} - {desc|firstline}\n' | |
7 | > } |
|
9 | > } | |
8 |
|
10 | |||
9 | Test --bypass with other options |
|
11 | Test --bypass with other options | |
10 |
|
12 | |||
11 | $ hg init repo-options |
|
13 | $ hg init repo-options | |
12 | $ cd repo-options |
|
14 | $ cd repo-options | |
13 | $ echo a > a |
|
15 | $ echo a > a | |
14 | $ hg ci -Am adda |
|
16 | $ hg ci -Am adda | |
15 | adding a |
|
17 | adding a | |
16 | $ echo a >> a |
|
18 | $ echo a >> a | |
17 | $ hg branch foo |
|
19 | $ hg branch foo | |
18 | marked working directory as branch foo |
|
20 | marked working directory as branch foo | |
19 | $ hg ci -Am changea |
|
21 | $ hg ci -Am changea | |
20 | $ hg export . > ../test.diff |
|
22 | $ hg export . > ../test.diff | |
21 | $ hg up null |
|
23 | $ hg up null | |
22 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
24 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
23 |
|
25 | |||
24 | Test importing an existing revision |
|
26 | Test importing an existing revision | |
25 |
|
27 | |||
26 | $ hg import --bypass --exact ../test.diff |
|
28 | $ hg import --bypass --exact ../test.diff | |
27 | applying ../test.diff |
|
29 | applying ../test.diff | |
28 | $ shortlog |
|
30 | $ shortlog | |
29 | o 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
31 | o 1:4e322f7ce8e3 test 0 0 - foo - changea | |
30 | | |
|
32 | | | |
31 | o 0:07f494440405 test 0 0 - default - adda |
|
33 | o 0:07f494440405 test 0 0 - default - adda | |
32 |
|
34 | |||
33 |
|
35 | |||
34 | Test failure without --exact |
|
36 | Test failure without --exact | |
35 |
|
37 | |||
36 | $ hg import --bypass ../test.diff |
|
38 | $ hg import --bypass ../test.diff | |
37 | applying ../test.diff |
|
39 | applying ../test.diff | |
38 | unable to find 'a' for patching |
|
40 | unable to find 'a' for patching | |
39 | abort: patch failed to apply |
|
41 | abort: patch failed to apply | |
40 | [255] |
|
42 | [255] | |
41 | $ hg st |
|
43 | $ hg st | |
42 | $ shortlog |
|
44 | $ shortlog | |
43 | o 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
45 | o 1:4e322f7ce8e3 test 0 0 - foo - changea | |
44 | | |
|
46 | | | |
45 | o 0:07f494440405 test 0 0 - default - adda |
|
47 | o 0:07f494440405 test 0 0 - default - adda | |
46 |
|
48 | |||
47 |
|
49 | |||
48 | Test --user, --date and --message |
|
50 | Test --user, --date and --message | |
49 |
|
51 | |||
50 | $ hg up 0 |
|
52 | $ hg up 0 | |
51 | 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 | |
52 | $ hg import --bypass --u test2 -d '1 0' -m patch2 ../test.diff |
|
54 | $ hg import --bypass --u test2 -d '1 0' -m patch2 ../test.diff | |
53 | applying ../test.diff |
|
55 | applying ../test.diff | |
54 | $ cat .hg/last-message.txt |
|
56 | $ cat .hg/last-message.txt | |
55 | patch2 (no-eol) |
|
57 | patch2 (no-eol) | |
56 | $ shortlog |
|
58 | $ shortlog | |
57 | o 2:2e127d1da504 test2 1 0 - default - patch2 |
|
59 | o 2:2e127d1da504 test2 1 0 - default - patch2 | |
58 | | |
|
60 | | | |
59 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
61 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea | |
60 | |/ |
|
62 | |/ | |
61 | @ 0:07f494440405 test 0 0 - default - adda |
|
63 | @ 0:07f494440405 test 0 0 - default - adda | |
62 |
|
64 | |||
63 | $ hg rollback |
|
65 | $ hg rollback | |
64 | repository tip rolled back to revision 1 (undo import) |
|
66 | repository tip rolled back to revision 1 (undo import) | |
65 |
|
67 | |||
66 | Test --import-branch |
|
68 | Test --import-branch | |
67 |
|
69 | |||
68 | $ hg import --bypass --import-branch ../test.diff |
|
70 | $ hg import --bypass --import-branch ../test.diff | |
69 | applying ../test.diff |
|
71 | applying ../test.diff | |
70 | $ shortlog |
|
72 | $ shortlog | |
71 | o 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
73 | o 1:4e322f7ce8e3 test 0 0 - foo - changea | |
72 | | |
|
74 | | | |
73 | @ 0:07f494440405 test 0 0 - default - adda |
|
75 | @ 0:07f494440405 test 0 0 - default - adda | |
74 |
|
76 | |||
75 | $ hg rollback |
|
77 | $ hg rollback | |
76 | repository tip rolled back to revision 1 (undo import) |
|
78 | repository tip rolled back to revision 1 (undo import) | |
77 |
|
79 | |||
78 | Test --strip |
|
80 | Test --strip | |
79 |
|
81 | |||
80 | $ hg import --bypass --strip 0 - <<EOF |
|
82 | $ hg import --bypass --strip 0 - <<EOF | |
81 | > # HG changeset patch |
|
83 | > # HG changeset patch | |
82 | > # User test |
|
84 | > # User test | |
83 | > # Date 0 0 |
|
85 | > # Date 0 0 | |
84 | > # Branch foo |
|
86 | > # Branch foo | |
85 | > # Node ID 4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c |
|
87 | > # Node ID 4e322f7ce8e3e4203950eac9ece27bf7e45ffa6c | |
86 | > # Parent 07f4944404050f47db2e5c5071e0e84e7a27bba9 |
|
88 | > # Parent 07f4944404050f47db2e5c5071e0e84e7a27bba9 | |
87 | > changea |
|
89 | > changea | |
88 | > |
|
90 | > | |
89 | > diff -r 07f494440405 -r 4e322f7ce8e3 a |
|
91 | > diff -r 07f494440405 -r 4e322f7ce8e3 a | |
90 | > --- a Thu Jan 01 00:00:00 1970 +0000 |
|
92 | > --- a Thu Jan 01 00:00:00 1970 +0000 | |
91 | > +++ a Thu Jan 01 00:00:00 1970 +0000 |
|
93 | > +++ a Thu Jan 01 00:00:00 1970 +0000 | |
92 | > @@ -1,1 +1,2 @@ |
|
94 | > @@ -1,1 +1,2 @@ | |
93 | > a |
|
95 | > a | |
94 | > +a |
|
96 | > +a | |
95 | > EOF |
|
97 | > EOF | |
96 | applying patch from stdin |
|
98 | applying patch from stdin | |
97 | $ hg rollback |
|
99 | $ hg rollback | |
98 | repository tip rolled back to revision 1 (undo import) |
|
100 | repository tip rolled back to revision 1 (undo import) | |
99 |
|
101 | |||
100 | Test unsupported combinations |
|
102 | Test unsupported combinations | |
101 |
|
103 | |||
102 | $ hg import --bypass --no-commit ../test.diff |
|
104 | $ hg import --bypass --no-commit ../test.diff | |
103 | abort: cannot use --no-commit with --bypass |
|
105 | abort: cannot use --no-commit with --bypass | |
104 | [255] |
|
106 | [255] | |
105 | $ hg import --bypass --similarity 50 ../test.diff |
|
107 | $ hg import --bypass --similarity 50 ../test.diff | |
106 | abort: cannot use --similarity with --bypass |
|
108 | abort: cannot use --similarity with --bypass | |
107 | [255] |
|
109 | [255] | |
108 |
|
110 | |||
109 | Test commit editor |
|
111 | Test commit editor | |
110 |
|
112 | |||
111 | $ hg diff -c 1 > ../test.diff |
|
113 | $ hg diff -c 1 > ../test.diff | |
112 | $ HGEDITOR=cat hg import --bypass ../test.diff |
|
114 | $ HGEDITOR=cat hg import --bypass ../test.diff | |
113 | applying ../test.diff |
|
115 | applying ../test.diff | |
114 |
|
116 | |||
115 |
|
117 | |||
116 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
118 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
117 | HG: Leave message empty to abort commit. |
|
119 | HG: Leave message empty to abort commit. | |
118 | HG: -- |
|
120 | HG: -- | |
119 | HG: user: test |
|
121 | HG: user: test | |
120 | HG: branch 'default' |
|
122 | HG: branch 'default' | |
121 | HG: changed a |
|
123 | HG: changed a | |
122 | abort: empty commit message |
|
124 | abort: empty commit message | |
123 | [255] |
|
125 | [255] | |
124 |
|
126 | |||
125 | Test patch.eol is handled |
|
127 | Test patch.eol is handled | |
126 |
|
128 | |||
127 | $ python -c 'file("a", "wb").write("a\r\n")' |
|
129 | $ python -c 'file("a", "wb").write("a\r\n")' | |
128 | $ hg ci -m makeacrlf |
|
130 | $ hg ci -m makeacrlf | |
129 | $ hg import -m 'should fail because of eol' --bypass ../test.diff |
|
131 | $ hg import -m 'should fail because of eol' --bypass ../test.diff | |
130 | applying ../test.diff |
|
132 | applying ../test.diff | |
131 | patching file a |
|
133 | patching file a | |
132 | Hunk #1 FAILED at 0 |
|
134 | Hunk #1 FAILED at 0 | |
133 | abort: patch failed to apply |
|
135 | abort: patch failed to apply | |
134 | [255] |
|
136 | [255] | |
135 | $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff |
|
137 | $ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff | |
136 | applying ../test.diff |
|
138 | applying ../test.diff | |
137 | $ shortlog |
|
139 | $ shortlog | |
138 | o 3:d7805b4d2cb3 test 0 0 - default - test patch.eol |
|
140 | o 3:d7805b4d2cb3 test 0 0 - default - test patch.eol | |
139 | | |
|
141 | | | |
140 | @ 2:872023de769d test 0 0 - default - makeacrlf |
|
142 | @ 2:872023de769d test 0 0 - default - makeacrlf | |
141 | | |
|
143 | | | |
142 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
144 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea | |
143 | |/ |
|
145 | |/ | |
144 | o 0:07f494440405 test 0 0 - default - adda |
|
146 | o 0:07f494440405 test 0 0 - default - adda | |
145 |
|
147 | |||
146 |
|
148 | |||
147 | Test applying multiple patches |
|
149 | Test applying multiple patches | |
148 |
|
150 | |||
149 | $ hg up -qC 0 |
|
151 | $ hg up -qC 0 | |
150 | $ echo e > e |
|
152 | $ echo e > e | |
151 | $ hg ci -Am adde |
|
153 | $ hg ci -Am adde | |
152 | adding e |
|
154 | adding e | |
153 | created new head |
|
155 | created new head | |
154 | $ hg export . > ../patch1.diff |
|
156 | $ hg export . > ../patch1.diff | |
155 | $ hg up -qC 1 |
|
157 | $ hg up -qC 1 | |
156 | $ echo f > f |
|
158 | $ echo f > f | |
157 | $ hg ci -Am addf |
|
159 | $ hg ci -Am addf | |
158 | adding f |
|
160 | adding f | |
159 | $ hg export . > ../patch2.diff |
|
161 | $ hg export . > ../patch2.diff | |
160 | $ cd .. |
|
162 | $ cd .. | |
161 | $ hg clone -r1 repo-options repo-multi1 |
|
163 | $ hg clone -r1 repo-options repo-multi1 | |
162 | adding changesets |
|
164 | adding changesets | |
163 | adding manifests |
|
165 | adding manifests | |
164 | adding file changes |
|
166 | adding file changes | |
165 | added 2 changesets with 2 changes to 1 files |
|
167 | added 2 changesets with 2 changes to 1 files | |
166 | updating to branch foo |
|
168 | updating to branch foo | |
167 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
169 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
168 | $ cd repo-multi1 |
|
170 | $ cd repo-multi1 | |
169 | $ hg up 0 |
|
171 | $ hg up 0 | |
170 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
172 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
171 | $ hg import --bypass ../patch1.diff ../patch2.diff |
|
173 | $ hg import --bypass ../patch1.diff ../patch2.diff | |
172 | applying ../patch1.diff |
|
174 | applying ../patch1.diff | |
173 | applying ../patch2.diff |
|
175 | applying ../patch2.diff | |
174 | $ shortlog |
|
176 | $ shortlog | |
175 | o 3:bc8ca3f8a7c4 test 0 0 - default - addf |
|
177 | o 3:bc8ca3f8a7c4 test 0 0 - default - addf | |
176 | | |
|
178 | | | |
177 | o 2:16581080145e test 0 0 - default - adde |
|
179 | o 2:16581080145e test 0 0 - default - adde | |
178 | | |
|
180 | | | |
179 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
181 | | o 1:4e322f7ce8e3 test 0 0 - foo - changea | |
180 | |/ |
|
182 | |/ | |
181 | @ 0:07f494440405 test 0 0 - default - adda |
|
183 | @ 0:07f494440405 test 0 0 - default - adda | |
182 |
|
184 | |||
183 |
|
185 | |||
184 | Test applying multiple patches with --exact |
|
186 | Test applying multiple patches with --exact | |
185 |
|
187 | |||
186 | $ cd .. |
|
188 | $ cd .. | |
187 | $ hg clone -r1 repo-options repo-multi2 |
|
189 | $ hg clone -r1 repo-options repo-multi2 | |
188 | adding changesets |
|
190 | adding changesets | |
189 | adding manifests |
|
191 | adding manifests | |
190 | adding file changes |
|
192 | adding file changes | |
191 | added 2 changesets with 2 changes to 1 files |
|
193 | added 2 changesets with 2 changes to 1 files | |
192 | updating to branch foo |
|
194 | updating to branch foo | |
193 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
195 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
194 | $ cd repo-multi2 |
|
196 | $ cd repo-multi2 | |
195 | $ hg import --bypass --exact ../patch1.diff ../patch2.diff |
|
197 | $ hg import --bypass --exact ../patch1.diff ../patch2.diff | |
196 | applying ../patch1.diff |
|
198 | applying ../patch1.diff | |
197 | applying ../patch2.diff |
|
199 | applying ../patch2.diff | |
198 | $ shortlog |
|
200 | $ shortlog | |
199 | o 3:d60cb8989666 test 0 0 - foo - addf |
|
201 | o 3:d60cb8989666 test 0 0 - foo - addf | |
200 | | |
|
202 | | | |
201 | | o 2:16581080145e test 0 0 - default - adde |
|
203 | | o 2:16581080145e test 0 0 - default - adde | |
202 | | | |
|
204 | | | | |
203 | @ | 1:4e322f7ce8e3 test 0 0 - foo - changea |
|
205 | @ | 1:4e322f7ce8e3 test 0 0 - foo - changea | |
204 | |/ |
|
206 | |/ | |
205 | o 0:07f494440405 test 0 0 - default - adda |
|
207 | o 0:07f494440405 test 0 0 - default - adda | |
206 |
|
208 | |||
207 |
|
209 | |||
208 | $ cd .. |
|
210 | $ cd .. | |
209 |
|
211 | |||
210 | Test complicated patch with --exact |
|
212 | Test complicated patch with --exact | |
211 |
|
213 | |||
212 | $ hg init repo-exact |
|
214 | $ hg init repo-exact | |
213 | $ cd repo-exact |
|
215 | $ cd repo-exact | |
214 | $ echo a > a |
|
216 | $ echo a > a | |
215 | $ echo c > c |
|
217 | $ echo c > c | |
216 | $ echo d > d |
|
218 | $ echo d > d | |
217 | $ echo e > e |
|
219 | $ echo e > e | |
218 | $ echo f > f |
|
220 | $ echo f > f | |
219 | $ chmod +x f |
|
221 | $ chmod +x f | |
220 | $ ln -s c linkc |
|
222 | $ ln -s c linkc | |
221 | $ hg ci -Am t |
|
223 | $ hg ci -Am t | |
222 | adding a |
|
224 | adding a | |
223 | adding c |
|
225 | adding c | |
224 | adding d |
|
226 | adding d | |
225 | adding e |
|
227 | adding e | |
226 | adding f |
|
228 | adding f | |
227 | adding linkc |
|
229 | adding linkc | |
228 | $ hg cp a aa1 |
|
230 | $ hg cp a aa1 | |
229 | $ echo b >> a |
|
231 | $ echo b >> a | |
230 | $ echo b > b |
|
232 | $ echo b > b | |
231 | $ hg add b |
|
233 | $ hg add b | |
232 | $ hg cp a aa2 |
|
234 | $ hg cp a aa2 | |
233 | $ echo aa >> aa2 |
|
235 | $ echo aa >> aa2 | |
234 | $ chmod +x e |
|
236 | $ chmod +x e | |
235 | $ chmod -x f |
|
237 | $ chmod -x f | |
236 | $ ln -s a linka |
|
238 | $ ln -s a linka | |
237 | $ hg rm d |
|
239 | $ hg rm d | |
238 | $ hg rm linkc |
|
240 | $ hg rm linkc | |
239 | $ hg mv c cc |
|
241 | $ hg mv c cc | |
240 | $ hg ci -m patch |
|
242 | $ hg ci -m patch | |
241 | $ hg export --git . > ../test.diff |
|
243 | $ hg export --git . > ../test.diff | |
242 | $ hg up -C null |
|
244 | $ hg up -C null | |
243 | 0 files updated, 0 files merged, 7 files removed, 0 files unresolved |
|
245 | 0 files updated, 0 files merged, 7 files removed, 0 files unresolved | |
244 | $ hg purge |
|
246 | $ hg purge | |
245 | $ hg st |
|
247 | $ hg st | |
246 | $ hg import --bypass --exact ../test.diff |
|
248 | $ hg import --bypass --exact ../test.diff | |
247 | applying ../test.diff |
|
249 | applying ../test.diff | |
248 |
|
250 | |||
249 | The patch should have matched the exported revision and generated no additional |
|
251 | The patch should have matched the exported revision and generated no additional | |
250 | data. If not, diff both heads to debug it. |
|
252 | data. If not, diff both heads to debug it. | |
251 |
|
253 | |||
252 | $ shortlog |
|
254 | $ shortlog | |
253 | o 1:2978fd5c8aa4 test 0 0 - default - patch |
|
255 | o 1:2978fd5c8aa4 test 0 0 - default - patch | |
254 | | |
|
256 | | | |
255 | o 0:a0e19e636a43 test 0 0 - default - t |
|
257 | o 0:a0e19e636a43 test 0 0 - default - t | |
256 |
|
258 |
@@ -1,468 +1,469 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
1 |
|
2 | |||
2 | $ hg init |
|
3 | $ hg init | |
3 |
|
4 | |||
4 | New file: |
|
5 | New file: | |
5 |
|
6 | |||
6 | $ hg import -d "1000000 0" -mnew - <<EOF |
|
7 | $ hg import -d "1000000 0" -mnew - <<EOF | |
7 | > diff --git a/new b/new |
|
8 | > diff --git a/new b/new | |
8 | > new file mode 100644 |
|
9 | > new file mode 100644 | |
9 | > index 0000000..7898192 |
|
10 | > index 0000000..7898192 | |
10 | > --- /dev/null |
|
11 | > --- /dev/null | |
11 | > +++ b/new |
|
12 | > +++ b/new | |
12 | > @@ -0,0 +1 @@ |
|
13 | > @@ -0,0 +1 @@ | |
13 | > +a |
|
14 | > +a | |
14 | > EOF |
|
15 | > EOF | |
15 | applying patch from stdin |
|
16 | applying patch from stdin | |
16 |
|
17 | |||
17 | $ hg tip -q |
|
18 | $ hg tip -q | |
18 | 0:ae3ee40d2079 |
|
19 | 0:ae3ee40d2079 | |
19 |
|
20 | |||
20 | New empty file: |
|
21 | New empty file: | |
21 |
|
22 | |||
22 | $ hg import -d "1000000 0" -mempty - <<EOF |
|
23 | $ hg import -d "1000000 0" -mempty - <<EOF | |
23 | > diff --git a/empty b/empty |
|
24 | > diff --git a/empty b/empty | |
24 | > new file mode 100644 |
|
25 | > new file mode 100644 | |
25 | > EOF |
|
26 | > EOF | |
26 | applying patch from stdin |
|
27 | applying patch from stdin | |
27 |
|
28 | |||
28 | $ hg tip -q |
|
29 | $ hg tip -q | |
29 | 1:ab199dc869b5 |
|
30 | 1:ab199dc869b5 | |
30 |
|
31 | |||
31 | $ hg locate empty |
|
32 | $ hg locate empty | |
32 | empty |
|
33 | empty | |
33 |
|
34 | |||
34 | chmod +x: |
|
35 | chmod +x: | |
35 |
|
36 | |||
36 | $ hg import -d "1000000 0" -msetx - <<EOF |
|
37 | $ hg import -d "1000000 0" -msetx - <<EOF | |
37 | > diff --git a/new b/new |
|
38 | > diff --git a/new b/new | |
38 | > old mode 100644 |
|
39 | > old mode 100644 | |
39 | > new mode 100755 |
|
40 | > new mode 100755 | |
40 | > EOF |
|
41 | > EOF | |
41 | applying patch from stdin |
|
42 | applying patch from stdin | |
42 |
|
43 | |||
43 | $ hg tip -q |
|
44 | $ hg tip -q | |
44 | 2:3a34410f282e |
|
45 | 2:3a34410f282e | |
45 |
|
46 | |||
46 | $ test -x new |
|
47 | $ test -x new | |
47 |
|
48 | |||
48 | Copy: |
|
49 | Copy: | |
49 |
|
50 | |||
50 | $ hg import -d "1000000 0" -mcopy - <<EOF |
|
51 | $ hg import -d "1000000 0" -mcopy - <<EOF | |
51 | > diff --git a/new b/copy |
|
52 | > diff --git a/new b/copy | |
52 | > old mode 100755 |
|
53 | > old mode 100755 | |
53 | > new mode 100644 |
|
54 | > new mode 100644 | |
54 | > similarity index 100% |
|
55 | > similarity index 100% | |
55 | > copy from new |
|
56 | > copy from new | |
56 | > copy to copy |
|
57 | > copy to copy | |
57 | > diff --git a/new b/copyx |
|
58 | > diff --git a/new b/copyx | |
58 | > similarity index 100% |
|
59 | > similarity index 100% | |
59 | > copy from new |
|
60 | > copy from new | |
60 | > copy to copyx |
|
61 | > copy to copyx | |
61 | > EOF |
|
62 | > EOF | |
62 | applying patch from stdin |
|
63 | applying patch from stdin | |
63 |
|
64 | |||
64 | $ hg tip -q |
|
65 | $ hg tip -q | |
65 | 3:37bacb7ca14d |
|
66 | 3:37bacb7ca14d | |
66 |
|
67 | |||
67 | $ if "$TESTDIR/hghave" -q execbit; then |
|
68 | $ if "$TESTDIR/hghave" -q execbit; then | |
68 | > test -f copy -a ! -x copy || echo bad |
|
69 | > test -f copy -a ! -x copy || echo bad | |
69 | > test -x copyx || echo bad |
|
70 | > test -x copyx || echo bad | |
70 | > else |
|
71 | > else | |
71 | > test -f copy || echo bad |
|
72 | > test -f copy || echo bad | |
72 | > fi |
|
73 | > fi | |
73 |
|
74 | |||
74 | $ cat copy |
|
75 | $ cat copy | |
75 | a |
|
76 | a | |
76 |
|
77 | |||
77 | $ hg cat copy |
|
78 | $ hg cat copy | |
78 | a |
|
79 | a | |
79 |
|
80 | |||
80 | Rename: |
|
81 | Rename: | |
81 |
|
82 | |||
82 | $ hg import -d "1000000 0" -mrename - <<EOF |
|
83 | $ hg import -d "1000000 0" -mrename - <<EOF | |
83 | > diff --git a/copy b/rename |
|
84 | > diff --git a/copy b/rename | |
84 | > similarity index 100% |
|
85 | > similarity index 100% | |
85 | > rename from copy |
|
86 | > rename from copy | |
86 | > rename to rename |
|
87 | > rename to rename | |
87 | > EOF |
|
88 | > EOF | |
88 | applying patch from stdin |
|
89 | applying patch from stdin | |
89 |
|
90 | |||
90 | $ hg tip -q |
|
91 | $ hg tip -q | |
91 | 4:47b81a94361d |
|
92 | 4:47b81a94361d | |
92 |
|
93 | |||
93 | $ hg locate |
|
94 | $ hg locate | |
94 | copyx |
|
95 | copyx | |
95 | empty |
|
96 | empty | |
96 | new |
|
97 | new | |
97 | rename |
|
98 | rename | |
98 |
|
99 | |||
99 | Delete: |
|
100 | Delete: | |
100 |
|
101 | |||
101 | $ hg import -d "1000000 0" -mdelete - <<EOF |
|
102 | $ hg import -d "1000000 0" -mdelete - <<EOF | |
102 | > diff --git a/copyx b/copyx |
|
103 | > diff --git a/copyx b/copyx | |
103 | > deleted file mode 100755 |
|
104 | > deleted file mode 100755 | |
104 | > index 7898192..0000000 |
|
105 | > index 7898192..0000000 | |
105 | > --- a/copyx |
|
106 | > --- a/copyx | |
106 | > +++ /dev/null |
|
107 | > +++ /dev/null | |
107 | > @@ -1 +0,0 @@ |
|
108 | > @@ -1 +0,0 @@ | |
108 | > -a |
|
109 | > -a | |
109 | > EOF |
|
110 | > EOF | |
110 | applying patch from stdin |
|
111 | applying patch from stdin | |
111 |
|
112 | |||
112 | $ hg tip -q |
|
113 | $ hg tip -q | |
113 | 5:d9b001d98336 |
|
114 | 5:d9b001d98336 | |
114 |
|
115 | |||
115 | $ hg locate |
|
116 | $ hg locate | |
116 | empty |
|
117 | empty | |
117 | new |
|
118 | new | |
118 | rename |
|
119 | rename | |
119 |
|
120 | |||
120 | $ test -f copyx |
|
121 | $ test -f copyx | |
121 | [1] |
|
122 | [1] | |
122 |
|
123 | |||
123 | Regular diff: |
|
124 | Regular diff: | |
124 |
|
125 | |||
125 | $ hg import -d "1000000 0" -mregular - <<EOF |
|
126 | $ hg import -d "1000000 0" -mregular - <<EOF | |
126 | > diff --git a/rename b/rename |
|
127 | > diff --git a/rename b/rename | |
127 | > index 7898192..72e1fe3 100644 |
|
128 | > index 7898192..72e1fe3 100644 | |
128 | > --- a/rename |
|
129 | > --- a/rename | |
129 | > +++ b/rename |
|
130 | > +++ b/rename | |
130 | > @@ -1 +1,5 @@ |
|
131 | > @@ -1 +1,5 @@ | |
131 | > a |
|
132 | > a | |
132 | > +a |
|
133 | > +a | |
133 | > +a |
|
134 | > +a | |
134 | > +a |
|
135 | > +a | |
135 | > +a |
|
136 | > +a | |
136 | > EOF |
|
137 | > EOF | |
137 | applying patch from stdin |
|
138 | applying patch from stdin | |
138 |
|
139 | |||
139 | $ hg tip -q |
|
140 | $ hg tip -q | |
140 | 6:ebe901e7576b |
|
141 | 6:ebe901e7576b | |
141 |
|
142 | |||
142 | Copy and modify: |
|
143 | Copy and modify: | |
143 |
|
144 | |||
144 | $ hg import -d "1000000 0" -mcopymod - <<EOF |
|
145 | $ hg import -d "1000000 0" -mcopymod - <<EOF | |
145 | > diff --git a/rename b/copy2 |
|
146 | > diff --git a/rename b/copy2 | |
146 | > similarity index 80% |
|
147 | > similarity index 80% | |
147 | > copy from rename |
|
148 | > copy from rename | |
148 | > copy to copy2 |
|
149 | > copy to copy2 | |
149 | > index 72e1fe3..b53c148 100644 |
|
150 | > index 72e1fe3..b53c148 100644 | |
150 | > --- a/rename |
|
151 | > --- a/rename | |
151 | > +++ b/copy2 |
|
152 | > +++ b/copy2 | |
152 | > @@ -1,5 +1,5 @@ |
|
153 | > @@ -1,5 +1,5 @@ | |
153 | > a |
|
154 | > a | |
154 | > a |
|
155 | > a | |
155 | > -a |
|
156 | > -a | |
156 | > +b |
|
157 | > +b | |
157 | > a |
|
158 | > a | |
158 | > a |
|
159 | > a | |
159 | > EOF |
|
160 | > EOF | |
160 | applying patch from stdin |
|
161 | applying patch from stdin | |
161 |
|
162 | |||
162 | $ hg tip -q |
|
163 | $ hg tip -q | |
163 | 7:18f368958ecd |
|
164 | 7:18f368958ecd | |
164 |
|
165 | |||
165 | $ hg cat copy2 |
|
166 | $ hg cat copy2 | |
166 | a |
|
167 | a | |
167 | a |
|
168 | a | |
168 | b |
|
169 | b | |
169 | a |
|
170 | a | |
170 | a |
|
171 | a | |
171 |
|
172 | |||
172 | Rename and modify: |
|
173 | Rename and modify: | |
173 |
|
174 | |||
174 | $ hg import -d "1000000 0" -mrenamemod - <<EOF |
|
175 | $ hg import -d "1000000 0" -mrenamemod - <<EOF | |
175 | > diff --git a/copy2 b/rename2 |
|
176 | > diff --git a/copy2 b/rename2 | |
176 | > similarity index 80% |
|
177 | > similarity index 80% | |
177 | > rename from copy2 |
|
178 | > rename from copy2 | |
178 | > rename to rename2 |
|
179 | > rename to rename2 | |
179 | > index b53c148..8f81e29 100644 |
|
180 | > index b53c148..8f81e29 100644 | |
180 | > --- a/copy2 |
|
181 | > --- a/copy2 | |
181 | > +++ b/rename2 |
|
182 | > +++ b/rename2 | |
182 | > @@ -1,5 +1,5 @@ |
|
183 | > @@ -1,5 +1,5 @@ | |
183 | > a |
|
184 | > a | |
184 | > a |
|
185 | > a | |
185 | > b |
|
186 | > b | |
186 | > -a |
|
187 | > -a | |
187 | > +c |
|
188 | > +c | |
188 | > a |
|
189 | > a | |
189 | > EOF |
|
190 | > EOF | |
190 | applying patch from stdin |
|
191 | applying patch from stdin | |
191 |
|
192 | |||
192 | $ hg tip -q |
|
193 | $ hg tip -q | |
193 | 8:c32b0d7e6f44 |
|
194 | 8:c32b0d7e6f44 | |
194 |
|
195 | |||
195 | $ hg locate copy2 |
|
196 | $ hg locate copy2 | |
196 | [1] |
|
197 | [1] | |
197 | $ hg cat rename2 |
|
198 | $ hg cat rename2 | |
198 | a |
|
199 | a | |
199 | a |
|
200 | a | |
200 | b |
|
201 | b | |
201 | c |
|
202 | c | |
202 | a |
|
203 | a | |
203 |
|
204 | |||
204 | One file renamed multiple times: |
|
205 | One file renamed multiple times: | |
205 |
|
206 | |||
206 | $ hg import -d "1000000 0" -mmultirenames - <<EOF |
|
207 | $ hg import -d "1000000 0" -mmultirenames - <<EOF | |
207 | > diff --git a/rename2 b/rename3 |
|
208 | > diff --git a/rename2 b/rename3 | |
208 | > rename from rename2 |
|
209 | > rename from rename2 | |
209 | > rename to rename3 |
|
210 | > rename to rename3 | |
210 | > diff --git a/rename2 b/rename3-2 |
|
211 | > diff --git a/rename2 b/rename3-2 | |
211 | > rename from rename2 |
|
212 | > rename from rename2 | |
212 | > rename to rename3-2 |
|
213 | > rename to rename3-2 | |
213 | > EOF |
|
214 | > EOF | |
214 | applying patch from stdin |
|
215 | applying patch from stdin | |
215 |
|
216 | |||
216 | $ hg tip -q |
|
217 | $ hg tip -q | |
217 | 9:034a6bf95330 |
|
218 | 9:034a6bf95330 | |
218 |
|
219 | |||
219 | $ hg log -vr. --template '{rev} {files} / {file_copies}\n' |
|
220 | $ hg log -vr. --template '{rev} {files} / {file_copies}\n' | |
220 | 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2) |
|
221 | 9 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2) | |
221 |
|
222 | |||
222 | $ hg locate rename2 rename3 rename3-2 |
|
223 | $ hg locate rename2 rename3 rename3-2 | |
223 | rename3 |
|
224 | rename3 | |
224 | rename3-2 |
|
225 | rename3-2 | |
225 |
|
226 | |||
226 | $ hg cat rename3 |
|
227 | $ hg cat rename3 | |
227 | a |
|
228 | a | |
228 | a |
|
229 | a | |
229 | b |
|
230 | b | |
230 | c |
|
231 | c | |
231 | a |
|
232 | a | |
232 |
|
233 | |||
233 | $ hg cat rename3-2 |
|
234 | $ hg cat rename3-2 | |
234 | a |
|
235 | a | |
235 | a |
|
236 | a | |
236 | b |
|
237 | b | |
237 | c |
|
238 | c | |
238 | a |
|
239 | a | |
239 |
|
240 | |||
240 | $ echo foo > foo |
|
241 | $ echo foo > foo | |
241 | $ hg add foo |
|
242 | $ hg add foo | |
242 | $ hg ci -m 'add foo' |
|
243 | $ hg ci -m 'add foo' | |
243 |
|
244 | |||
244 | Binary files and regular patch hunks: |
|
245 | Binary files and regular patch hunks: | |
245 |
|
246 | |||
246 | $ hg import -d "1000000 0" -m binaryregular - <<EOF |
|
247 | $ hg import -d "1000000 0" -m binaryregular - <<EOF | |
247 | > diff --git a/binary b/binary |
|
248 | > diff --git a/binary b/binary | |
248 | > new file mode 100644 |
|
249 | > new file mode 100644 | |
249 | > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 |
|
250 | > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 | |
250 | > GIT binary patch |
|
251 | > GIT binary patch | |
251 | > literal 4 |
|
252 | > literal 4 | |
252 | > Lc\${NkU|;|M00aO5 |
|
253 | > Lc\${NkU|;|M00aO5 | |
253 | > |
|
254 | > | |
254 | > diff --git a/foo b/foo2 |
|
255 | > diff --git a/foo b/foo2 | |
255 | > rename from foo |
|
256 | > rename from foo | |
256 | > rename to foo2 |
|
257 | > rename to foo2 | |
257 | > EOF |
|
258 | > EOF | |
258 | applying patch from stdin |
|
259 | applying patch from stdin | |
259 |
|
260 | |||
260 | $ hg tip -q |
|
261 | $ hg tip -q | |
261 | 11:c39bce63e786 |
|
262 | 11:c39bce63e786 | |
262 |
|
263 | |||
263 | $ cat foo2 |
|
264 | $ cat foo2 | |
264 | foo |
|
265 | foo | |
265 |
|
266 | |||
266 | $ hg manifest --debug | grep binary |
|
267 | $ hg manifest --debug | grep binary | |
267 | 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary |
|
268 | 045c85ba38952325e126c70962cc0f9d9077bc67 644 binary | |
268 |
|
269 | |||
269 | Multiple binary files: |
|
270 | Multiple binary files: | |
270 |
|
271 | |||
271 | $ hg import -d "1000000 0" -m multibinary - <<EOF |
|
272 | $ hg import -d "1000000 0" -m multibinary - <<EOF | |
272 | > diff --git a/mbinary1 b/mbinary1 |
|
273 | > diff --git a/mbinary1 b/mbinary1 | |
273 | > new file mode 100644 |
|
274 | > new file mode 100644 | |
274 | > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 |
|
275 | > index 0000000000000000000000000000000000000000..593f4708db84ac8fd0f5cc47c634f38c013fe9e4 | |
275 | > GIT binary patch |
|
276 | > GIT binary patch | |
276 | > literal 4 |
|
277 | > literal 4 | |
277 | > Lc\${NkU|;|M00aO5 |
|
278 | > Lc\${NkU|;|M00aO5 | |
278 | > |
|
279 | > | |
279 | > diff --git a/mbinary2 b/mbinary2 |
|
280 | > diff --git a/mbinary2 b/mbinary2 | |
280 | > new file mode 100644 |
|
281 | > new file mode 100644 | |
281 | > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490 |
|
282 | > index 0000000000000000000000000000000000000000..112363ac1917b417ffbd7f376ca786a1e5fa7490 | |
282 | > GIT binary patch |
|
283 | > GIT binary patch | |
283 | > literal 5 |
|
284 | > literal 5 | |
284 | > Mc\${NkU|\`?^000jF3jhEB |
|
285 | > Mc\${NkU|\`?^000jF3jhEB | |
285 | > |
|
286 | > | |
286 | > EOF |
|
287 | > EOF | |
287 | applying patch from stdin |
|
288 | applying patch from stdin | |
288 |
|
289 | |||
289 | $ hg tip -q |
|
290 | $ hg tip -q | |
290 | 12:30b530085242 |
|
291 | 12:30b530085242 | |
291 |
|
292 | |||
292 | $ hg manifest --debug | grep mbinary |
|
293 | $ hg manifest --debug | grep mbinary | |
293 | 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1 |
|
294 | 045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1 | |
294 | a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2 |
|
295 | a874b471193996e7cb034bb301cac7bdaf3e3f46 644 mbinary2 | |
295 |
|
296 | |||
296 | Filenames with spaces: |
|
297 | Filenames with spaces: | |
297 |
|
298 | |||
298 | $ hg import -d "1000000 0" -m spaces - <<EOF |
|
299 | $ hg import -d "1000000 0" -m spaces - <<EOF | |
299 | > diff --git a/foo bar b/foo bar |
|
300 | > diff --git a/foo bar b/foo bar | |
300 | > new file mode 100644 |
|
301 | > new file mode 100644 | |
301 | > index 0000000..257cc56 |
|
302 | > index 0000000..257cc56 | |
302 | > --- /dev/null |
|
303 | > --- /dev/null | |
303 | > +++ b/foo bar |
|
304 | > +++ b/foo bar | |
304 | > @@ -0,0 +1 @@ |
|
305 | > @@ -0,0 +1 @@ | |
305 | > +foo |
|
306 | > +foo | |
306 | > EOF |
|
307 | > EOF | |
307 | applying patch from stdin |
|
308 | applying patch from stdin | |
308 |
|
309 | |||
309 | $ hg tip -q |
|
310 | $ hg tip -q | |
310 | 13:04750ef42fb3 |
|
311 | 13:04750ef42fb3 | |
311 |
|
312 | |||
312 | $ cat "foo bar" |
|
313 | $ cat "foo bar" | |
313 | foo |
|
314 | foo | |
314 |
|
315 | |||
315 | Copy then modify the original file: |
|
316 | Copy then modify the original file: | |
316 |
|
317 | |||
317 | $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF |
|
318 | $ hg import -d "1000000 0" -m copy-mod-orig - <<EOF | |
318 | > diff --git a/foo2 b/foo2 |
|
319 | > diff --git a/foo2 b/foo2 | |
319 | > index 257cc56..fe08ec6 100644 |
|
320 | > index 257cc56..fe08ec6 100644 | |
320 | > --- a/foo2 |
|
321 | > --- a/foo2 | |
321 | > +++ b/foo2 |
|
322 | > +++ b/foo2 | |
322 | > @@ -1 +1,2 @@ |
|
323 | > @@ -1 +1,2 @@ | |
323 | > foo |
|
324 | > foo | |
324 | > +new line |
|
325 | > +new line | |
325 | > diff --git a/foo2 b/foo3 |
|
326 | > diff --git a/foo2 b/foo3 | |
326 | > similarity index 100% |
|
327 | > similarity index 100% | |
327 | > copy from foo2 |
|
328 | > copy from foo2 | |
328 | > copy to foo3 |
|
329 | > copy to foo3 | |
329 | > EOF |
|
330 | > EOF | |
330 | applying patch from stdin |
|
331 | applying patch from stdin | |
331 |
|
332 | |||
332 | $ hg tip -q |
|
333 | $ hg tip -q | |
333 | 14:c4cd9cdeaa74 |
|
334 | 14:c4cd9cdeaa74 | |
334 |
|
335 | |||
335 | $ cat foo3 |
|
336 | $ cat foo3 | |
336 | foo |
|
337 | foo | |
337 |
|
338 | |||
338 | Move text file and patch as binary |
|
339 | Move text file and patch as binary | |
339 |
|
340 | |||
340 | $ echo a > text2 |
|
341 | $ echo a > text2 | |
341 | $ hg ci -Am0 |
|
342 | $ hg ci -Am0 | |
342 | adding text2 |
|
343 | adding text2 | |
343 | $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF" |
|
344 | $ hg import -d "1000000 0" -m rename-as-binary - <<"EOF" | |
344 | > diff --git a/text2 b/binary2 |
|
345 | > diff --git a/text2 b/binary2 | |
345 | > rename from text2 |
|
346 | > rename from text2 | |
346 | > rename to binary2 |
|
347 | > rename to binary2 | |
347 | > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 |
|
348 | > index 78981922613b2afb6025042ff6bd878ac1994e85..10efcb362e9f3b3420fcfbfc0e37f3dc16e29757 | |
348 | > GIT binary patch |
|
349 | > GIT binary patch | |
349 | > literal 5 |
|
350 | > literal 5 | |
350 | > Mc$`b*O5$Pw00T?_*Z=?k |
|
351 | > Mc$`b*O5$Pw00T?_*Z=?k | |
351 | > |
|
352 | > | |
352 | > EOF |
|
353 | > EOF | |
353 | applying patch from stdin |
|
354 | applying patch from stdin | |
354 |
|
355 | |||
355 | $ cat binary2 |
|
356 | $ cat binary2 | |
356 | a |
|
357 | a | |
357 | b |
|
358 | b | |
358 | \x00 (no-eol) (esc) |
|
359 | \x00 (no-eol) (esc) | |
359 |
|
360 | |||
360 | $ hg st --copies --change . |
|
361 | $ hg st --copies --change . | |
361 | A binary2 |
|
362 | A binary2 | |
362 | text2 |
|
363 | text2 | |
363 | R text2 |
|
364 | R text2 | |
364 | $ cd .. |
|
365 | $ cd .. | |
365 |
|
366 | |||
366 | Consecutive import with renames (issue2459) |
|
367 | Consecutive import with renames (issue2459) | |
367 |
|
368 | |||
368 | $ hg init issue2459 |
|
369 | $ hg init issue2459 | |
369 | $ cd issue2459 |
|
370 | $ cd issue2459 | |
370 | $ hg import --no-commit --force - <<EOF |
|
371 | $ hg import --no-commit --force - <<EOF | |
371 | > diff --git a/a b/a |
|
372 | > diff --git a/a b/a | |
372 | > new file mode 100644 |
|
373 | > new file mode 100644 | |
373 | > EOF |
|
374 | > EOF | |
374 | applying patch from stdin |
|
375 | applying patch from stdin | |
375 | $ hg import --no-commit --force - <<EOF |
|
376 | $ hg import --no-commit --force - <<EOF | |
376 | > diff --git a/a b/b |
|
377 | > diff --git a/a b/b | |
377 | > rename from a |
|
378 | > rename from a | |
378 | > rename to b |
|
379 | > rename to b | |
379 | > EOF |
|
380 | > EOF | |
380 | applying patch from stdin |
|
381 | applying patch from stdin | |
381 | a has not been committed yet, so no copy data will be stored for b. |
|
382 | a has not been committed yet, so no copy data will be stored for b. | |
382 | $ hg debugstate |
|
383 | $ hg debugstate | |
383 | a 0 -1 unset b |
|
384 | a 0 -1 unset b | |
384 | $ hg ci -m done |
|
385 | $ hg ci -m done | |
385 | $ cd .. |
|
386 | $ cd .. | |
386 |
|
387 | |||
387 | Renames and strip |
|
388 | Renames and strip | |
388 |
|
389 | |||
389 | $ hg init renameandstrip |
|
390 | $ hg init renameandstrip | |
390 | $ cd renameandstrip |
|
391 | $ cd renameandstrip | |
391 | $ echo a > a |
|
392 | $ echo a > a | |
392 | $ hg ci -Am adda |
|
393 | $ hg ci -Am adda | |
393 | adding a |
|
394 | adding a | |
394 | $ hg import --no-commit -p2 - <<EOF |
|
395 | $ hg import --no-commit -p2 - <<EOF | |
395 | > diff --git a/foo/a b/foo/b |
|
396 | > diff --git a/foo/a b/foo/b | |
396 | > rename from foo/a |
|
397 | > rename from foo/a | |
397 | > rename to foo/b |
|
398 | > rename to foo/b | |
398 | > EOF |
|
399 | > EOF | |
399 | applying patch from stdin |
|
400 | applying patch from stdin | |
400 | $ hg st --copies |
|
401 | $ hg st --copies | |
401 | A b |
|
402 | A b | |
402 | a |
|
403 | a | |
403 | R a |
|
404 | R a | |
404 | $ cd .. |
|
405 | $ cd .. | |
405 |
|
406 | |||
406 | Pure copy with existing destination |
|
407 | Pure copy with existing destination | |
407 |
|
408 | |||
408 | $ hg init copytoexisting |
|
409 | $ hg init copytoexisting | |
409 | $ cd copytoexisting |
|
410 | $ cd copytoexisting | |
410 | $ echo a > a |
|
411 | $ echo a > a | |
411 | $ echo b > b |
|
412 | $ echo b > b | |
412 | $ hg ci -Am add |
|
413 | $ hg ci -Am add | |
413 | adding a |
|
414 | adding a | |
414 | adding b |
|
415 | adding b | |
415 | $ hg import --no-commit - <<EOF |
|
416 | $ hg import --no-commit - <<EOF | |
416 | > diff --git a/a b/b |
|
417 | > diff --git a/a b/b | |
417 | > copy from a |
|
418 | > copy from a | |
418 | > copy to b |
|
419 | > copy to b | |
419 | > EOF |
|
420 | > EOF | |
420 | applying patch from stdin |
|
421 | applying patch from stdin | |
421 | abort: cannot create b: destination already exists |
|
422 | abort: cannot create b: destination already exists | |
422 | [255] |
|
423 | [255] | |
423 | $ cat b |
|
424 | $ cat b | |
424 | b |
|
425 | b | |
425 |
|
426 | |||
426 | Copy and changes with existing destination |
|
427 | Copy and changes with existing destination | |
427 |
|
428 | |||
428 | $ hg import --no-commit - <<EOF |
|
429 | $ hg import --no-commit - <<EOF | |
429 | > diff --git a/a b/b |
|
430 | > diff --git a/a b/b | |
430 | > copy from a |
|
431 | > copy from a | |
431 | > copy to b |
|
432 | > copy to b | |
432 | > --- a/a |
|
433 | > --- a/a | |
433 | > +++ b/b |
|
434 | > +++ b/b | |
434 | > @@ -1,1 +1,2 @@ |
|
435 | > @@ -1,1 +1,2 @@ | |
435 | > a |
|
436 | > a | |
436 | > +b |
|
437 | > +b | |
437 | > EOF |
|
438 | > EOF | |
438 | applying patch from stdin |
|
439 | applying patch from stdin | |
439 | cannot create b: destination already exists |
|
440 | cannot create b: destination already exists | |
440 | 1 out of 1 hunks FAILED -- saving rejects to file b.rej |
|
441 | 1 out of 1 hunks FAILED -- saving rejects to file b.rej | |
441 | abort: patch failed to apply |
|
442 | abort: patch failed to apply | |
442 | [255] |
|
443 | [255] | |
443 | $ cat b |
|
444 | $ cat b | |
444 | b |
|
445 | b | |
445 |
|
446 | |||
446 | $ ln -s b linkb |
|
447 | $ ln -s b linkb | |
447 | $ hg add linkb |
|
448 | $ hg add linkb | |
448 | $ hg ci -m addlinkb |
|
449 | $ hg ci -m addlinkb | |
449 | $ hg import --no-commit - <<EOF |
|
450 | $ hg import --no-commit - <<EOF | |
450 | > diff --git a/linkb b/linkb |
|
451 | > diff --git a/linkb b/linkb | |
451 | > deleted file mode 120000 |
|
452 | > deleted file mode 120000 | |
452 | > --- a/linkb |
|
453 | > --- a/linkb | |
453 | > +++ /dev/null |
|
454 | > +++ /dev/null | |
454 | > @@ -1,1 +0,0 @@ |
|
455 | > @@ -1,1 +0,0 @@ | |
455 | > -badhunk |
|
456 | > -badhunk | |
456 | > \ No newline at end of file |
|
457 | > \ No newline at end of file | |
457 | > EOF |
|
458 | > EOF | |
458 | applying patch from stdin |
|
459 | applying patch from stdin | |
459 | patching file linkb |
|
460 | patching file linkb | |
460 | Hunk #1 FAILED at 0 |
|
461 | Hunk #1 FAILED at 0 | |
461 | 1 out of 1 hunks FAILED -- saving rejects to file linkb.rej |
|
462 | 1 out of 1 hunks FAILED -- saving rejects to file linkb.rej | |
462 | abort: patch failed to apply |
|
463 | abort: patch failed to apply | |
463 | [255] |
|
464 | [255] | |
464 | $ hg st |
|
465 | $ hg st | |
465 | ? b.rej |
|
466 | ? b.rej | |
466 | ? linkb.rej |
|
467 | ? linkb.rej | |
467 |
|
468 | |||
468 | $ cd .. |
|
469 | $ cd .. |
@@ -1,1083 +1,1085 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ cat <<EOF >> $HGRCPATH |
|
3 | $ cat <<EOF >> $HGRCPATH | |
2 | > [extensions] |
|
4 | > [extensions] | |
3 | > keyword = |
|
5 | > keyword = | |
4 | > mq = |
|
6 | > mq = | |
5 | > notify = |
|
7 | > notify = | |
6 | > record = |
|
8 | > record = | |
7 | > transplant = |
|
9 | > transplant = | |
8 | > [ui] |
|
10 | > [ui] | |
9 | > interactive = true |
|
11 | > interactive = true | |
10 | > EOF |
|
12 | > EOF | |
11 |
|
13 | |||
12 | Run kwdemo before [keyword] files are set up |
|
14 | Run kwdemo before [keyword] files are set up | |
13 | as it would succeed without uisetup otherwise |
|
15 | as it would succeed without uisetup otherwise | |
14 |
|
16 | |||
15 | $ hg --quiet kwdemo |
|
17 | $ hg --quiet kwdemo | |
16 | [extensions] |
|
18 | [extensions] | |
17 | keyword = |
|
19 | keyword = | |
18 | [keyword] |
|
20 | [keyword] | |
19 | demo.txt = |
|
21 | demo.txt = | |
20 | [keywordset] |
|
22 | [keywordset] | |
21 | svn = False |
|
23 | svn = False | |
22 | [keywordmaps] |
|
24 | [keywordmaps] | |
23 | Author = {author|user} |
|
25 | Author = {author|user} | |
24 | Date = {date|utcdate} |
|
26 | Date = {date|utcdate} | |
25 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
|
27 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} | |
26 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
|
28 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} | |
27 | RCSFile = {file|basename},v |
|
29 | RCSFile = {file|basename},v | |
28 | RCSfile = {file|basename},v |
|
30 | RCSfile = {file|basename},v | |
29 | Revision = {node|short} |
|
31 | Revision = {node|short} | |
30 | Source = {root}/{file},v |
|
32 | Source = {root}/{file},v | |
31 | $Author: test $ |
|
33 | $Author: test $ | |
32 | $Date: ????/??/?? ??:??:?? $ (glob) |
|
34 | $Date: ????/??/?? ??:??:?? $ (glob) | |
33 | $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
|
35 | $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) | |
34 | $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
|
36 | $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) | |
35 | $RCSFile: demo.txt,v $ |
|
37 | $RCSFile: demo.txt,v $ | |
36 | $RCSfile: demo.txt,v $ |
|
38 | $RCSfile: demo.txt,v $ | |
37 | $Revision: ???????????? $ (glob) |
|
39 | $Revision: ???????????? $ (glob) | |
38 | $Source: */demo.txt,v $ (glob) |
|
40 | $Source: */demo.txt,v $ (glob) | |
39 |
|
41 | |||
40 | $ hg --quiet kwdemo "Branch = {branches}" |
|
42 | $ hg --quiet kwdemo "Branch = {branches}" | |
41 | [extensions] |
|
43 | [extensions] | |
42 | keyword = |
|
44 | keyword = | |
43 | [keyword] |
|
45 | [keyword] | |
44 | demo.txt = |
|
46 | demo.txt = | |
45 | [keywordset] |
|
47 | [keywordset] | |
46 | svn = False |
|
48 | svn = False | |
47 | [keywordmaps] |
|
49 | [keywordmaps] | |
48 | Branch = {branches} |
|
50 | Branch = {branches} | |
49 | $Branch: demobranch $ |
|
51 | $Branch: demobranch $ | |
50 |
|
52 | |||
51 | $ cat <<EOF >> $HGRCPATH |
|
53 | $ cat <<EOF >> $HGRCPATH | |
52 | > [keyword] |
|
54 | > [keyword] | |
53 | > ** = |
|
55 | > ** = | |
54 | > b = ignore |
|
56 | > b = ignore | |
55 | > i = ignore |
|
57 | > i = ignore | |
56 | > [hooks] |
|
58 | > [hooks] | |
57 | > EOF |
|
59 | > EOF | |
58 | $ cp $HGRCPATH $HGRCPATH.nohooks |
|
60 | $ cp $HGRCPATH $HGRCPATH.nohooks | |
59 | > cat <<EOF >> $HGRCPATH |
|
61 | > cat <<EOF >> $HGRCPATH | |
60 | > commit= |
|
62 | > commit= | |
61 | > commit.test=cp a hooktest |
|
63 | > commit.test=cp a hooktest | |
62 | > EOF |
|
64 | > EOF | |
63 |
|
65 | |||
64 | $ hg init Test-bndl |
|
66 | $ hg init Test-bndl | |
65 | $ cd Test-bndl |
|
67 | $ cd Test-bndl | |
66 |
|
68 | |||
67 | kwshrink should exit silently in empty/invalid repo |
|
69 | kwshrink should exit silently in empty/invalid repo | |
68 |
|
70 | |||
69 | $ hg kwshrink |
|
71 | $ hg kwshrink | |
70 |
|
72 | |||
71 | Symlinks cannot be created on Windows. |
|
73 | Symlinks cannot be created on Windows. | |
72 | A bundle to test this was made with: |
|
74 | A bundle to test this was made with: | |
73 | hg init t |
|
75 | hg init t | |
74 | cd t |
|
76 | cd t | |
75 | echo a > a |
|
77 | echo a > a | |
76 | ln -s a sym |
|
78 | ln -s a sym | |
77 | hg add sym |
|
79 | hg add sym | |
78 | hg ci -m addsym -u mercurial |
|
80 | hg ci -m addsym -u mercurial | |
79 | hg bundle --base null ../test-keyword.hg |
|
81 | hg bundle --base null ../test-keyword.hg | |
80 |
|
82 | |||
81 | $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg |
|
83 | $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg | |
82 | pulling from *test-keyword.hg (glob) |
|
84 | pulling from *test-keyword.hg (glob) | |
83 | requesting all changes |
|
85 | requesting all changes | |
84 | adding changesets |
|
86 | adding changesets | |
85 | adding manifests |
|
87 | adding manifests | |
86 | adding file changes |
|
88 | adding file changes | |
87 | added 1 changesets with 1 changes to 1 files |
|
89 | added 1 changesets with 1 changes to 1 files | |
88 | 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 | |
89 |
|
91 | |||
90 | $ echo 'expand $Id$' > a |
|
92 | $ echo 'expand $Id$' > a | |
91 | $ echo 'do not process $Id:' >> a |
|
93 | $ echo 'do not process $Id:' >> a | |
92 | $ echo 'xxx $' >> a |
|
94 | $ echo 'xxx $' >> a | |
93 | $ echo 'ignore $Id$' > b |
|
95 | $ echo 'ignore $Id$' > b | |
94 |
|
96 | |||
95 | Output files as they were created |
|
97 | Output files as they were created | |
96 |
|
98 | |||
97 | $ cat a b |
|
99 | $ cat a b | |
98 | expand $Id$ |
|
100 | expand $Id$ | |
99 | do not process $Id: |
|
101 | do not process $Id: | |
100 | xxx $ |
|
102 | xxx $ | |
101 | ignore $Id$ |
|
103 | ignore $Id$ | |
102 |
|
104 | |||
103 | no kwfiles |
|
105 | no kwfiles | |
104 |
|
106 | |||
105 | $ hg kwfiles |
|
107 | $ hg kwfiles | |
106 |
|
108 | |||
107 | untracked candidates |
|
109 | untracked candidates | |
108 |
|
110 | |||
109 | $ hg -v kwfiles --unknown |
|
111 | $ hg -v kwfiles --unknown | |
110 | k a |
|
112 | k a | |
111 |
|
113 | |||
112 | Add files and check status |
|
114 | Add files and check status | |
113 |
|
115 | |||
114 | $ hg addremove |
|
116 | $ hg addremove | |
115 | adding a |
|
117 | adding a | |
116 | adding b |
|
118 | adding b | |
117 | $ hg status |
|
119 | $ hg status | |
118 | A a |
|
120 | A a | |
119 | A b |
|
121 | A b | |
120 |
|
122 | |||
121 |
|
123 | |||
122 | Default keyword expansion including commit hook |
|
124 | Default keyword expansion including commit hook | |
123 | Interrupted commit should not change state or run commit hook |
|
125 | Interrupted commit should not change state or run commit hook | |
124 |
|
126 | |||
125 | $ hg --debug commit |
|
127 | $ hg --debug commit | |
126 | abort: empty commit message |
|
128 | abort: empty commit message | |
127 | [255] |
|
129 | [255] | |
128 | $ hg status |
|
130 | $ hg status | |
129 | A a |
|
131 | A a | |
130 | A b |
|
132 | A b | |
131 |
|
133 | |||
132 | Commit with several checks |
|
134 | Commit with several checks | |
133 |
|
135 | |||
134 | $ hg --debug commit -mabsym -u 'User Name <user@example.com>' |
|
136 | $ hg --debug commit -mabsym -u 'User Name <user@example.com>' | |
135 | a |
|
137 | a | |
136 | b |
|
138 | b | |
137 | overwriting a expanding keywords |
|
139 | overwriting a expanding keywords | |
138 | running hook commit.test: cp a hooktest |
|
140 | running hook commit.test: cp a hooktest | |
139 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
141 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 | |
140 | $ hg status |
|
142 | $ hg status | |
141 | ? hooktest |
|
143 | ? hooktest | |
142 | $ hg debugrebuildstate |
|
144 | $ hg debugrebuildstate | |
143 | $ hg --quiet identify |
|
145 | $ hg --quiet identify | |
144 | ef63ca68695b |
|
146 | ef63ca68695b | |
145 |
|
147 | |||
146 | cat files in working directory with keywords expanded |
|
148 | cat files in working directory with keywords expanded | |
147 |
|
149 | |||
148 | $ cat a b |
|
150 | $ cat a b | |
149 | 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 $ | |
150 | do not process $Id: |
|
152 | do not process $Id: | |
151 | xxx $ |
|
153 | xxx $ | |
152 | ignore $Id$ |
|
154 | ignore $Id$ | |
153 |
|
155 | |||
154 | hg cat files and symlink, no expansion |
|
156 | hg cat files and symlink, no expansion | |
155 |
|
157 | |||
156 | $ hg cat sym a b && echo |
|
158 | $ hg cat sym a b && echo | |
157 | 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 $ | |
158 | do not process $Id: |
|
160 | do not process $Id: | |
159 | xxx $ |
|
161 | xxx $ | |
160 | ignore $Id$ |
|
162 | ignore $Id$ | |
161 | a |
|
163 | a | |
162 |
|
164 | |||
163 | Test hook execution |
|
165 | Test hook execution | |
164 |
|
166 | |||
165 | $ diff a hooktest |
|
167 | $ diff a hooktest | |
166 |
|
168 | |||
167 | $ cp $HGRCPATH.nohooks $HGRCPATH |
|
169 | $ cp $HGRCPATH.nohooks $HGRCPATH | |
168 | $ rm hooktest |
|
170 | $ rm hooktest | |
169 |
|
171 | |||
170 | bundle |
|
172 | bundle | |
171 |
|
173 | |||
172 | $ hg bundle --base null ../kw.hg |
|
174 | $ hg bundle --base null ../kw.hg | |
173 | 2 changesets found |
|
175 | 2 changesets found | |
174 | $ cd .. |
|
176 | $ cd .. | |
175 | $ hg init Test |
|
177 | $ hg init Test | |
176 | $ cd Test |
|
178 | $ cd Test | |
177 |
|
179 | |||
178 | 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 | |
179 | ie. if patch.diff wrapper acts as it should |
|
181 | ie. if patch.diff wrapper acts as it should | |
180 |
|
182 | |||
181 | $ cat <<EOF >> $HGRCPATH |
|
183 | $ cat <<EOF >> $HGRCPATH | |
182 | > [hooks] |
|
184 | > [hooks] | |
183 | > incoming.notify = python:hgext.notify.hook |
|
185 | > incoming.notify = python:hgext.notify.hook | |
184 | > [notify] |
|
186 | > [notify] | |
185 | > sources = pull |
|
187 | > sources = pull | |
186 | > diffstat = False |
|
188 | > diffstat = False | |
187 | > maxsubject = 15 |
|
189 | > maxsubject = 15 | |
188 | > [reposubs] |
|
190 | > [reposubs] | |
189 | > * = Test |
|
191 | > * = Test | |
190 | > EOF |
|
192 | > EOF | |
191 |
|
193 | |||
192 | Pull from bundle and trigger notify |
|
194 | Pull from bundle and trigger notify | |
193 |
|
195 | |||
194 | $ hg pull -u ../kw.hg |
|
196 | $ hg pull -u ../kw.hg | |
195 | pulling from ../kw.hg |
|
197 | pulling from ../kw.hg | |
196 | requesting all changes |
|
198 | requesting all changes | |
197 | adding changesets |
|
199 | adding changesets | |
198 | adding manifests |
|
200 | adding manifests | |
199 | adding file changes |
|
201 | adding file changes | |
200 | added 2 changesets with 3 changes to 3 files |
|
202 | added 2 changesets with 3 changes to 3 files | |
201 | Content-Type: text/plain; charset="us-ascii" |
|
203 | Content-Type: text/plain; charset="us-ascii" | |
202 | MIME-Version: 1.0 |
|
204 | MIME-Version: 1.0 | |
203 | Content-Transfer-Encoding: 7bit |
|
205 | Content-Transfer-Encoding: 7bit | |
204 | Date: * (glob) |
|
206 | Date: * (glob) | |
205 | Subject: changeset in... |
|
207 | Subject: changeset in... | |
206 | From: mercurial |
|
208 | From: mercurial | |
207 | X-Hg-Notification: changeset a2392c293916 |
|
209 | X-Hg-Notification: changeset a2392c293916 | |
208 | Message-Id: <hg.a2392c293916*> (glob) |
|
210 | Message-Id: <hg.a2392c293916*> (glob) | |
209 | To: Test |
|
211 | To: Test | |
210 |
|
212 | |||
211 | changeset a2392c293916 in $TESTTMP/Test |
|
213 | changeset a2392c293916 in $TESTTMP/Test | |
212 | details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 |
|
214 | details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 | |
213 | description: |
|
215 | description: | |
214 | addsym |
|
216 | addsym | |
215 |
|
217 | |||
216 | diffs (6 lines): |
|
218 | diffs (6 lines): | |
217 |
|
219 | |||
218 | diff -r 000000000000 -r a2392c293916 sym |
|
220 | diff -r 000000000000 -r a2392c293916 sym | |
219 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
221 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
220 | +++ b/sym Sat Feb 09 20:25:47 2008 +0100 |
|
222 | +++ b/sym Sat Feb 09 20:25:47 2008 +0100 | |
221 | @@ -0,0 +1,1 @@ |
|
223 | @@ -0,0 +1,1 @@ | |
222 | +a |
|
224 | +a | |
223 | \ No newline at end of file |
|
225 | \ No newline at end of file | |
224 | Content-Type: text/plain; charset="us-ascii" |
|
226 | Content-Type: text/plain; charset="us-ascii" | |
225 | MIME-Version: 1.0 |
|
227 | MIME-Version: 1.0 | |
226 | Content-Transfer-Encoding: 7bit |
|
228 | Content-Transfer-Encoding: 7bit | |
227 | Date:* (glob) |
|
229 | Date:* (glob) | |
228 | Subject: changeset in... |
|
230 | Subject: changeset in... | |
229 | From: User Name <user@example.com> |
|
231 | From: User Name <user@example.com> | |
230 | X-Hg-Notification: changeset ef63ca68695b |
|
232 | X-Hg-Notification: changeset ef63ca68695b | |
231 | Message-Id: <hg.ef63ca68695b*> (glob) |
|
233 | Message-Id: <hg.ef63ca68695b*> (glob) | |
232 | To: Test |
|
234 | To: Test | |
233 |
|
235 | |||
234 | changeset ef63ca68695b in $TESTTMP/Test |
|
236 | changeset ef63ca68695b in $TESTTMP/Test | |
235 | details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b |
|
237 | details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b | |
236 | description: |
|
238 | description: | |
237 | absym |
|
239 | absym | |
238 |
|
240 | |||
239 | diffs (12 lines): |
|
241 | diffs (12 lines): | |
240 |
|
242 | |||
241 | diff -r a2392c293916 -r ef63ca68695b a |
|
243 | diff -r a2392c293916 -r ef63ca68695b a | |
242 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
244 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
243 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
245 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
244 | @@ -0,0 +1,3 @@ |
|
246 | @@ -0,0 +1,3 @@ | |
245 | +expand $Id$ |
|
247 | +expand $Id$ | |
246 | +do not process $Id: |
|
248 | +do not process $Id: | |
247 | +xxx $ |
|
249 | +xxx $ | |
248 | diff -r a2392c293916 -r ef63ca68695b b |
|
250 | diff -r a2392c293916 -r ef63ca68695b b | |
249 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
251 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
250 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
252 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 | |
251 | @@ -0,0 +1,1 @@ |
|
253 | @@ -0,0 +1,1 @@ | |
252 | +ignore $Id$ |
|
254 | +ignore $Id$ | |
253 | 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 | |
254 |
|
256 | |||
255 | $ cp $HGRCPATH.nohooks $HGRCPATH |
|
257 | $ cp $HGRCPATH.nohooks $HGRCPATH | |
256 |
|
258 | |||
257 | Touch files and check with status |
|
259 | Touch files and check with status | |
258 |
|
260 | |||
259 | $ touch a b |
|
261 | $ touch a b | |
260 | $ hg status |
|
262 | $ hg status | |
261 |
|
263 | |||
262 | Update and expand |
|
264 | Update and expand | |
263 |
|
265 | |||
264 | $ rm sym a b |
|
266 | $ rm sym a b | |
265 | $ hg update -C |
|
267 | $ hg update -C | |
266 | 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 | |
267 | $ cat a b |
|
269 | $ cat a b | |
268 | 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 $ | |
269 | do not process $Id: |
|
271 | do not process $Id: | |
270 | xxx $ |
|
272 | xxx $ | |
271 | ignore $Id$ |
|
273 | ignore $Id$ | |
272 |
|
274 | |||
273 | Check whether expansion is filewise and file mode is preserved |
|
275 | Check whether expansion is filewise and file mode is preserved | |
274 |
|
276 | |||
275 | $ echo '$Id$' > c |
|
277 | $ echo '$Id$' > c | |
276 | $ echo 'tests for different changenodes' >> c |
|
278 | $ echo 'tests for different changenodes' >> c | |
277 | $ chmod 600 c |
|
279 | $ chmod 600 c | |
278 | $ ls -l c | cut -b 1-10 |
|
280 | $ ls -l c | cut -b 1-10 | |
279 | -rw------- |
|
281 | -rw------- | |
280 |
|
282 | |||
281 | commit file c |
|
283 | commit file c | |
282 |
|
284 | |||
283 | $ 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>' | |
284 | adding c |
|
286 | adding c | |
285 | $ ls -l c | cut -b 1-10 |
|
287 | $ ls -l c | cut -b 1-10 | |
286 | -rw------- |
|
288 | -rw------- | |
287 |
|
289 | |||
288 | force expansion |
|
290 | force expansion | |
289 |
|
291 | |||
290 | $ hg -v kwexpand |
|
292 | $ hg -v kwexpand | |
291 | overwriting a expanding keywords |
|
293 | overwriting a expanding keywords | |
292 | overwriting c expanding keywords |
|
294 | overwriting c expanding keywords | |
293 |
|
295 | |||
294 | compare changenodes in a and c |
|
296 | compare changenodes in a and c | |
295 |
|
297 | |||
296 | $ cat a c |
|
298 | $ cat a c | |
297 | 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 $ | |
298 | do not process $Id: |
|
300 | do not process $Id: | |
299 | xxx $ |
|
301 | xxx $ | |
300 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
302 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
301 | tests for different changenodes |
|
303 | tests for different changenodes | |
302 |
|
304 | |||
303 | record |
|
305 | record | |
304 |
|
306 | |||
305 | $ echo '$Id$' > r |
|
307 | $ echo '$Id$' > r | |
306 | $ hg add r |
|
308 | $ hg add r | |
307 |
|
309 | |||
308 | record chunk |
|
310 | record chunk | |
309 |
|
311 | |||
310 | $ python -c \ |
|
312 | $ python -c \ | |
311 | > '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);' | |
312 | $ hg record -d '1 10' -m rectest a<<EOF |
|
314 | $ hg record -d '1 10' -m rectest a<<EOF | |
313 | > y |
|
315 | > y | |
314 | > y |
|
316 | > y | |
315 | > n |
|
317 | > n | |
316 | > EOF |
|
318 | > EOF | |
317 | diff --git a/a b/a |
|
319 | diff --git a/a b/a | |
318 | 2 hunks, 2 lines changed |
|
320 | 2 hunks, 2 lines changed | |
319 | examine changes to 'a'? [Ynsfdaq?] |
|
321 | examine changes to 'a'? [Ynsfdaq?] | |
320 | @@ -1,3 +1,4 @@ |
|
322 | @@ -1,3 +1,4 @@ | |
321 | expand $Id$ |
|
323 | expand $Id$ | |
322 | +foo |
|
324 | +foo | |
323 | do not process $Id: |
|
325 | do not process $Id: | |
324 | xxx $ |
|
326 | xxx $ | |
325 | record change 1/2 to 'a'? [Ynsfdaq?] |
|
327 | record change 1/2 to 'a'? [Ynsfdaq?] | |
326 | @@ -2,2 +3,3 @@ |
|
328 | @@ -2,2 +3,3 @@ | |
327 | do not process $Id: |
|
329 | do not process $Id: | |
328 | xxx $ |
|
330 | xxx $ | |
329 | +bar |
|
331 | +bar | |
330 | record change 2/2 to 'a'? [Ynsfdaq?] |
|
332 | record change 2/2 to 'a'? [Ynsfdaq?] | |
331 |
|
333 | |||
332 | $ hg identify |
|
334 | $ hg identify | |
333 | d17e03c92c97+ tip |
|
335 | d17e03c92c97+ tip | |
334 | $ hg status |
|
336 | $ hg status | |
335 | M a |
|
337 | M a | |
336 | A r |
|
338 | A r | |
337 |
|
339 | |||
338 | Cat modified file a |
|
340 | Cat modified file a | |
339 |
|
341 | |||
340 | $ cat a |
|
342 | $ cat a | |
341 | 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 $ | |
342 | foo |
|
344 | foo | |
343 | do not process $Id: |
|
345 | do not process $Id: | |
344 | xxx $ |
|
346 | xxx $ | |
345 | bar |
|
347 | bar | |
346 |
|
348 | |||
347 | Diff remaining chunk |
|
349 | Diff remaining chunk | |
348 |
|
350 | |||
349 | $ hg diff a |
|
351 | $ hg diff a | |
350 | diff -r d17e03c92c97 a |
|
352 | diff -r d17e03c92c97 a | |
351 | --- a/a Wed Dec 31 23:59:51 1969 -0000 |
|
353 | --- a/a Wed Dec 31 23:59:51 1969 -0000 | |
352 | +++ b/a * (glob) |
|
354 | +++ b/a * (glob) | |
353 | @@ -2,3 +2,4 @@ |
|
355 | @@ -2,3 +2,4 @@ | |
354 | foo |
|
356 | foo | |
355 | do not process $Id: |
|
357 | do not process $Id: | |
356 | xxx $ |
|
358 | xxx $ | |
357 | +bar |
|
359 | +bar | |
358 |
|
360 | |||
359 | $ hg rollback |
|
361 | $ hg rollback | |
360 | repository tip rolled back to revision 2 (undo commit) |
|
362 | repository tip rolled back to revision 2 (undo commit) | |
361 | working directory now based on revision 2 |
|
363 | working directory now based on revision 2 | |
362 |
|
364 | |||
363 | Record all chunks in file a |
|
365 | Record all chunks in file a | |
364 |
|
366 | |||
365 | $ echo foo > msg |
|
367 | $ echo foo > msg | |
366 |
|
368 | |||
367 | - do not use "hg record -m" here! |
|
369 | - do not use "hg record -m" here! | |
368 |
|
370 | |||
369 | $ hg record -l msg -d '1 11' a<<EOF |
|
371 | $ hg record -l msg -d '1 11' a<<EOF | |
370 | > y |
|
372 | > y | |
371 | > y |
|
373 | > y | |
372 | > y |
|
374 | > y | |
373 | > EOF |
|
375 | > EOF | |
374 | diff --git a/a b/a |
|
376 | diff --git a/a b/a | |
375 | 2 hunks, 2 lines changed |
|
377 | 2 hunks, 2 lines changed | |
376 | examine changes to 'a'? [Ynsfdaq?] |
|
378 | examine changes to 'a'? [Ynsfdaq?] | |
377 | @@ -1,3 +1,4 @@ |
|
379 | @@ -1,3 +1,4 @@ | |
378 | expand $Id$ |
|
380 | expand $Id$ | |
379 | +foo |
|
381 | +foo | |
380 | do not process $Id: |
|
382 | do not process $Id: | |
381 | xxx $ |
|
383 | xxx $ | |
382 | record change 1/2 to 'a'? [Ynsfdaq?] |
|
384 | record change 1/2 to 'a'? [Ynsfdaq?] | |
383 | @@ -2,2 +3,3 @@ |
|
385 | @@ -2,2 +3,3 @@ | |
384 | do not process $Id: |
|
386 | do not process $Id: | |
385 | xxx $ |
|
387 | xxx $ | |
386 | +bar |
|
388 | +bar | |
387 | record change 2/2 to 'a'? [Ynsfdaq?] |
|
389 | record change 2/2 to 'a'? [Ynsfdaq?] | |
388 |
|
390 | |||
389 | File a should be clean |
|
391 | File a should be clean | |
390 |
|
392 | |||
391 | $ hg status -A a |
|
393 | $ hg status -A a | |
392 | C a |
|
394 | C a | |
393 |
|
395 | |||
394 | rollback and revert expansion |
|
396 | rollback and revert expansion | |
395 |
|
397 | |||
396 | $ cat a |
|
398 | $ cat a | |
397 | 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 $ | |
398 | foo |
|
400 | foo | |
399 | do not process $Id: |
|
401 | do not process $Id: | |
400 | xxx $ |
|
402 | xxx $ | |
401 | bar |
|
403 | bar | |
402 | $ hg --verbose rollback |
|
404 | $ hg --verbose rollback | |
403 | repository tip rolled back to revision 2 (undo commit) |
|
405 | repository tip rolled back to revision 2 (undo commit) | |
404 | working directory now based on revision 2 |
|
406 | working directory now based on revision 2 | |
405 | overwriting a expanding keywords |
|
407 | overwriting a expanding keywords | |
406 | $ hg status a |
|
408 | $ hg status a | |
407 | M a |
|
409 | M a | |
408 | $ cat a |
|
410 | $ cat a | |
409 | 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 $ | |
410 | foo |
|
412 | foo | |
411 | do not process $Id: |
|
413 | do not process $Id: | |
412 | xxx $ |
|
414 | xxx $ | |
413 | bar |
|
415 | bar | |
414 | $ echo '$Id$' > y |
|
416 | $ echo '$Id$' > y | |
415 | $ echo '$Id$' > z |
|
417 | $ echo '$Id$' > z | |
416 | $ hg add y |
|
418 | $ hg add y | |
417 | $ hg commit -Am "rollback only" z |
|
419 | $ hg commit -Am "rollback only" z | |
418 | $ cat z |
|
420 | $ cat z | |
419 | $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ |
|
421 | $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ | |
420 | $ hg --verbose rollback |
|
422 | $ hg --verbose rollback | |
421 | repository tip rolled back to revision 2 (undo commit) |
|
423 | repository tip rolled back to revision 2 (undo commit) | |
422 | working directory now based on revision 2 |
|
424 | working directory now based on revision 2 | |
423 | overwriting z shrinking keywords |
|
425 | overwriting z shrinking keywords | |
424 |
|
426 | |||
425 | Only z should be overwritten |
|
427 | Only z should be overwritten | |
426 |
|
428 | |||
427 | $ hg status a y z |
|
429 | $ hg status a y z | |
428 | M a |
|
430 | M a | |
429 | A y |
|
431 | A y | |
430 | A z |
|
432 | A z | |
431 | $ cat z |
|
433 | $ cat z | |
432 | $Id$ |
|
434 | $Id$ | |
433 | $ hg forget y z |
|
435 | $ hg forget y z | |
434 | $ rm y z |
|
436 | $ rm y z | |
435 |
|
437 | |||
436 | record added file alone |
|
438 | record added file alone | |
437 |
|
439 | |||
438 | $ hg -v record -l msg -d '1 12' r<<EOF |
|
440 | $ hg -v record -l msg -d '1 12' r<<EOF | |
439 | > y |
|
441 | > y | |
440 | > EOF |
|
442 | > EOF | |
441 | diff --git a/r b/r |
|
443 | diff --git a/r b/r | |
442 | new file mode 100644 |
|
444 | new file mode 100644 | |
443 | examine changes to 'r'? [Ynsfdaq?] |
|
445 | examine changes to 'r'? [Ynsfdaq?] | |
444 | r |
|
446 | r | |
445 | committed changeset 3:899491280810 |
|
447 | committed changeset 3:899491280810 | |
446 | overwriting r expanding keywords |
|
448 | overwriting r expanding keywords | |
447 | - status call required for dirstate.normallookup() check |
|
449 | - status call required for dirstate.normallookup() check | |
448 | $ hg status r |
|
450 | $ hg status r | |
449 | $ hg --verbose rollback |
|
451 | $ hg --verbose rollback | |
450 | repository tip rolled back to revision 2 (undo commit) |
|
452 | repository tip rolled back to revision 2 (undo commit) | |
451 | working directory now based on revision 2 |
|
453 | working directory now based on revision 2 | |
452 | overwriting r shrinking keywords |
|
454 | overwriting r shrinking keywords | |
453 | $ hg forget r |
|
455 | $ hg forget r | |
454 | $ rm msg r |
|
456 | $ rm msg r | |
455 | $ hg update -C |
|
457 | $ hg update -C | |
456 | 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 | |
457 |
|
459 | |||
458 | record added keyword ignored file |
|
460 | record added keyword ignored file | |
459 |
|
461 | |||
460 | $ echo '$Id$' > i |
|
462 | $ echo '$Id$' > i | |
461 | $ hg add i |
|
463 | $ hg add i | |
462 | $ hg --verbose record -d '1 13' -m recignored<<EOF |
|
464 | $ hg --verbose record -d '1 13' -m recignored<<EOF | |
463 | > y |
|
465 | > y | |
464 | > EOF |
|
466 | > EOF | |
465 | diff --git a/i b/i |
|
467 | diff --git a/i b/i | |
466 | new file mode 100644 |
|
468 | new file mode 100644 | |
467 | examine changes to 'i'? [Ynsfdaq?] |
|
469 | examine changes to 'i'? [Ynsfdaq?] | |
468 | i |
|
470 | i | |
469 | committed changeset 3:5f40fe93bbdc |
|
471 | committed changeset 3:5f40fe93bbdc | |
470 | $ cat i |
|
472 | $ cat i | |
471 | $Id$ |
|
473 | $Id$ | |
472 | $ hg -q rollback |
|
474 | $ hg -q rollback | |
473 | $ hg forget i |
|
475 | $ hg forget i | |
474 | $ rm i |
|
476 | $ rm i | |
475 |
|
477 | |||
476 | Test patch queue repo |
|
478 | Test patch queue repo | |
477 |
|
479 | |||
478 | $ hg init --mq |
|
480 | $ hg init --mq | |
479 | $ hg qimport -r tip -n mqtest.diff |
|
481 | $ hg qimport -r tip -n mqtest.diff | |
480 | $ hg commit --mq -m mqtest |
|
482 | $ hg commit --mq -m mqtest | |
481 |
|
483 | |||
482 | Keywords should not be expanded in patch |
|
484 | Keywords should not be expanded in patch | |
483 |
|
485 | |||
484 | $ cat .hg/patches/mqtest.diff |
|
486 | $ cat .hg/patches/mqtest.diff | |
485 | # HG changeset patch |
|
487 | # HG changeset patch | |
486 | # User User Name <user@example.com> |
|
488 | # User User Name <user@example.com> | |
487 | # Date 1 0 |
|
489 | # Date 1 0 | |
488 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad |
|
490 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad | |
489 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
491 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 | |
490 | cndiff |
|
492 | cndiff | |
491 |
|
493 | |||
492 | diff -r ef63ca68695b -r 40a904bbbe4c c |
|
494 | diff -r ef63ca68695b -r 40a904bbbe4c c | |
493 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
495 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
494 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 |
|
496 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 | |
495 | @@ -0,0 +1,2 @@ |
|
497 | @@ -0,0 +1,2 @@ | |
496 | +$Id$ |
|
498 | +$Id$ | |
497 | +tests for different changenodes |
|
499 | +tests for different changenodes | |
498 |
|
500 | |||
499 | $ hg qpop |
|
501 | $ hg qpop | |
500 | popping mqtest.diff |
|
502 | popping mqtest.diff | |
501 | patch queue now empty |
|
503 | patch queue now empty | |
502 |
|
504 | |||
503 | qgoto, implying qpush, should expand |
|
505 | qgoto, implying qpush, should expand | |
504 |
|
506 | |||
505 | $ hg qgoto mqtest.diff |
|
507 | $ hg qgoto mqtest.diff | |
506 | applying mqtest.diff |
|
508 | applying mqtest.diff | |
507 | now at: mqtest.diff |
|
509 | now at: mqtest.diff | |
508 | $ cat c |
|
510 | $ cat c | |
509 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
511 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
510 | tests for different changenodes |
|
512 | tests for different changenodes | |
511 | $ hg cat c |
|
513 | $ hg cat c | |
512 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
514 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ | |
513 | tests for different changenodes |
|
515 | tests for different changenodes | |
514 |
|
516 | |||
515 | Keywords should not be expanded in filelog |
|
517 | Keywords should not be expanded in filelog | |
516 |
|
518 | |||
517 | $ hg --config 'extensions.keyword=!' cat c |
|
519 | $ hg --config 'extensions.keyword=!' cat c | |
518 | $Id$ |
|
520 | $Id$ | |
519 | tests for different changenodes |
|
521 | tests for different changenodes | |
520 |
|
522 | |||
521 | qpop and move on |
|
523 | qpop and move on | |
522 |
|
524 | |||
523 | $ hg qpop |
|
525 | $ hg qpop | |
524 | popping mqtest.diff |
|
526 | popping mqtest.diff | |
525 | patch queue now empty |
|
527 | patch queue now empty | |
526 |
|
528 | |||
527 | Copy and show added kwfiles |
|
529 | Copy and show added kwfiles | |
528 |
|
530 | |||
529 | $ hg cp a c |
|
531 | $ hg cp a c | |
530 | $ hg kwfiles |
|
532 | $ hg kwfiles | |
531 | a |
|
533 | a | |
532 | c |
|
534 | c | |
533 |
|
535 | |||
534 | Commit and show expansion in original and copy |
|
536 | Commit and show expansion in original and copy | |
535 |
|
537 | |||
536 | $ 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>' | |
537 | c |
|
539 | c | |
538 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
|
540 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | |
539 | overwriting c expanding keywords |
|
541 | overwriting c expanding keywords | |
540 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d |
|
542 | committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d | |
541 | $ cat a c |
|
543 | $ cat a c | |
542 | 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 $ | |
543 | do not process $Id: |
|
545 | do not process $Id: | |
544 | xxx $ |
|
546 | xxx $ | |
545 | 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 $ | |
546 | do not process $Id: |
|
548 | do not process $Id: | |
547 | xxx $ |
|
549 | xxx $ | |
548 |
|
550 | |||
549 | Touch copied c and check its status |
|
551 | Touch copied c and check its status | |
550 |
|
552 | |||
551 | $ touch c |
|
553 | $ touch c | |
552 | $ hg status |
|
554 | $ hg status | |
553 |
|
555 | |||
554 | Copy kwfile to keyword ignored file unexpanding keywords |
|
556 | Copy kwfile to keyword ignored file unexpanding keywords | |
555 |
|
557 | |||
556 | $ hg --verbose copy a i |
|
558 | $ hg --verbose copy a i | |
557 | copying a to i |
|
559 | copying a to i | |
558 | overwriting i shrinking keywords |
|
560 | overwriting i shrinking keywords | |
559 | $ head -n 1 i |
|
561 | $ head -n 1 i | |
560 | expand $Id$ |
|
562 | expand $Id$ | |
561 | $ hg forget i |
|
563 | $ hg forget i | |
562 | $ rm i |
|
564 | $ rm i | |
563 |
|
565 | |||
564 | Copy ignored file to ignored file: no overwriting |
|
566 | Copy ignored file to ignored file: no overwriting | |
565 |
|
567 | |||
566 | $ hg --verbose copy b i |
|
568 | $ hg --verbose copy b i | |
567 | copying b to i |
|
569 | copying b to i | |
568 | $ hg forget i |
|
570 | $ hg forget i | |
569 | $ rm i |
|
571 | $ rm i | |
570 |
|
572 | |||
571 | cp symlink file; hg cp -A symlink file (part1) |
|
573 | cp symlink file; hg cp -A symlink file (part1) | |
572 | - copied symlink points to kwfile: overwrite |
|
574 | - copied symlink points to kwfile: overwrite | |
573 |
|
575 | |||
574 | $ cp sym i |
|
576 | $ cp sym i | |
575 | $ ls -l i |
|
577 | $ ls -l i | |
576 | -rw-r--r--* (glob) |
|
578 | -rw-r--r--* (glob) | |
577 | $ head -1 i |
|
579 | $ head -1 i | |
578 | 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 $ | |
579 | $ hg copy --after --verbose sym i |
|
581 | $ hg copy --after --verbose sym i | |
580 | copying sym to i |
|
582 | copying sym to i | |
581 | overwriting i shrinking keywords |
|
583 | overwriting i shrinking keywords | |
582 | $ head -1 i |
|
584 | $ head -1 i | |
583 | expand $Id$ |
|
585 | expand $Id$ | |
584 | $ hg forget i |
|
586 | $ hg forget i | |
585 | $ rm i |
|
587 | $ rm i | |
586 |
|
588 | |||
587 | Test different options of hg kwfiles |
|
589 | Test different options of hg kwfiles | |
588 |
|
590 | |||
589 | $ hg kwfiles |
|
591 | $ hg kwfiles | |
590 | a |
|
592 | a | |
591 | c |
|
593 | c | |
592 | $ hg -v kwfiles --ignore |
|
594 | $ hg -v kwfiles --ignore | |
593 | I b |
|
595 | I b | |
594 | I sym |
|
596 | I sym | |
595 | $ hg kwfiles --all |
|
597 | $ hg kwfiles --all | |
596 | K a |
|
598 | K a | |
597 | K c |
|
599 | K c | |
598 | I b |
|
600 | I b | |
599 | I sym |
|
601 | I sym | |
600 |
|
602 | |||
601 | Diff specific revision |
|
603 | Diff specific revision | |
602 |
|
604 | |||
603 | $ hg diff --rev 1 |
|
605 | $ hg diff --rev 1 | |
604 | diff -r ef63ca68695b c |
|
606 | diff -r ef63ca68695b c | |
605 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
607 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
606 | +++ b/c * (glob) |
|
608 | +++ b/c * (glob) | |
607 | @@ -0,0 +1,3 @@ |
|
609 | @@ -0,0 +1,3 @@ | |
608 | +expand $Id$ |
|
610 | +expand $Id$ | |
609 | +do not process $Id: |
|
611 | +do not process $Id: | |
610 | +xxx $ |
|
612 | +xxx $ | |
611 |
|
613 | |||
612 | Status after rollback: |
|
614 | Status after rollback: | |
613 |
|
615 | |||
614 | $ hg rollback |
|
616 | $ hg rollback | |
615 | repository tip rolled back to revision 1 (undo commit) |
|
617 | repository tip rolled back to revision 1 (undo commit) | |
616 | working directory now based on revision 1 |
|
618 | working directory now based on revision 1 | |
617 | $ hg status |
|
619 | $ hg status | |
618 | A c |
|
620 | A c | |
619 | $ hg update --clean |
|
621 | $ hg update --clean | |
620 | 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 | |
621 |
|
623 | |||
622 | cp symlink file; hg cp -A symlink file (part2) |
|
624 | cp symlink file; hg cp -A symlink file (part2) | |
623 | - copied symlink points to kw ignored file: do not overwrite |
|
625 | - copied symlink points to kw ignored file: do not overwrite | |
624 |
|
626 | |||
625 | $ cat a > i |
|
627 | $ cat a > i | |
626 | $ ln -s i symignored |
|
628 | $ ln -s i symignored | |
627 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored |
|
629 | $ hg commit -Am 'fake expansion in ignored and symlink' i symignored | |
628 | $ cp symignored x |
|
630 | $ cp symignored x | |
629 | $ hg copy --after --verbose symignored x |
|
631 | $ hg copy --after --verbose symignored x | |
630 | copying symignored to x |
|
632 | copying symignored to x | |
631 | $ head -n 1 x |
|
633 | $ head -n 1 x | |
632 | 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 $ | |
633 | $ hg forget x |
|
635 | $ hg forget x | |
634 | $ rm x |
|
636 | $ rm x | |
635 |
|
637 | |||
636 | $ hg rollback |
|
638 | $ hg rollback | |
637 | repository tip rolled back to revision 1 (undo commit) |
|
639 | repository tip rolled back to revision 1 (undo commit) | |
638 | working directory now based on revision 1 |
|
640 | working directory now based on revision 1 | |
639 | $ hg update --clean |
|
641 | $ hg update --clean | |
640 | 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 | |
641 | $ rm i symignored |
|
643 | $ rm i symignored | |
642 |
|
644 | |||
643 | Custom keywordmaps as argument to kwdemo |
|
645 | Custom keywordmaps as argument to kwdemo | |
644 |
|
646 | |||
645 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" |
|
647 | $ hg --quiet kwdemo "Xinfo = {author}: {desc}" | |
646 | [extensions] |
|
648 | [extensions] | |
647 | keyword = |
|
649 | keyword = | |
648 | [keyword] |
|
650 | [keyword] | |
649 | ** = |
|
651 | ** = | |
650 | b = ignore |
|
652 | b = ignore | |
651 | demo.txt = |
|
653 | demo.txt = | |
652 | i = ignore |
|
654 | i = ignore | |
653 | [keywordset] |
|
655 | [keywordset] | |
654 | svn = False |
|
656 | svn = False | |
655 | [keywordmaps] |
|
657 | [keywordmaps] | |
656 | Xinfo = {author}: {desc} |
|
658 | Xinfo = {author}: {desc} | |
657 | $Xinfo: test: hg keyword configuration and expansion example $ |
|
659 | $Xinfo: test: hg keyword configuration and expansion example $ | |
658 |
|
660 | |||
659 | Configure custom keywordmaps |
|
661 | Configure custom keywordmaps | |
660 |
|
662 | |||
661 | $ cat <<EOF >>$HGRCPATH |
|
663 | $ cat <<EOF >>$HGRCPATH | |
662 | > [keywordmaps] |
|
664 | > [keywordmaps] | |
663 | > Id = {file} {node|short} {date|rfc822date} {author|user} |
|
665 | > Id = {file} {node|short} {date|rfc822date} {author|user} | |
664 | > Xinfo = {author}: {desc} |
|
666 | > Xinfo = {author}: {desc} | |
665 | > EOF |
|
667 | > EOF | |
666 |
|
668 | |||
667 | Cat and hg cat files before custom expansion |
|
669 | Cat and hg cat files before custom expansion | |
668 |
|
670 | |||
669 | $ cat a b |
|
671 | $ cat a b | |
670 | 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 $ | |
671 | do not process $Id: |
|
673 | do not process $Id: | |
672 | xxx $ |
|
674 | xxx $ | |
673 | ignore $Id$ |
|
675 | ignore $Id$ | |
674 | $ hg cat sym a b && echo |
|
676 | $ hg cat sym a b && echo | |
675 | 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 $ | |
676 | do not process $Id: |
|
678 | do not process $Id: | |
677 | xxx $ |
|
679 | xxx $ | |
678 | ignore $Id$ |
|
680 | ignore $Id$ | |
679 | a |
|
681 | a | |
680 |
|
682 | |||
681 | Write custom keyword and prepare multiline commit message |
|
683 | Write custom keyword and prepare multiline commit message | |
682 |
|
684 | |||
683 | $ echo '$Xinfo$' >> a |
|
685 | $ echo '$Xinfo$' >> a | |
684 | $ cat <<EOF >> log |
|
686 | $ cat <<EOF >> log | |
685 | > firstline |
|
687 | > firstline | |
686 | > secondline |
|
688 | > secondline | |
687 | > EOF |
|
689 | > EOF | |
688 |
|
690 | |||
689 | Interrupted commit should not change state |
|
691 | Interrupted commit should not change state | |
690 |
|
692 | |||
691 | $ hg commit |
|
693 | $ hg commit | |
692 | abort: empty commit message |
|
694 | abort: empty commit message | |
693 | [255] |
|
695 | [255] | |
694 | $ hg status |
|
696 | $ hg status | |
695 | M a |
|
697 | M a | |
696 | ? c |
|
698 | ? c | |
697 | ? log |
|
699 | ? log | |
698 |
|
700 | |||
699 | Commit with multiline message and custom expansion |
|
701 | Commit with multiline message and custom expansion | |
700 |
|
702 | |||
701 | $ 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>' | |
702 | a |
|
704 | a | |
703 | overwriting a expanding keywords |
|
705 | overwriting a expanding keywords | |
704 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
706 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 | |
705 | $ rm log |
|
707 | $ rm log | |
706 |
|
708 | |||
707 | Stat, verify and show custom expansion (firstline) |
|
709 | Stat, verify and show custom expansion (firstline) | |
708 |
|
710 | |||
709 | $ hg status |
|
711 | $ hg status | |
710 | ? c |
|
712 | ? c | |
711 | $ hg verify |
|
713 | $ hg verify | |
712 | checking changesets |
|
714 | checking changesets | |
713 | checking manifests |
|
715 | checking manifests | |
714 | crosschecking files in changesets and manifests |
|
716 | crosschecking files in changesets and manifests | |
715 | checking files |
|
717 | checking files | |
716 | 3 files, 3 changesets, 4 total revisions |
|
718 | 3 files, 3 changesets, 4 total revisions | |
717 | $ cat a b |
|
719 | $ cat a b | |
718 | 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 $ | |
719 | do not process $Id: |
|
721 | do not process $Id: | |
720 | xxx $ |
|
722 | xxx $ | |
721 | $Xinfo: User Name <user@example.com>: firstline $ |
|
723 | $Xinfo: User Name <user@example.com>: firstline $ | |
722 | ignore $Id$ |
|
724 | ignore $Id$ | |
723 | $ hg cat sym a b && echo |
|
725 | $ hg cat sym a b && echo | |
724 | 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 $ | |
725 | do not process $Id: |
|
727 | do not process $Id: | |
726 | xxx $ |
|
728 | xxx $ | |
727 | $Xinfo: User Name <user@example.com>: firstline $ |
|
729 | $Xinfo: User Name <user@example.com>: firstline $ | |
728 | ignore $Id$ |
|
730 | ignore $Id$ | |
729 | a |
|
731 | a | |
730 |
|
732 | |||
731 | annotate |
|
733 | annotate | |
732 |
|
734 | |||
733 | $ hg annotate a |
|
735 | $ hg annotate a | |
734 | 1: expand $Id$ |
|
736 | 1: expand $Id$ | |
735 | 1: do not process $Id: |
|
737 | 1: do not process $Id: | |
736 | 1: xxx $ |
|
738 | 1: xxx $ | |
737 | 2: $Xinfo$ |
|
739 | 2: $Xinfo$ | |
738 |
|
740 | |||
739 | remove with status checks |
|
741 | remove with status checks | |
740 |
|
742 | |||
741 | $ hg debugrebuildstate |
|
743 | $ hg debugrebuildstate | |
742 | $ hg remove a |
|
744 | $ hg remove a | |
743 | $ hg --debug commit -m rma |
|
745 | $ hg --debug commit -m rma | |
744 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 |
|
746 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 | |
745 | $ hg status |
|
747 | $ hg status | |
746 | ? c |
|
748 | ? c | |
747 |
|
749 | |||
748 | Rollback, revert, and check expansion |
|
750 | Rollback, revert, and check expansion | |
749 |
|
751 | |||
750 | $ hg rollback |
|
752 | $ hg rollback | |
751 | repository tip rolled back to revision 2 (undo commit) |
|
753 | repository tip rolled back to revision 2 (undo commit) | |
752 | working directory now based on revision 2 |
|
754 | working directory now based on revision 2 | |
753 | $ hg status |
|
755 | $ hg status | |
754 | R a |
|
756 | R a | |
755 | ? c |
|
757 | ? c | |
756 | $ hg revert --no-backup --rev tip a |
|
758 | $ hg revert --no-backup --rev tip a | |
757 | $ cat a |
|
759 | $ cat a | |
758 | 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 $ | |
759 | do not process $Id: |
|
761 | do not process $Id: | |
760 | xxx $ |
|
762 | xxx $ | |
761 | $Xinfo: User Name <user@example.com>: firstline $ |
|
763 | $Xinfo: User Name <user@example.com>: firstline $ | |
762 |
|
764 | |||
763 | Clone to test global and local configurations |
|
765 | Clone to test global and local configurations | |
764 |
|
766 | |||
765 | $ cd .. |
|
767 | $ cd .. | |
766 |
|
768 | |||
767 | Expansion in destinaton with global configuration |
|
769 | Expansion in destinaton with global configuration | |
768 |
|
770 | |||
769 | $ hg --quiet clone Test globalconf |
|
771 | $ hg --quiet clone Test globalconf | |
770 | $ cat globalconf/a |
|
772 | $ cat globalconf/a | |
771 | 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 $ | |
772 | do not process $Id: |
|
774 | do not process $Id: | |
773 | xxx $ |
|
775 | xxx $ | |
774 | $Xinfo: User Name <user@example.com>: firstline $ |
|
776 | $Xinfo: User Name <user@example.com>: firstline $ | |
775 |
|
777 | |||
776 | No expansion in destination with local configuration in origin only |
|
778 | No expansion in destination with local configuration in origin only | |
777 |
|
779 | |||
778 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf |
|
780 | $ hg --quiet --config 'keyword.**=ignore' clone Test localconf | |
779 | $ cat localconf/a |
|
781 | $ cat localconf/a | |
780 | expand $Id$ |
|
782 | expand $Id$ | |
781 | do not process $Id: |
|
783 | do not process $Id: | |
782 | xxx $ |
|
784 | xxx $ | |
783 | $Xinfo$ |
|
785 | $Xinfo$ | |
784 |
|
786 | |||
785 | Clone to test incoming |
|
787 | Clone to test incoming | |
786 |
|
788 | |||
787 | $ hg clone -r1 Test Test-a |
|
789 | $ hg clone -r1 Test Test-a | |
788 | adding changesets |
|
790 | adding changesets | |
789 | adding manifests |
|
791 | adding manifests | |
790 | adding file changes |
|
792 | adding file changes | |
791 | added 2 changesets with 3 changes to 3 files |
|
793 | added 2 changesets with 3 changes to 3 files | |
792 | updating to branch default |
|
794 | updating to branch default | |
793 | 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 | |
794 | $ cd Test-a |
|
796 | $ cd Test-a | |
795 | $ cat <<EOF >> .hg/hgrc |
|
797 | $ cat <<EOF >> .hg/hgrc | |
796 | > [paths] |
|
798 | > [paths] | |
797 | > default = ../Test |
|
799 | > default = ../Test | |
798 | > EOF |
|
800 | > EOF | |
799 | $ hg incoming |
|
801 | $ hg incoming | |
800 | comparing with $TESTTMP/Test |
|
802 | comparing with $TESTTMP/Test | |
801 | searching for changes |
|
803 | searching for changes | |
802 | changeset: 2:bb948857c743 |
|
804 | changeset: 2:bb948857c743 | |
803 | tag: tip |
|
805 | tag: tip | |
804 | user: User Name <user@example.com> |
|
806 | user: User Name <user@example.com> | |
805 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
807 | date: Thu Jan 01 00:00:02 1970 +0000 | |
806 | summary: firstline |
|
808 | summary: firstline | |
807 |
|
809 | |||
808 | Imported patch should not be rejected |
|
810 | Imported patch should not be rejected | |
809 |
|
811 | |||
810 | $ python -c \ |
|
812 | $ python -c \ | |
811 | > '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);' | |
812 | $ 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>' | |
813 | a |
|
815 | a | |
814 | overwriting a expanding keywords |
|
816 | overwriting a expanding keywords | |
815 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 |
|
817 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 | |
816 | $ hg export -o ../rejecttest.diff tip |
|
818 | $ hg export -o ../rejecttest.diff tip | |
817 | $ cd ../Test |
|
819 | $ cd ../Test | |
818 | $ hg import ../rejecttest.diff |
|
820 | $ hg import ../rejecttest.diff | |
819 | applying ../rejecttest.diff |
|
821 | applying ../rejecttest.diff | |
820 | $ cat a b |
|
822 | $ cat a b | |
821 | 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 | |
822 | do not process $Id: rejecttest |
|
824 | do not process $Id: rejecttest | |
823 | xxx $ |
|
825 | xxx $ | |
824 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
826 | $Xinfo: User Name <user@example.com>: rejects? $ | |
825 | ignore $Id$ |
|
827 | ignore $Id$ | |
826 |
|
828 | |||
827 | $ hg rollback |
|
829 | $ hg rollback | |
828 | repository tip rolled back to revision 2 (undo import) |
|
830 | repository tip rolled back to revision 2 (undo import) | |
829 | working directory now based on revision 2 |
|
831 | working directory now based on revision 2 | |
830 | $ hg update --clean |
|
832 | $ hg update --clean | |
831 | 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 | |
832 |
|
834 | |||
833 | kwexpand/kwshrink on selected files |
|
835 | kwexpand/kwshrink on selected files | |
834 |
|
836 | |||
835 | $ mkdir x |
|
837 | $ mkdir x | |
836 | $ hg copy a x/a |
|
838 | $ hg copy a x/a | |
837 | $ hg --verbose kwshrink a |
|
839 | $ hg --verbose kwshrink a | |
838 | overwriting a shrinking keywords |
|
840 | overwriting a shrinking keywords | |
839 | - sleep required for dirstate.normal() check |
|
841 | - sleep required for dirstate.normal() check | |
840 | $ sleep 1 |
|
842 | $ sleep 1 | |
841 | $ hg status a |
|
843 | $ hg status a | |
842 | $ hg --verbose kwexpand a |
|
844 | $ hg --verbose kwexpand a | |
843 | overwriting a expanding keywords |
|
845 | overwriting a expanding keywords | |
844 | $ hg status a |
|
846 | $ hg status a | |
845 |
|
847 | |||
846 | kwexpand x/a should abort |
|
848 | kwexpand x/a should abort | |
847 |
|
849 | |||
848 | $ hg --verbose kwexpand x/a |
|
850 | $ hg --verbose kwexpand x/a | |
849 | abort: outstanding uncommitted changes |
|
851 | abort: outstanding uncommitted changes | |
850 | [255] |
|
852 | [255] | |
851 | $ cd x |
|
853 | $ cd x | |
852 | $ 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>' | |
853 | x/a |
|
855 | x/a | |
854 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
|
856 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | |
855 | overwriting x/a expanding keywords |
|
857 | overwriting x/a expanding keywords | |
856 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
858 | committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 | |
857 | $ cat a |
|
859 | $ cat a | |
858 | 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 $ | |
859 | do not process $Id: |
|
861 | do not process $Id: | |
860 | xxx $ |
|
862 | xxx $ | |
861 | $Xinfo: User Name <user@example.com>: xa $ |
|
863 | $Xinfo: User Name <user@example.com>: xa $ | |
862 |
|
864 | |||
863 | kwshrink a inside directory x |
|
865 | kwshrink a inside directory x | |
864 |
|
866 | |||
865 | $ hg --verbose kwshrink a |
|
867 | $ hg --verbose kwshrink a | |
866 | overwriting x/a shrinking keywords |
|
868 | overwriting x/a shrinking keywords | |
867 | $ cat a |
|
869 | $ cat a | |
868 | expand $Id$ |
|
870 | expand $Id$ | |
869 | do not process $Id: |
|
871 | do not process $Id: | |
870 | xxx $ |
|
872 | xxx $ | |
871 | $Xinfo$ |
|
873 | $Xinfo$ | |
872 | $ cd .. |
|
874 | $ cd .. | |
873 |
|
875 | |||
874 | kwexpand nonexistent |
|
876 | kwexpand nonexistent | |
875 |
|
877 | |||
876 | $ hg kwexpand nonexistent |
|
878 | $ hg kwexpand nonexistent | |
877 | nonexistent:* (glob) |
|
879 | nonexistent:* (glob) | |
878 |
|
880 | |||
879 |
|
881 | |||
880 | hg serve |
|
882 | hg serve | |
881 | - expand with hgweb file |
|
883 | - expand with hgweb file | |
882 | - no expansion with hgweb annotate/changeset/filediff |
|
884 | - no expansion with hgweb annotate/changeset/filediff | |
883 | - check errors |
|
885 | - check errors | |
884 |
|
886 | |||
885 | $ 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 | |
886 | $ cat hg.pid >> $DAEMON_PIDS |
|
888 | $ cat hg.pid >> $DAEMON_PIDS | |
887 | $ $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' | |
888 | 200 Script output follows |
|
890 | 200 Script output follows | |
889 |
|
891 | |||
890 | 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 $ | |
891 | do not process $Id: |
|
893 | do not process $Id: | |
892 | xxx $ |
|
894 | xxx $ | |
893 | $Xinfo: User Name <user@example.com>: firstline $ |
|
895 | $Xinfo: User Name <user@example.com>: firstline $ | |
894 | $ $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' | |
895 | 200 Script output follows |
|
897 | 200 Script output follows | |
896 |
|
898 | |||
897 |
|
899 | |||
898 | user@1: expand $Id$ |
|
900 | user@1: expand $Id$ | |
899 | user@1: do not process $Id: |
|
901 | user@1: do not process $Id: | |
900 | user@1: xxx $ |
|
902 | user@1: xxx $ | |
901 | user@2: $Xinfo$ |
|
903 | user@2: $Xinfo$ | |
902 |
|
904 | |||
903 |
|
905 | |||
904 |
|
906 | |||
905 |
|
907 | |||
906 | $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw' |
|
908 | $ $TESTDIR/get-with-headers.py localhost:$HGPORT '/rev/tip/?style=raw' | |
907 | 200 Script output follows |
|
909 | 200 Script output follows | |
908 |
|
910 | |||
909 |
|
911 | |||
910 | # HG changeset patch |
|
912 | # HG changeset patch | |
911 | # User User Name <user@example.com> |
|
913 | # User User Name <user@example.com> | |
912 | # Date 3 0 |
|
914 | # Date 3 0 | |
913 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 |
|
915 | # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 | |
914 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
916 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 | |
915 | xa |
|
917 | xa | |
916 |
|
918 | |||
917 | diff -r bb948857c743 -r b4560182a3f9 x/a |
|
919 | diff -r bb948857c743 -r b4560182a3f9 x/a | |
918 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
920 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
919 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 |
|
921 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 | |
920 | @@ -0,0 +1,4 @@ |
|
922 | @@ -0,0 +1,4 @@ | |
921 | +expand $Id$ |
|
923 | +expand $Id$ | |
922 | +do not process $Id: |
|
924 | +do not process $Id: | |
923 | +xxx $ |
|
925 | +xxx $ | |
924 | +$Xinfo$ |
|
926 | +$Xinfo$ | |
925 |
|
927 | |||
926 | $ $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' | |
927 | 200 Script output follows |
|
929 | 200 Script output follows | |
928 |
|
930 | |||
929 |
|
931 | |||
930 | diff -r ef63ca68695b -r bb948857c743 a |
|
932 | diff -r ef63ca68695b -r bb948857c743 a | |
931 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
933 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
932 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
934 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 | |
933 | @@ -1,3 +1,4 @@ |
|
935 | @@ -1,3 +1,4 @@ | |
934 | expand $Id$ |
|
936 | expand $Id$ | |
935 | do not process $Id: |
|
937 | do not process $Id: | |
936 | xxx $ |
|
938 | xxx $ | |
937 | +$Xinfo$ |
|
939 | +$Xinfo$ | |
938 |
|
940 | |||
939 |
|
941 | |||
940 |
|
942 | |||
941 |
|
943 | |||
942 | $ cat errors.log |
|
944 | $ cat errors.log | |
943 |
|
945 | |||
944 | Prepare merge and resolve tests |
|
946 | Prepare merge and resolve tests | |
945 |
|
947 | |||
946 | $ echo '$Id$' > m |
|
948 | $ echo '$Id$' > m | |
947 | $ hg add m |
|
949 | $ hg add m | |
948 | $ hg commit -m 4kw |
|
950 | $ hg commit -m 4kw | |
949 | $ echo foo >> m |
|
951 | $ echo foo >> m | |
950 | $ hg commit -m 5foo |
|
952 | $ hg commit -m 5foo | |
951 |
|
953 | |||
952 | simplemerge |
|
954 | simplemerge | |
953 |
|
955 | |||
954 | $ hg update 4 |
|
956 | $ hg update 4 | |
955 | 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 | |
956 | $ echo foo >> m |
|
958 | $ echo foo >> m | |
957 | $ hg commit -m 6foo |
|
959 | $ hg commit -m 6foo | |
958 | created new head |
|
960 | created new head | |
959 | $ hg merge |
|
961 | $ hg merge | |
960 | 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 | |
961 | (branch merge, don't forget to commit) |
|
963 | (branch merge, don't forget to commit) | |
962 | $ hg commit -m simplemerge |
|
964 | $ hg commit -m simplemerge | |
963 | $ cat m |
|
965 | $ cat m | |
964 | $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 $ | |
965 | foo |
|
967 | foo | |
966 |
|
968 | |||
967 | conflict: keyword should stay outside conflict zone |
|
969 | conflict: keyword should stay outside conflict zone | |
968 |
|
970 | |||
969 | $ hg update 4 |
|
971 | $ hg update 4 | |
970 | 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 | |
971 | $ echo bar >> m |
|
973 | $ echo bar >> m | |
972 | $ hg commit -m 8bar |
|
974 | $ hg commit -m 8bar | |
973 | created new head |
|
975 | created new head | |
974 | $ hg merge |
|
976 | $ hg merge | |
975 | merging m |
|
977 | merging m | |
976 | warning: conflicts during merge. |
|
978 | warning: conflicts during merge. | |
977 | merging m failed! |
|
979 | merging m failed! | |
978 | 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 | |
979 | 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 | |
980 | [1] |
|
982 | [1] | |
981 | $ cat m |
|
983 | $ cat m | |
982 | $Id$ |
|
984 | $Id$ | |
983 | <<<<<<< local |
|
985 | <<<<<<< local | |
984 | bar |
|
986 | bar | |
985 | ======= |
|
987 | ======= | |
986 | foo |
|
988 | foo | |
987 | >>>>>>> other |
|
989 | >>>>>>> other | |
988 |
|
990 | |||
989 | resolve to local |
|
991 | resolve to local | |
990 |
|
992 | |||
991 | $ HGMERGE=internal:local hg resolve -a |
|
993 | $ HGMERGE=internal:local hg resolve -a | |
992 | $ hg commit -m localresolve |
|
994 | $ hg commit -m localresolve | |
993 | $ cat m |
|
995 | $ cat m | |
994 | $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 $ | |
995 | bar |
|
997 | bar | |
996 |
|
998 | |||
997 | Test restricted mode with transplant -b |
|
999 | Test restricted mode with transplant -b | |
998 |
|
1000 | |||
999 | $ hg update 6 |
|
1001 | $ hg update 6 | |
1000 | 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 | |
1001 | $ hg branch foo |
|
1003 | $ hg branch foo | |
1002 | marked working directory as branch foo |
|
1004 | marked working directory as branch foo | |
1003 | $ mv a a.bak |
|
1005 | $ mv a a.bak | |
1004 | $ echo foobranch > a |
|
1006 | $ echo foobranch > a | |
1005 | $ cat a.bak >> a |
|
1007 | $ cat a.bak >> a | |
1006 | $ rm a.bak |
|
1008 | $ rm a.bak | |
1007 | $ hg commit -m 9foobranch |
|
1009 | $ hg commit -m 9foobranch | |
1008 | $ hg update default |
|
1010 | $ hg update default | |
1009 | 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 | |
1010 | $ hg -y transplant -b foo tip |
|
1012 | $ hg -y transplant -b foo tip | |
1011 | applying 4aa30d025d50 |
|
1013 | applying 4aa30d025d50 | |
1012 | 4aa30d025d50 transplanted to e00abbf63521 |
|
1014 | 4aa30d025d50 transplanted to e00abbf63521 | |
1013 |
|
1015 | |||
1014 | Expansion in changeset but not in file |
|
1016 | Expansion in changeset but not in file | |
1015 |
|
1017 | |||
1016 | $ hg tip -p |
|
1018 | $ hg tip -p | |
1017 | changeset: 11:e00abbf63521 |
|
1019 | changeset: 11:e00abbf63521 | |
1018 | tag: tip |
|
1020 | tag: tip | |
1019 | parent: 9:800511b3a22d |
|
1021 | parent: 9:800511b3a22d | |
1020 | user: test |
|
1022 | user: test | |
1021 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1023 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1022 | summary: 9foobranch |
|
1024 | summary: 9foobranch | |
1023 |
|
1025 | |||
1024 | diff -r 800511b3a22d -r e00abbf63521 a |
|
1026 | diff -r 800511b3a22d -r e00abbf63521 a | |
1025 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
1027 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |
1026 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
1028 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
1027 | @@ -1,3 +1,4 @@ |
|
1029 | @@ -1,3 +1,4 @@ | |
1028 | +foobranch |
|
1030 | +foobranch | |
1029 | expand $Id$ |
|
1031 | expand $Id$ | |
1030 | do not process $Id: |
|
1032 | do not process $Id: | |
1031 | xxx $ |
|
1033 | xxx $ | |
1032 |
|
1034 | |||
1033 | $ head -n 2 a |
|
1035 | $ head -n 2 a | |
1034 | foobranch |
|
1036 | foobranch | |
1035 | 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 $ | |
1036 |
|
1038 | |||
1037 | Turn off expansion |
|
1039 | Turn off expansion | |
1038 |
|
1040 | |||
1039 | $ hg -q rollback |
|
1041 | $ hg -q rollback | |
1040 | $ hg -q update -C |
|
1042 | $ hg -q update -C | |
1041 |
|
1043 | |||
1042 | kwshrink with unknown file u |
|
1044 | kwshrink with unknown file u | |
1043 |
|
1045 | |||
1044 | $ cp a u |
|
1046 | $ cp a u | |
1045 | $ hg --verbose kwshrink |
|
1047 | $ hg --verbose kwshrink | |
1046 | overwriting a shrinking keywords |
|
1048 | overwriting a shrinking keywords | |
1047 | overwriting m shrinking keywords |
|
1049 | overwriting m shrinking keywords | |
1048 | overwriting x/a shrinking keywords |
|
1050 | overwriting x/a shrinking keywords | |
1049 |
|
1051 | |||
1050 | Keywords shrunk in working directory, but not yet disabled |
|
1052 | Keywords shrunk in working directory, but not yet disabled | |
1051 | - cat shows unexpanded keywords |
|
1053 | - cat shows unexpanded keywords | |
1052 | - hg cat shows expanded keywords |
|
1054 | - hg cat shows expanded keywords | |
1053 |
|
1055 | |||
1054 | $ cat a b |
|
1056 | $ cat a b | |
1055 | expand $Id$ |
|
1057 | expand $Id$ | |
1056 | do not process $Id: |
|
1058 | do not process $Id: | |
1057 | xxx $ |
|
1059 | xxx $ | |
1058 | $Xinfo$ |
|
1060 | $Xinfo$ | |
1059 | ignore $Id$ |
|
1061 | ignore $Id$ | |
1060 | $ hg cat sym a b && echo |
|
1062 | $ hg cat sym a b && echo | |
1061 | 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 $ | |
1062 | do not process $Id: |
|
1064 | do not process $Id: | |
1063 | xxx $ |
|
1065 | xxx $ | |
1064 | $Xinfo: User Name <user@example.com>: firstline $ |
|
1066 | $Xinfo: User Name <user@example.com>: firstline $ | |
1065 | ignore $Id$ |
|
1067 | ignore $Id$ | |
1066 | a |
|
1068 | a | |
1067 |
|
1069 | |||
1068 | Now disable keyword expansion |
|
1070 | Now disable keyword expansion | |
1069 |
|
1071 | |||
1070 | $ rm "$HGRCPATH" |
|
1072 | $ rm "$HGRCPATH" | |
1071 | $ cat a b |
|
1073 | $ cat a b | |
1072 | expand $Id$ |
|
1074 | expand $Id$ | |
1073 | do not process $Id: |
|
1075 | do not process $Id: | |
1074 | xxx $ |
|
1076 | xxx $ | |
1075 | $Xinfo$ |
|
1077 | $Xinfo$ | |
1076 | ignore $Id$ |
|
1078 | ignore $Id$ | |
1077 | $ hg cat sym a b && echo |
|
1079 | $ hg cat sym a b && echo | |
1078 | expand $Id$ |
|
1080 | expand $Id$ | |
1079 | do not process $Id: |
|
1081 | do not process $Id: | |
1080 | xxx $ |
|
1082 | xxx $ | |
1081 | $Xinfo$ |
|
1083 | $Xinfo$ | |
1082 | ignore $Id$ |
|
1084 | ignore $Id$ | |
1083 | a |
|
1085 | a |
@@ -1,842 +1,844 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
4 | > [extensions] | |
3 | > largefiles= |
|
5 | > largefiles= | |
4 | > purge= |
|
6 | > purge= | |
5 | > rebase= |
|
7 | > rebase= | |
6 | > transplant= |
|
8 | > transplant= | |
7 | > [largefiles] |
|
9 | > [largefiles] | |
8 | > minsize=2 |
|
10 | > minsize=2 | |
9 | > patterns=glob:**.dat |
|
11 | > patterns=glob:**.dat | |
10 | > EOF |
|
12 | > EOF | |
11 |
|
13 | |||
12 | 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 | |
13 | files, testing that status correctly shows largefiles. |
|
15 | files, testing that status correctly shows largefiles. | |
14 |
|
16 | |||
15 | $ hg init a |
|
17 | $ hg init a | |
16 | $ cd a |
|
18 | $ cd a | |
17 | $ mkdir sub |
|
19 | $ mkdir sub | |
18 | $ echo normal1 > normal1 |
|
20 | $ echo normal1 > normal1 | |
19 | $ echo normal2 > sub/normal2 |
|
21 | $ echo normal2 > sub/normal2 | |
20 | $ echo large1 > large1 |
|
22 | $ echo large1 > large1 | |
21 | $ echo large2 > sub/large2 |
|
23 | $ echo large2 > sub/large2 | |
22 | $ hg add normal1 sub/normal2 |
|
24 | $ hg add normal1 sub/normal2 | |
23 | $ hg add --large large1 sub/large2 |
|
25 | $ hg add --large large1 sub/large2 | |
24 | $ hg commit -m "add files" |
|
26 | $ hg commit -m "add files" | |
25 | $ echo normal11 > normal1 |
|
27 | $ echo normal11 > normal1 | |
26 | $ echo normal22 > sub/normal2 |
|
28 | $ echo normal22 > sub/normal2 | |
27 | $ echo large11 > large1 |
|
29 | $ echo large11 > large1 | |
28 | $ echo large22 > sub/large2 |
|
30 | $ echo large22 > sub/large2 | |
29 | $ hg st |
|
31 | $ hg st | |
30 | M large1 |
|
32 | M large1 | |
31 | M normal1 |
|
33 | M normal1 | |
32 | M sub/large2 |
|
34 | M sub/large2 | |
33 | M sub/normal2 |
|
35 | M sub/normal2 | |
34 | $ hg commit -m "edit files" |
|
36 | $ hg commit -m "edit files" | |
35 |
|
37 | |||
36 | Commit preserved largefile contents. |
|
38 | Commit preserved largefile contents. | |
37 |
|
39 | |||
38 | $ cat normal1 |
|
40 | $ cat normal1 | |
39 | normal11 |
|
41 | normal11 | |
40 | $ cat large1 |
|
42 | $ cat large1 | |
41 | large11 |
|
43 | large11 | |
42 | $ cat sub/normal2 |
|
44 | $ cat sub/normal2 | |
43 | normal22 |
|
45 | normal22 | |
44 | $ cat sub/large2 |
|
46 | $ cat sub/large2 | |
45 | large22 |
|
47 | large22 | |
46 |
|
48 | |||
47 | Remove both largefiles and normal files. |
|
49 | Remove both largefiles and normal files. | |
48 |
|
50 | |||
49 | $ hg remove normal1 large1 |
|
51 | $ hg remove normal1 large1 | |
50 | $ hg commit -m "remove files" |
|
52 | $ hg commit -m "remove files" | |
51 | $ ls |
|
53 | $ ls | |
52 | sub |
|
54 | sub | |
53 |
|
55 | |||
54 | Copy both largefiles and normal files. |
|
56 | Copy both largefiles and normal files. | |
55 |
|
57 | |||
56 | $ hg cp sub/normal2 normal1 |
|
58 | $ hg cp sub/normal2 normal1 | |
57 | $ hg cp sub/large2 large1 |
|
59 | $ hg cp sub/large2 large1 | |
58 | $ hg commit -m "copy files" |
|
60 | $ hg commit -m "copy files" | |
59 | $ cat normal1 |
|
61 | $ cat normal1 | |
60 | normal22 |
|
62 | normal22 | |
61 | $ cat large1 |
|
63 | $ cat large1 | |
62 | large22 |
|
64 | large22 | |
63 |
|
65 | |||
64 | Test moving largefiles and verify that normal files are also unaffected. |
|
66 | Test moving largefiles and verify that normal files are also unaffected. | |
65 |
|
67 | |||
66 | $ hg mv normal1 normal3 |
|
68 | $ hg mv normal1 normal3 | |
67 | $ hg mv large1 large3 |
|
69 | $ hg mv large1 large3 | |
68 | $ hg mv sub/normal2 sub/normal4 |
|
70 | $ hg mv sub/normal2 sub/normal4 | |
69 | $ hg mv sub/large2 sub/large4 |
|
71 | $ hg mv sub/large2 sub/large4 | |
70 | $ hg commit -m "move files" |
|
72 | $ hg commit -m "move files" | |
71 | $ cat normal3 |
|
73 | $ cat normal3 | |
72 | normal22 |
|
74 | normal22 | |
73 | $ cat large3 |
|
75 | $ cat large3 | |
74 | large22 |
|
76 | large22 | |
75 | $ cat sub/normal4 |
|
77 | $ cat sub/normal4 | |
76 | normal22 |
|
78 | normal22 | |
77 | $ cat sub/large4 |
|
79 | $ cat sub/large4 | |
78 | large22 |
|
80 | large22 | |
79 |
|
81 | |||
80 | Test archiving the various revisions. These hit corner cases known with |
|
82 | Test archiving the various revisions. These hit corner cases known with | |
81 | archiving. |
|
83 | archiving. | |
82 |
|
84 | |||
83 | $ hg archive -r 0 ../archive0 |
|
85 | $ hg archive -r 0 ../archive0 | |
84 | $ hg archive -r 1 ../archive1 |
|
86 | $ hg archive -r 1 ../archive1 | |
85 | $ hg archive -r 2 ../archive2 |
|
87 | $ hg archive -r 2 ../archive2 | |
86 | $ hg archive -r 3 ../archive3 |
|
88 | $ hg archive -r 3 ../archive3 | |
87 | $ hg archive -r 4 ../archive4 |
|
89 | $ hg archive -r 4 ../archive4 | |
88 | $ cd ../archive0 |
|
90 | $ cd ../archive0 | |
89 | $ cat normal1 |
|
91 | $ cat normal1 | |
90 | normal1 |
|
92 | normal1 | |
91 | $ cat large1 |
|
93 | $ cat large1 | |
92 | large1 |
|
94 | large1 | |
93 | $ cat sub/normal2 |
|
95 | $ cat sub/normal2 | |
94 | normal2 |
|
96 | normal2 | |
95 | $ cat sub/large2 |
|
97 | $ cat sub/large2 | |
96 | large2 |
|
98 | large2 | |
97 | $ cd ../archive1 |
|
99 | $ cd ../archive1 | |
98 | $ cat normal1 |
|
100 | $ cat normal1 | |
99 | normal11 |
|
101 | normal11 | |
100 | $ cat large1 |
|
102 | $ cat large1 | |
101 | large11 |
|
103 | large11 | |
102 | $ cat sub/normal2 |
|
104 | $ cat sub/normal2 | |
103 | normal22 |
|
105 | normal22 | |
104 | $ cat sub/large2 |
|
106 | $ cat sub/large2 | |
105 | large22 |
|
107 | large22 | |
106 | $ cd ../archive2 |
|
108 | $ cd ../archive2 | |
107 | $ ls |
|
109 | $ ls | |
108 | sub |
|
110 | sub | |
109 | $ cat sub/normal2 |
|
111 | $ cat sub/normal2 | |
110 | normal22 |
|
112 | normal22 | |
111 | $ cat sub/large2 |
|
113 | $ cat sub/large2 | |
112 | large22 |
|
114 | large22 | |
113 | $ cd ../archive3 |
|
115 | $ cd ../archive3 | |
114 | $ cat normal1 |
|
116 | $ cat normal1 | |
115 | normal22 |
|
117 | normal22 | |
116 | $ cat large1 |
|
118 | $ cat large1 | |
117 | large22 |
|
119 | large22 | |
118 | $ cat sub/normal2 |
|
120 | $ cat sub/normal2 | |
119 | normal22 |
|
121 | normal22 | |
120 | $ cat sub/large2 |
|
122 | $ cat sub/large2 | |
121 | large22 |
|
123 | large22 | |
122 | $ cd ../archive4 |
|
124 | $ cd ../archive4 | |
123 | $ cat normal3 |
|
125 | $ cat normal3 | |
124 | normal22 |
|
126 | normal22 | |
125 | $ cat large3 |
|
127 | $ cat large3 | |
126 | large22 |
|
128 | large22 | |
127 | $ cat sub/normal4 |
|
129 | $ cat sub/normal4 | |
128 | normal22 |
|
130 | normal22 | |
129 | $ cat sub/large4 |
|
131 | $ cat sub/large4 | |
130 | large22 |
|
132 | large22 | |
131 |
|
133 | |||
132 | Commit corner case: specify files to commit. |
|
134 | Commit corner case: specify files to commit. | |
133 |
|
135 | |||
134 | $ cd ../a |
|
136 | $ cd ../a | |
135 | $ echo normal3 > normal3 |
|
137 | $ echo normal3 > normal3 | |
136 | $ echo large3 > large3 |
|
138 | $ echo large3 > large3 | |
137 | $ echo normal4 > sub/normal4 |
|
139 | $ echo normal4 > sub/normal4 | |
138 | $ echo large4 > sub/large4 |
|
140 | $ echo large4 > sub/large4 | |
139 | $ 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" | |
140 | $ cat normal3 |
|
142 | $ cat normal3 | |
141 | normal3 |
|
143 | normal3 | |
142 | $ cat large3 |
|
144 | $ cat large3 | |
143 | large3 |
|
145 | large3 | |
144 | $ cat sub/normal4 |
|
146 | $ cat sub/normal4 | |
145 | normal4 |
|
147 | normal4 | |
146 | $ cat sub/large4 |
|
148 | $ cat sub/large4 | |
147 | large4 |
|
149 | large4 | |
148 |
|
150 | |||
149 | One more commit corner case: commit from a subdirectory. |
|
151 | One more commit corner case: commit from a subdirectory. | |
150 |
|
152 | |||
151 | $ cd ../a |
|
153 | $ cd ../a | |
152 | $ echo normal33 > normal3 |
|
154 | $ echo normal33 > normal3 | |
153 | $ echo large33 > large3 |
|
155 | $ echo large33 > large3 | |
154 | $ echo normal44 > sub/normal4 |
|
156 | $ echo normal44 > sub/normal4 | |
155 | $ echo large44 > sub/large4 |
|
157 | $ echo large44 > sub/large4 | |
156 | $ cd sub |
|
158 | $ cd sub | |
157 | $ hg commit -m "edit files yet again" |
|
159 | $ hg commit -m "edit files yet again" | |
158 | $ cat ../normal3 |
|
160 | $ cat ../normal3 | |
159 | normal33 |
|
161 | normal33 | |
160 | $ cat ../large3 |
|
162 | $ cat ../large3 | |
161 | large33 |
|
163 | large33 | |
162 | $ cat normal4 |
|
164 | $ cat normal4 | |
163 | normal44 |
|
165 | normal44 | |
164 | $ cat large4 |
|
166 | $ cat large4 | |
165 | large44 |
|
167 | large44 | |
166 |
|
168 | |||
167 | Committing standins is not allowed. |
|
169 | Committing standins is not allowed. | |
168 |
|
170 | |||
169 | $ cd .. |
|
171 | $ cd .. | |
170 | $ echo large3 > large3 |
|
172 | $ echo large3 > large3 | |
171 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
173 | $ hg commit .hglf/large3 -m "try to commit standin" | |
172 | abort: file ".hglf/large3" is a largefile standin |
|
174 | abort: file ".hglf/large3" is a largefile standin | |
173 | (commit the largefile itself instead) |
|
175 | (commit the largefile itself instead) | |
174 | [255] |
|
176 | [255] | |
175 |
|
177 | |||
176 | Corner cases for adding largefiles. |
|
178 | Corner cases for adding largefiles. | |
177 |
|
179 | |||
178 | $ echo large5 > large5 |
|
180 | $ echo large5 > large5 | |
179 | $ hg add --large large5 |
|
181 | $ hg add --large large5 | |
180 | $ hg add --large large5 |
|
182 | $ hg add --large large5 | |
181 | large5 already a largefile |
|
183 | large5 already a largefile | |
182 | $ mkdir sub2 |
|
184 | $ mkdir sub2 | |
183 | $ echo large6 > sub2/large6 |
|
185 | $ echo large6 > sub2/large6 | |
184 | $ echo large7 > sub2/large7 |
|
186 | $ echo large7 > sub2/large7 | |
185 | $ hg add --large sub2 |
|
187 | $ hg add --large sub2 | |
186 | adding sub2/large6 as a largefile |
|
188 | adding sub2/large6 as a largefile | |
187 | adding sub2/large7 as a largefile |
|
189 | adding sub2/large7 as a largefile | |
188 | $ hg st |
|
190 | $ hg st | |
189 | M large3 |
|
191 | M large3 | |
190 | A large5 |
|
192 | A large5 | |
191 | A sub2/large6 |
|
193 | A sub2/large6 | |
192 | A sub2/large7 |
|
194 | A sub2/large7 | |
193 |
|
195 | |||
194 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
196 | Config settings (pattern **.dat, minsize 2 MB) are respected. | |
195 |
|
197 | |||
196 | $ echo testdata > test.dat |
|
198 | $ echo testdata > test.dat | |
197 | $ 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 | |
198 | $ hg add |
|
200 | $ hg add | |
199 | adding reallylarge as a largefile |
|
201 | adding reallylarge as a largefile | |
200 | adding test.dat as a largefile |
|
202 | adding test.dat as a largefile | |
201 |
|
203 | |||
202 | Test that minsize and --lfsize handle float values; |
|
204 | Test that minsize and --lfsize handle float values; | |
203 | also tests that --lfsize overrides largefiles.minsize. |
|
205 | also tests that --lfsize overrides largefiles.minsize. | |
204 | (0.250 MB = 256 kB = 262144 B) |
|
206 | (0.250 MB = 256 kB = 262144 B) | |
205 |
|
207 | |||
206 | $ 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 | |
207 | $ 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 | |
208 | $ hg --config largefiles.minsize=.25 add |
|
210 | $ hg --config largefiles.minsize=.25 add | |
209 | adding ratherlarge as a largefile |
|
211 | adding ratherlarge as a largefile | |
210 | adding medium |
|
212 | adding medium | |
211 | $ hg forget medium |
|
213 | $ hg forget medium | |
212 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
214 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
213 | adding medium as a largefile |
|
215 | adding medium as a largefile | |
214 | $ 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 | |
215 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
217 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
216 | adding notlarge |
|
218 | adding notlarge | |
217 | $ hg forget notlarge |
|
219 | $ hg forget notlarge | |
218 |
|
220 | |||
219 | Test forget on largefiles. |
|
221 | Test forget on largefiles. | |
220 |
|
222 | |||
221 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
223 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium | |
222 | $ hg st |
|
224 | $ hg st | |
223 | A sub2/large6 |
|
225 | A sub2/large6 | |
224 | A sub2/large7 |
|
226 | A sub2/large7 | |
225 | R large3 |
|
227 | R large3 | |
226 | ? large5 |
|
228 | ? large5 | |
227 | ? medium |
|
229 | ? medium | |
228 | ? notlarge |
|
230 | ? notlarge | |
229 | ? ratherlarge |
|
231 | ? ratherlarge | |
230 | ? reallylarge |
|
232 | ? reallylarge | |
231 | ? test.dat |
|
233 | ? test.dat | |
232 | $ hg commit -m "add/edit more largefiles" |
|
234 | $ hg commit -m "add/edit more largefiles" | |
233 | $ hg st |
|
235 | $ hg st | |
234 | ? large3 |
|
236 | ? large3 | |
235 | ? large5 |
|
237 | ? large5 | |
236 | ? medium |
|
238 | ? medium | |
237 | ? notlarge |
|
239 | ? notlarge | |
238 | ? ratherlarge |
|
240 | ? ratherlarge | |
239 | ? reallylarge |
|
241 | ? reallylarge | |
240 | ? test.dat |
|
242 | ? test.dat | |
241 |
|
243 | |||
242 | Purge with largefiles: verify that largefiles are still in the working |
|
244 | Purge with largefiles: verify that largefiles are still in the working | |
243 | dir after a purge. |
|
245 | dir after a purge. | |
244 |
|
246 | |||
245 | $ hg purge --all |
|
247 | $ hg purge --all | |
246 | $ cat sub/large4 |
|
248 | $ cat sub/large4 | |
247 | large44 |
|
249 | large44 | |
248 | $ cat sub2/large6 |
|
250 | $ cat sub2/large6 | |
249 | large6 |
|
251 | large6 | |
250 | $ cat sub2/large7 |
|
252 | $ cat sub2/large7 | |
251 | large7 |
|
253 | large7 | |
252 |
|
254 | |||
253 | Clone a largefiles repo. |
|
255 | Clone a largefiles repo. | |
254 |
|
256 | |||
255 | $ cd .. |
|
257 | $ cd .. | |
256 | $ hg clone a b |
|
258 | $ hg clone a b | |
257 | updating to branch default |
|
259 | updating to branch default | |
258 | 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 | |
259 | getting changed largefiles |
|
261 | getting changed largefiles | |
260 | 3 largefiles updated, 0 removed |
|
262 | 3 largefiles updated, 0 removed | |
261 | $ cd b |
|
263 | $ cd b | |
262 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
264 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
263 | 7:daea875e9014 add/edit more largefiles |
|
265 | 7:daea875e9014 add/edit more largefiles | |
264 | 6:4355d653f84f edit files yet again |
|
266 | 6:4355d653f84f edit files yet again | |
265 | 5:9d5af5072dbd edit files again |
|
267 | 5:9d5af5072dbd edit files again | |
266 | 4:74c02385b94c move files |
|
268 | 4:74c02385b94c move files | |
267 | 3:9e8fbc4bce62 copy files |
|
269 | 3:9e8fbc4bce62 copy files | |
268 | 2:51a0ae4d5864 remove files |
|
270 | 2:51a0ae4d5864 remove files | |
269 | 1:ce8896473775 edit files |
|
271 | 1:ce8896473775 edit files | |
270 | 0:30d30fe6a5be add files |
|
272 | 0:30d30fe6a5be add files | |
271 | $ cat normal3 |
|
273 | $ cat normal3 | |
272 | normal33 |
|
274 | normal33 | |
273 | $ cat sub/normal4 |
|
275 | $ cat sub/normal4 | |
274 | normal44 |
|
276 | normal44 | |
275 | $ cat sub/large4 |
|
277 | $ cat sub/large4 | |
276 | large44 |
|
278 | large44 | |
277 | $ cat sub2/large6 |
|
279 | $ cat sub2/large6 | |
278 | large6 |
|
280 | large6 | |
279 | $ cat sub2/large7 |
|
281 | $ cat sub2/large7 | |
280 | large7 |
|
282 | large7 | |
281 | $ cd .. |
|
283 | $ cd .. | |
282 | $ hg clone a -r 3 c |
|
284 | $ hg clone a -r 3 c | |
283 | adding changesets |
|
285 | adding changesets | |
284 | adding manifests |
|
286 | adding manifests | |
285 | adding file changes |
|
287 | adding file changes | |
286 | added 4 changesets with 10 changes to 4 files |
|
288 | added 4 changesets with 10 changes to 4 files | |
287 | updating to branch default |
|
289 | updating to branch default | |
288 | 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 | |
289 | getting changed largefiles |
|
291 | getting changed largefiles | |
290 | 2 largefiles updated, 0 removed |
|
292 | 2 largefiles updated, 0 removed | |
291 | $ cd c |
|
293 | $ cd c | |
292 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
294 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
293 | 3:9e8fbc4bce62 copy files |
|
295 | 3:9e8fbc4bce62 copy files | |
294 | 2:51a0ae4d5864 remove files |
|
296 | 2:51a0ae4d5864 remove files | |
295 | 1:ce8896473775 edit files |
|
297 | 1:ce8896473775 edit files | |
296 | 0:30d30fe6a5be add files |
|
298 | 0:30d30fe6a5be add files | |
297 | $ cat normal1 |
|
299 | $ cat normal1 | |
298 | normal22 |
|
300 | normal22 | |
299 | $ cat large1 |
|
301 | $ cat large1 | |
300 | large22 |
|
302 | large22 | |
301 | $ cat sub/normal2 |
|
303 | $ cat sub/normal2 | |
302 | normal22 |
|
304 | normal22 | |
303 | $ cat sub/large2 |
|
305 | $ cat sub/large2 | |
304 | large22 |
|
306 | large22 | |
305 |
|
307 | |||
306 | Old revisions of a clone have correct largefiles content (this also |
|
308 | Old revisions of a clone have correct largefiles content (this also | |
307 | tests update). |
|
309 | tests update). | |
308 |
|
310 | |||
309 | $ hg update -r 1 |
|
311 | $ hg update -r 1 | |
310 | 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 | |
311 | getting changed largefiles |
|
313 | getting changed largefiles | |
312 | 1 largefiles updated, 0 removed |
|
314 | 1 largefiles updated, 0 removed | |
313 | $ cat large1 |
|
315 | $ cat large1 | |
314 | large11 |
|
316 | large11 | |
315 | $ cat sub/large2 |
|
317 | $ cat sub/large2 | |
316 | large22 |
|
318 | large22 | |
317 |
|
319 | |||
318 | Rebasing between two repositories does not revert largefiles to old |
|
320 | Rebasing between two repositories does not revert largefiles to old | |
319 | 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). | |
320 |
|
322 | |||
321 | $ cd .. |
|
323 | $ cd .. | |
322 | $ hg clone a d |
|
324 | $ hg clone a d | |
323 | updating to branch default |
|
325 | updating to branch default | |
324 | 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 | |
325 | getting changed largefiles |
|
327 | getting changed largefiles | |
326 | 3 largefiles updated, 0 removed |
|
328 | 3 largefiles updated, 0 removed | |
327 | $ cd b |
|
329 | $ cd b | |
328 | $ echo large4-modified > sub/large4 |
|
330 | $ echo large4-modified > sub/large4 | |
329 | $ echo normal3-modified > normal3 |
|
331 | $ echo normal3-modified > normal3 | |
330 | $ hg commit -m "modify normal file and largefile in repo b" |
|
332 | $ hg commit -m "modify normal file and largefile in repo b" | |
331 | $ cd ../d |
|
333 | $ cd ../d | |
332 | $ echo large6-modified > sub2/large6 |
|
334 | $ echo large6-modified > sub2/large6 | |
333 | $ echo normal4-modified > sub/normal4 |
|
335 | $ echo normal4-modified > sub/normal4 | |
334 | $ hg commit -m "modify normal file largefile in repo d" |
|
336 | $ hg commit -m "modify normal file largefile in repo d" | |
335 | $ cd .. |
|
337 | $ cd .. | |
336 | $ hg clone d e |
|
338 | $ hg clone d e | |
337 | updating to branch default |
|
339 | updating to branch default | |
338 | 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 | |
339 | getting changed largefiles |
|
341 | getting changed largefiles | |
340 | 3 largefiles updated, 0 removed |
|
342 | 3 largefiles updated, 0 removed | |
341 | $ cd d |
|
343 | $ cd d | |
342 | $ hg pull --rebase ../b |
|
344 | $ hg pull --rebase ../b | |
343 | pulling from ../b |
|
345 | pulling from ../b | |
344 | searching for changes |
|
346 | searching for changes | |
345 | adding changesets |
|
347 | adding changesets | |
346 | adding manifests |
|
348 | adding manifests | |
347 | adding file changes |
|
349 | adding file changes | |
348 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
350 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
349 | getting changed largefiles |
|
351 | getting changed largefiles | |
350 | 1 largefiles updated, 0 removed |
|
352 | 1 largefiles updated, 0 removed | |
351 | 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 | |
352 | nothing to rebase |
|
354 | nothing to rebase | |
353 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
355 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
354 | 9:598410d3eb9a modify normal file largefile in repo d |
|
356 | 9:598410d3eb9a modify normal file largefile in repo d | |
355 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
357 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
356 | 7:daea875e9014 add/edit more largefiles |
|
358 | 7:daea875e9014 add/edit more largefiles | |
357 | 6:4355d653f84f edit files yet again |
|
359 | 6:4355d653f84f edit files yet again | |
358 | 5:9d5af5072dbd edit files again |
|
360 | 5:9d5af5072dbd edit files again | |
359 | 4:74c02385b94c move files |
|
361 | 4:74c02385b94c move files | |
360 | 3:9e8fbc4bce62 copy files |
|
362 | 3:9e8fbc4bce62 copy files | |
361 | 2:51a0ae4d5864 remove files |
|
363 | 2:51a0ae4d5864 remove files | |
362 | 1:ce8896473775 edit files |
|
364 | 1:ce8896473775 edit files | |
363 | 0:30d30fe6a5be add files |
|
365 | 0:30d30fe6a5be add files | |
364 | $ cat normal3 |
|
366 | $ cat normal3 | |
365 | normal3-modified |
|
367 | normal3-modified | |
366 | $ cat sub/normal4 |
|
368 | $ cat sub/normal4 | |
367 | normal4-modified |
|
369 | normal4-modified | |
368 | $ cat sub/large4 |
|
370 | $ cat sub/large4 | |
369 | large4-modified |
|
371 | large4-modified | |
370 | $ cat sub2/large6 |
|
372 | $ cat sub2/large6 | |
371 | large6-modified |
|
373 | large6-modified | |
372 | $ cat sub2/large7 |
|
374 | $ cat sub2/large7 | |
373 | large7 |
|
375 | large7 | |
374 | $ cd ../e |
|
376 | $ cd ../e | |
375 | $ hg pull ../b |
|
377 | $ hg pull ../b | |
376 | pulling from ../b |
|
378 | pulling from ../b | |
377 | searching for changes |
|
379 | searching for changes | |
378 | adding changesets |
|
380 | adding changesets | |
379 | adding manifests |
|
381 | adding manifests | |
380 | adding file changes |
|
382 | adding file changes | |
381 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
383 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
382 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
384 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
383 | $ hg rebase |
|
385 | $ hg rebase | |
384 | getting changed largefiles |
|
386 | getting changed largefiles | |
385 | 1 largefiles updated, 0 removed |
|
387 | 1 largefiles updated, 0 removed | |
386 | 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 | |
387 | $ hg log |
|
389 | $ hg log | |
388 | changeset: 9:598410d3eb9a |
|
390 | changeset: 9:598410d3eb9a | |
389 | tag: tip |
|
391 | tag: tip | |
390 | user: test |
|
392 | user: test | |
391 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
393 | date: Thu Jan 01 00:00:00 1970 +0000 | |
392 | summary: modify normal file largefile in repo d |
|
394 | summary: modify normal file largefile in repo d | |
393 |
|
395 | |||
394 | changeset: 8:a381d2c8c80e |
|
396 | changeset: 8:a381d2c8c80e | |
395 | user: test |
|
397 | user: test | |
396 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
398 | date: Thu Jan 01 00:00:00 1970 +0000 | |
397 | summary: modify normal file and largefile in repo b |
|
399 | summary: modify normal file and largefile in repo b | |
398 |
|
400 | |||
399 | changeset: 7:daea875e9014 |
|
401 | changeset: 7:daea875e9014 | |
400 | user: test |
|
402 | user: test | |
401 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
403 | date: Thu Jan 01 00:00:00 1970 +0000 | |
402 | summary: add/edit more largefiles |
|
404 | summary: add/edit more largefiles | |
403 |
|
405 | |||
404 | changeset: 6:4355d653f84f |
|
406 | changeset: 6:4355d653f84f | |
405 | user: test |
|
407 | user: test | |
406 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
408 | date: Thu Jan 01 00:00:00 1970 +0000 | |
407 | summary: edit files yet again |
|
409 | summary: edit files yet again | |
408 |
|
410 | |||
409 | changeset: 5:9d5af5072dbd |
|
411 | changeset: 5:9d5af5072dbd | |
410 | user: test |
|
412 | user: test | |
411 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
413 | date: Thu Jan 01 00:00:00 1970 +0000 | |
412 | summary: edit files again |
|
414 | summary: edit files again | |
413 |
|
415 | |||
414 | changeset: 4:74c02385b94c |
|
416 | changeset: 4:74c02385b94c | |
415 | user: test |
|
417 | user: test | |
416 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
418 | date: Thu Jan 01 00:00:00 1970 +0000 | |
417 | summary: move files |
|
419 | summary: move files | |
418 |
|
420 | |||
419 | changeset: 3:9e8fbc4bce62 |
|
421 | changeset: 3:9e8fbc4bce62 | |
420 | user: test |
|
422 | user: test | |
421 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
423 | date: Thu Jan 01 00:00:00 1970 +0000 | |
422 | summary: copy files |
|
424 | summary: copy files | |
423 |
|
425 | |||
424 | changeset: 2:51a0ae4d5864 |
|
426 | changeset: 2:51a0ae4d5864 | |
425 | user: test |
|
427 | user: test | |
426 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
428 | date: Thu Jan 01 00:00:00 1970 +0000 | |
427 | summary: remove files |
|
429 | summary: remove files | |
428 |
|
430 | |||
429 | changeset: 1:ce8896473775 |
|
431 | changeset: 1:ce8896473775 | |
430 | user: test |
|
432 | user: test | |
431 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
433 | date: Thu Jan 01 00:00:00 1970 +0000 | |
432 | summary: edit files |
|
434 | summary: edit files | |
433 |
|
435 | |||
434 | changeset: 0:30d30fe6a5be |
|
436 | changeset: 0:30d30fe6a5be | |
435 | user: test |
|
437 | user: test | |
436 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
438 | date: Thu Jan 01 00:00:00 1970 +0000 | |
437 | summary: add files |
|
439 | summary: add files | |
438 |
|
440 | |||
439 | $ cat normal3 |
|
441 | $ cat normal3 | |
440 | normal3-modified |
|
442 | normal3-modified | |
441 | $ cat sub/normal4 |
|
443 | $ cat sub/normal4 | |
442 | normal4-modified |
|
444 | normal4-modified | |
443 | $ cat sub/large4 |
|
445 | $ cat sub/large4 | |
444 | large4-modified |
|
446 | large4-modified | |
445 | $ cat sub2/large6 |
|
447 | $ cat sub2/large6 | |
446 | large6-modified |
|
448 | large6-modified | |
447 | $ cat sub2/large7 |
|
449 | $ cat sub2/large7 | |
448 | large7 |
|
450 | large7 | |
449 |
|
451 | |||
450 | Rollback on largefiles. |
|
452 | Rollback on largefiles. | |
451 |
|
453 | |||
452 | $ echo large4-modified-again > sub/large4 |
|
454 | $ echo large4-modified-again > sub/large4 | |
453 | $ hg commit -m "Modify large4 again" |
|
455 | $ hg commit -m "Modify large4 again" | |
454 | $ hg rollback |
|
456 | $ hg rollback | |
455 | repository tip rolled back to revision 9 (undo commit) |
|
457 | repository tip rolled back to revision 9 (undo commit) | |
456 | working directory now based on revision 9 |
|
458 | working directory now based on revision 9 | |
457 | $ hg st |
|
459 | $ hg st | |
458 | M sub/large4 |
|
460 | M sub/large4 | |
459 | $ hg log |
|
461 | $ hg log | |
460 | changeset: 9:598410d3eb9a |
|
462 | changeset: 9:598410d3eb9a | |
461 | tag: tip |
|
463 | tag: tip | |
462 | user: test |
|
464 | user: test | |
463 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
465 | date: Thu Jan 01 00:00:00 1970 +0000 | |
464 | summary: modify normal file largefile in repo d |
|
466 | summary: modify normal file largefile in repo d | |
465 |
|
467 | |||
466 | changeset: 8:a381d2c8c80e |
|
468 | changeset: 8:a381d2c8c80e | |
467 | user: test |
|
469 | user: test | |
468 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
470 | date: Thu Jan 01 00:00:00 1970 +0000 | |
469 | summary: modify normal file and largefile in repo b |
|
471 | summary: modify normal file and largefile in repo b | |
470 |
|
472 | |||
471 | changeset: 7:daea875e9014 |
|
473 | changeset: 7:daea875e9014 | |
472 | user: test |
|
474 | user: test | |
473 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
475 | date: Thu Jan 01 00:00:00 1970 +0000 | |
474 | summary: add/edit more largefiles |
|
476 | summary: add/edit more largefiles | |
475 |
|
477 | |||
476 | changeset: 6:4355d653f84f |
|
478 | changeset: 6:4355d653f84f | |
477 | user: test |
|
479 | user: test | |
478 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
480 | date: Thu Jan 01 00:00:00 1970 +0000 | |
479 | summary: edit files yet again |
|
481 | summary: edit files yet again | |
480 |
|
482 | |||
481 | changeset: 5:9d5af5072dbd |
|
483 | changeset: 5:9d5af5072dbd | |
482 | user: test |
|
484 | user: test | |
483 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
485 | date: Thu Jan 01 00:00:00 1970 +0000 | |
484 | summary: edit files again |
|
486 | summary: edit files again | |
485 |
|
487 | |||
486 | changeset: 4:74c02385b94c |
|
488 | changeset: 4:74c02385b94c | |
487 | user: test |
|
489 | user: test | |
488 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
490 | date: Thu Jan 01 00:00:00 1970 +0000 | |
489 | summary: move files |
|
491 | summary: move files | |
490 |
|
492 | |||
491 | changeset: 3:9e8fbc4bce62 |
|
493 | changeset: 3:9e8fbc4bce62 | |
492 | user: test |
|
494 | user: test | |
493 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
495 | date: Thu Jan 01 00:00:00 1970 +0000 | |
494 | summary: copy files |
|
496 | summary: copy files | |
495 |
|
497 | |||
496 | changeset: 2:51a0ae4d5864 |
|
498 | changeset: 2:51a0ae4d5864 | |
497 | user: test |
|
499 | user: test | |
498 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
500 | date: Thu Jan 01 00:00:00 1970 +0000 | |
499 | summary: remove files |
|
501 | summary: remove files | |
500 |
|
502 | |||
501 | changeset: 1:ce8896473775 |
|
503 | changeset: 1:ce8896473775 | |
502 | user: test |
|
504 | user: test | |
503 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
505 | date: Thu Jan 01 00:00:00 1970 +0000 | |
504 | summary: edit files |
|
506 | summary: edit files | |
505 |
|
507 | |||
506 | changeset: 0:30d30fe6a5be |
|
508 | changeset: 0:30d30fe6a5be | |
507 | user: test |
|
509 | user: test | |
508 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
510 | date: Thu Jan 01 00:00:00 1970 +0000 | |
509 | summary: add files |
|
511 | summary: add files | |
510 |
|
512 | |||
511 | $ cat sub/large4 |
|
513 | $ cat sub/large4 | |
512 | large4-modified-again |
|
514 | large4-modified-again | |
513 |
|
515 | |||
514 | "update --check" refuses to update with uncommitted changes. |
|
516 | "update --check" refuses to update with uncommitted changes. | |
515 | $ hg update --check 8 |
|
517 | $ hg update --check 8 | |
516 | abort: uncommitted local changes |
|
518 | abort: uncommitted local changes | |
517 | [255] |
|
519 | [255] | |
518 |
|
520 | |||
519 | "update --clean" leaves correct largefiles in working copy. |
|
521 | "update --clean" leaves correct largefiles in working copy. | |
520 |
|
522 | |||
521 | $ hg update --clean |
|
523 | $ hg update --clean | |
522 | 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 | |
523 | getting changed largefiles |
|
525 | getting changed largefiles | |
524 | 1 largefiles updated, 0 removed |
|
526 | 1 largefiles updated, 0 removed | |
525 | $ cat normal3 |
|
527 | $ cat normal3 | |
526 | normal3-modified |
|
528 | normal3-modified | |
527 | $ cat sub/normal4 |
|
529 | $ cat sub/normal4 | |
528 | normal4-modified |
|
530 | normal4-modified | |
529 | $ cat sub/large4 |
|
531 | $ cat sub/large4 | |
530 | large4-modified |
|
532 | large4-modified | |
531 | $ cat sub2/large6 |
|
533 | $ cat sub2/large6 | |
532 | large6-modified |
|
534 | large6-modified | |
533 | $ cat sub2/large7 |
|
535 | $ cat sub2/large7 | |
534 | large7 |
|
536 | large7 | |
535 |
|
537 | |||
536 | Now "update check" is happy. |
|
538 | Now "update check" is happy. | |
537 | $ hg update --check 8 |
|
539 | $ hg update --check 8 | |
538 | 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 | |
539 | getting changed largefiles |
|
541 | getting changed largefiles | |
540 | 1 largefiles updated, 0 removed |
|
542 | 1 largefiles updated, 0 removed | |
541 | $ hg update --check |
|
543 | $ hg update --check | |
542 | 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 | |
543 | getting changed largefiles |
|
545 | getting changed largefiles | |
544 | 1 largefiles updated, 0 removed |
|
546 | 1 largefiles updated, 0 removed | |
545 |
|
547 | |||
546 | "revert" works on largefiles (and normal files too). |
|
548 | "revert" works on largefiles (and normal files too). | |
547 | $ echo hack3 >> normal3 |
|
549 | $ echo hack3 >> normal3 | |
548 | $ echo hack4 >> sub/normal4 |
|
550 | $ echo hack4 >> sub/normal4 | |
549 | $ echo hack4 >> sub/large4 |
|
551 | $ echo hack4 >> sub/large4 | |
550 | $ hg rm sub2/large6 |
|
552 | $ hg rm sub2/large6 | |
551 | $ echo new >> sub2/large8 |
|
553 | $ echo new >> sub2/large8 | |
552 | $ hg add --large sub2/large8 |
|
554 | $ hg add --large sub2/large8 | |
553 | # 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; | |
554 | # 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. ;-( | |
555 | $ hg revert sub |
|
557 | $ hg revert sub | |
556 | reverting .hglf/sub/large4 |
|
558 | reverting .hglf/sub/large4 | |
557 | reverting sub/normal4 |
|
559 | reverting sub/normal4 | |
558 | $ hg status |
|
560 | $ hg status | |
559 | M normal3 |
|
561 | M normal3 | |
560 | A sub2/large8 |
|
562 | A sub2/large8 | |
561 | R sub2/large6 |
|
563 | R sub2/large6 | |
562 | ? sub/large4.orig |
|
564 | ? sub/large4.orig | |
563 | ? sub/normal4.orig |
|
565 | ? sub/normal4.orig | |
564 | $ cat sub/normal4 |
|
566 | $ cat sub/normal4 | |
565 | normal4-modified |
|
567 | normal4-modified | |
566 | $ cat sub/large4 |
|
568 | $ cat sub/large4 | |
567 | large4-modified |
|
569 | large4-modified | |
568 | $ hg revert -a --no-backup |
|
570 | $ hg revert -a --no-backup | |
569 | undeleting .hglf/sub2/large6 |
|
571 | undeleting .hglf/sub2/large6 | |
570 | forgetting .hglf/sub2/large8 |
|
572 | forgetting .hglf/sub2/large8 | |
571 | reverting normal3 |
|
573 | reverting normal3 | |
572 | $ hg status |
|
574 | $ hg status | |
573 | ? sub/large4.orig |
|
575 | ? sub/large4.orig | |
574 | ? sub/normal4.orig |
|
576 | ? sub/normal4.orig | |
575 | ? sub2/large8 |
|
577 | ? sub2/large8 | |
576 | $ cat normal3 |
|
578 | $ cat normal3 | |
577 | normal3-modified |
|
579 | normal3-modified | |
578 | $ cat sub2/large6 |
|
580 | $ cat sub2/large6 | |
579 | large6-modified |
|
581 | large6-modified | |
580 | $ rm sub/*.orig sub2/large8 |
|
582 | $ rm sub/*.orig sub2/large8 | |
581 |
|
583 | |||
582 | revert some files to an older revision |
|
584 | revert some files to an older revision | |
583 | $ hg revert --no-backup -r 8 sub2 |
|
585 | $ hg revert --no-backup -r 8 sub2 | |
584 | reverting .hglf/sub2/large6 |
|
586 | reverting .hglf/sub2/large6 | |
585 | $ cat sub2/large6 |
|
587 | $ cat sub2/large6 | |
586 | large6 |
|
588 | large6 | |
587 | $ hg revert --no-backup sub2 |
|
589 | $ hg revert --no-backup sub2 | |
588 | reverting .hglf/sub2/large6 |
|
590 | reverting .hglf/sub2/large6 | |
589 | $ hg status |
|
591 | $ hg status | |
590 |
|
592 | |||
591 | "verify --large" actually verifies largefiles |
|
593 | "verify --large" actually verifies largefiles | |
592 |
|
594 | |||
593 | $ hg verify --large |
|
595 | $ hg verify --large | |
594 | checking changesets |
|
596 | checking changesets | |
595 | checking manifests |
|
597 | checking manifests | |
596 | crosschecking files in changesets and manifests |
|
598 | crosschecking files in changesets and manifests | |
597 | checking files |
|
599 | checking files | |
598 | 10 files, 10 changesets, 28 total revisions |
|
600 | 10 files, 10 changesets, 28 total revisions | |
599 | searching 1 changesets for largefiles |
|
601 | searching 1 changesets for largefiles | |
600 | verified existence of 3 revisions of 3 largefiles |
|
602 | verified existence of 3 revisions of 3 largefiles | |
601 |
|
603 | |||
602 | 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 | |
603 | been very problematic). |
|
605 | been very problematic). | |
604 |
|
606 | |||
605 | $ cd .. |
|
607 | $ cd .. | |
606 | $ hg clone -r 7 e f |
|
608 | $ hg clone -r 7 e f | |
607 | adding changesets |
|
609 | adding changesets | |
608 | adding manifests |
|
610 | adding manifests | |
609 | adding file changes |
|
611 | adding file changes | |
610 | added 8 changesets with 24 changes to 10 files |
|
612 | added 8 changesets with 24 changes to 10 files | |
611 | updating to branch default |
|
613 | updating to branch default | |
612 | 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 | |
613 | getting changed largefiles |
|
615 | getting changed largefiles | |
614 | 3 largefiles updated, 0 removed |
|
616 | 3 largefiles updated, 0 removed | |
615 | $ cd f |
|
617 | $ cd f | |
616 | $ echo "large4-merge-test" > sub/large4 |
|
618 | $ echo "large4-merge-test" > sub/large4 | |
617 | $ hg commit -m "Modify large4 to test merge" |
|
619 | $ hg commit -m "Modify large4 to test merge" | |
618 | $ hg pull ../e |
|
620 | $ hg pull ../e | |
619 | pulling from ../e |
|
621 | pulling from ../e | |
620 | searching for changes |
|
622 | searching for changes | |
621 | adding changesets |
|
623 | adding changesets | |
622 | adding manifests |
|
624 | adding manifests | |
623 | adding file changes |
|
625 | adding file changes | |
624 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
626 | added 2 changesets with 4 changes to 4 files (+1 heads) | |
625 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
627 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
626 | $ hg merge |
|
628 | $ hg merge | |
627 | merging sub/large4 |
|
629 | merging sub/large4 | |
628 | largefile sub/large4 has a merge conflict |
|
630 | largefile sub/large4 has a merge conflict | |
629 | keep (l)ocal or take (o)ther? l |
|
631 | keep (l)ocal or take (o)ther? l | |
630 | 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 | |
631 | (branch merge, don't forget to commit) |
|
633 | (branch merge, don't forget to commit) | |
632 | getting changed largefiles |
|
634 | getting changed largefiles | |
633 | 1 largefiles updated, 0 removed |
|
635 | 1 largefiles updated, 0 removed | |
634 | $ hg commit -m "Merge repos e and f" |
|
636 | $ hg commit -m "Merge repos e and f" | |
635 | $ cat normal3 |
|
637 | $ cat normal3 | |
636 | normal3-modified |
|
638 | normal3-modified | |
637 | $ cat sub/normal4 |
|
639 | $ cat sub/normal4 | |
638 | normal4-modified |
|
640 | normal4-modified | |
639 | $ cat sub/large4 |
|
641 | $ cat sub/large4 | |
640 | large4-merge-test |
|
642 | large4-merge-test | |
641 | $ cat sub2/large6 |
|
643 | $ cat sub2/large6 | |
642 | large6-modified |
|
644 | large6-modified | |
643 | $ cat sub2/large7 |
|
645 | $ cat sub2/large7 | |
644 | large7 |
|
646 | large7 | |
645 |
|
647 | |||
646 | 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 | |
647 | coexist. |
|
649 | coexist. | |
648 |
|
650 | |||
649 | $ rm sub2/large7 |
|
651 | $ rm sub2/large7 | |
650 | $ echo "largeasnormal" > sub2/large7 |
|
652 | $ echo "largeasnormal" > sub2/large7 | |
651 | $ hg add sub2/large7 |
|
653 | $ hg add sub2/large7 | |
652 | sub2/large7 already a largefile |
|
654 | sub2/large7 already a largefile | |
653 |
|
655 | |||
654 | Test that transplanting a largefile change works correctly. |
|
656 | Test that transplanting a largefile change works correctly. | |
655 |
|
657 | |||
656 | $ cd .. |
|
658 | $ cd .. | |
657 | $ hg clone -r 8 d g |
|
659 | $ hg clone -r 8 d g | |
658 | adding changesets |
|
660 | adding changesets | |
659 | adding manifests |
|
661 | adding manifests | |
660 | adding file changes |
|
662 | adding file changes | |
661 | added 9 changesets with 26 changes to 10 files |
|
663 | added 9 changesets with 26 changes to 10 files | |
662 | updating to branch default |
|
664 | updating to branch default | |
663 | 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 | |
664 | getting changed largefiles |
|
666 | getting changed largefiles | |
665 | 3 largefiles updated, 0 removed |
|
667 | 3 largefiles updated, 0 removed | |
666 | $ cd g |
|
668 | $ cd g | |
667 | $ hg transplant -s ../d 598410d3eb9a |
|
669 | $ hg transplant -s ../d 598410d3eb9a | |
668 | searching for changes |
|
670 | searching for changes | |
669 | searching for changes |
|
671 | searching for changes | |
670 | adding changesets |
|
672 | adding changesets | |
671 | adding manifests |
|
673 | adding manifests | |
672 | adding file changes |
|
674 | adding file changes | |
673 | added 1 changesets with 2 changes to 2 files |
|
675 | added 1 changesets with 2 changes to 2 files | |
674 | getting changed largefiles |
|
676 | getting changed largefiles | |
675 | 1 largefiles updated, 0 removed |
|
677 | 1 largefiles updated, 0 removed | |
676 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
678 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
677 | 9:598410d3eb9a modify normal file largefile in repo d |
|
679 | 9:598410d3eb9a modify normal file largefile in repo d | |
678 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
680 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
679 | 7:daea875e9014 add/edit more largefiles |
|
681 | 7:daea875e9014 add/edit more largefiles | |
680 | 6:4355d653f84f edit files yet again |
|
682 | 6:4355d653f84f edit files yet again | |
681 | 5:9d5af5072dbd edit files again |
|
683 | 5:9d5af5072dbd edit files again | |
682 | 4:74c02385b94c move files |
|
684 | 4:74c02385b94c move files | |
683 | 3:9e8fbc4bce62 copy files |
|
685 | 3:9e8fbc4bce62 copy files | |
684 | 2:51a0ae4d5864 remove files |
|
686 | 2:51a0ae4d5864 remove files | |
685 | 1:ce8896473775 edit files |
|
687 | 1:ce8896473775 edit files | |
686 | 0:30d30fe6a5be add files |
|
688 | 0:30d30fe6a5be add files | |
687 | $ cat normal3 |
|
689 | $ cat normal3 | |
688 | normal3-modified |
|
690 | normal3-modified | |
689 | $ cat sub/normal4 |
|
691 | $ cat sub/normal4 | |
690 | normal4-modified |
|
692 | normal4-modified | |
691 | $ cat sub/large4 |
|
693 | $ cat sub/large4 | |
692 | large4-modified |
|
694 | large4-modified | |
693 | $ cat sub2/large6 |
|
695 | $ cat sub2/large6 | |
694 | large6-modified |
|
696 | large6-modified | |
695 | $ cat sub2/large7 |
|
697 | $ cat sub2/large7 | |
696 | large7 |
|
698 | large7 | |
697 | $ cd .. |
|
699 | $ cd .. | |
698 |
|
700 | |||
699 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
701 | vanilla clients not locked out from largefiles servers on vanilla repos | |
700 | $ mkdir r1 |
|
702 | $ mkdir r1 | |
701 | $ cd r1 |
|
703 | $ cd r1 | |
702 | $ hg init |
|
704 | $ hg init | |
703 | $ echo c1 > f1 |
|
705 | $ echo c1 > f1 | |
704 | $ hg add f1 |
|
706 | $ hg add f1 | |
705 | $ hg com -m "m1" |
|
707 | $ hg com -m "m1" | |
706 | $ cd .. |
|
708 | $ cd .. | |
707 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
709 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid | |
708 | $ cat hg.pid >> $DAEMON_PIDS |
|
710 | $ cat hg.pid >> $DAEMON_PIDS | |
709 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
711 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 | |
710 | requesting all changes |
|
712 | requesting all changes | |
711 | adding changesets |
|
713 | adding changesets | |
712 | adding manifests |
|
714 | adding manifests | |
713 | adding file changes |
|
715 | adding file changes | |
714 | added 1 changesets with 1 changes to 1 files |
|
716 | added 1 changesets with 1 changes to 1 files | |
715 | updating to branch default |
|
717 | updating to branch default | |
716 | 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 | |
717 |
|
719 | |||
718 | largefiles clients still work with vanilla servers |
|
720 | largefiles clients still work with vanilla servers | |
719 | $ 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 | |
720 | $ cat hg.pid >> $DAEMON_PIDS |
|
722 | $ cat hg.pid >> $DAEMON_PIDS | |
721 | $ hg clone http://localhost:$HGPORT1 r3 |
|
723 | $ hg clone http://localhost:$HGPORT1 r3 | |
722 | requesting all changes |
|
724 | requesting all changes | |
723 | adding changesets |
|
725 | adding changesets | |
724 | adding manifests |
|
726 | adding manifests | |
725 | adding file changes |
|
727 | adding file changes | |
726 | added 1 changesets with 1 changes to 1 files |
|
728 | added 1 changesets with 1 changes to 1 files | |
727 | updating to branch default |
|
729 | updating to branch default | |
728 | 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 | |
729 |
|
731 | |||
730 | vanilla clients locked out from largefiles http repos |
|
732 | vanilla clients locked out from largefiles http repos | |
731 | $ mkdir r4 |
|
733 | $ mkdir r4 | |
732 | $ cd r4 |
|
734 | $ cd r4 | |
733 | $ hg init |
|
735 | $ hg init | |
734 | $ echo c1 > f1 |
|
736 | $ echo c1 > f1 | |
735 | $ hg add --large f1 |
|
737 | $ hg add --large f1 | |
736 | $ hg com -m "m1" |
|
738 | $ hg com -m "m1" | |
737 | $ cd .. |
|
739 | $ cd .. | |
738 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
740 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid | |
739 | $ cat hg.pid >> $DAEMON_PIDS |
|
741 | $ cat hg.pid >> $DAEMON_PIDS | |
740 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
742 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 | |
741 | abort: remote error: |
|
743 | abort: remote error: | |
742 |
|
744 | |||
743 | This repository uses the largefiles extension. |
|
745 | This repository uses the largefiles extension. | |
744 |
|
746 | |||
745 | Please enable it in your Mercurial config file. |
|
747 | Please enable it in your Mercurial config file. | |
746 | [255] |
|
748 | [255] | |
747 |
|
749 | |||
748 | used all HGPORTs, kill all daemons |
|
750 | used all HGPORTs, kill all daemons | |
749 | $ "$TESTDIR/killdaemons.py" |
|
751 | $ "$TESTDIR/killdaemons.py" | |
750 |
|
752 | |||
751 | vanilla clients locked out from largefiles ssh repos |
|
753 | vanilla clients locked out from largefiles ssh repos | |
752 | $ 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 | |
753 | abort: remote error: |
|
755 | abort: remote error: | |
754 |
|
756 | |||
755 | This repository uses the largefiles extension. |
|
757 | This repository uses the largefiles extension. | |
756 |
|
758 | |||
757 | Please enable it in your Mercurial config file. |
|
759 | Please enable it in your Mercurial config file. | |
758 | [255] |
|
760 | [255] | |
759 |
|
761 | |||
760 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
762 | largefiles clients refuse to push largefiles repos to vanilla servers | |
761 | $ mkdir r6 |
|
763 | $ mkdir r6 | |
762 | $ cd r6 |
|
764 | $ cd r6 | |
763 | $ hg init |
|
765 | $ hg init | |
764 | $ echo c1 > f1 |
|
766 | $ echo c1 > f1 | |
765 | $ hg add f1 |
|
767 | $ hg add f1 | |
766 | $ hg com -m "m1" |
|
768 | $ hg com -m "m1" | |
767 | $ cat >> .hg/hgrc <<! |
|
769 | $ cat >> .hg/hgrc <<! | |
768 | > [web] |
|
770 | > [web] | |
769 | > push_ssl = false |
|
771 | > push_ssl = false | |
770 | > allow_push = * |
|
772 | > allow_push = * | |
771 | > ! |
|
773 | > ! | |
772 | $ cd .. |
|
774 | $ cd .. | |
773 | $ hg clone r6 r7 |
|
775 | $ hg clone r6 r7 | |
774 | updating to branch default |
|
776 | updating to branch default | |
775 | 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 | |
776 | $ cd r7 |
|
778 | $ cd r7 | |
777 | $ echo c2 > f2 |
|
779 | $ echo c2 > f2 | |
778 | $ hg add --large f2 |
|
780 | $ hg add --large f2 | |
779 | $ hg com -m "m2" |
|
781 | $ hg com -m "m2" | |
780 | $ 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 | |
781 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
783 | $ cat ../hg.pid >> $DAEMON_PIDS | |
782 | $ hg push http://localhost:$HGPORT |
|
784 | $ hg push http://localhost:$HGPORT | |
783 | pushing to http://localhost:$HGPORT/ |
|
785 | pushing to http://localhost:$HGPORT/ | |
784 | searching for changes |
|
786 | searching for changes | |
785 | 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 | |
786 | [255] |
|
788 | [255] | |
787 | $ cd .. |
|
789 | $ cd .. | |
788 |
|
790 | |||
789 | $ cd .. |
|
791 | $ cd .. | |
790 |
|
792 | |||
791 | Clone a local repository owned by another user |
|
793 | Clone a local repository owned by another user | |
792 | 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 | |
793 | $ ORIGHOME="$HOME" |
|
795 | $ ORIGHOME="$HOME" | |
794 | $ mkdir alice |
|
796 | $ mkdir alice | |
795 | $ HOME="`pwd`/alice" |
|
797 | $ HOME="`pwd`/alice" | |
796 | $ cd alice |
|
798 | $ cd alice | |
797 | $ hg init pubrepo |
|
799 | $ hg init pubrepo | |
798 | $ cd pubrepo |
|
800 | $ cd pubrepo | |
799 | $ 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 | |
800 | $ hg add --large a-large-file |
|
802 | $ hg add --large a-large-file | |
801 | $ hg commit -m "Add a large file" |
|
803 | $ hg commit -m "Add a large file" | |
802 | $ cd .. |
|
804 | $ cd .. | |
803 | $ chmod -R a-w pubrepo |
|
805 | $ chmod -R a-w pubrepo | |
804 | $ cd .. |
|
806 | $ cd .. | |
805 | $ mkdir bob |
|
807 | $ mkdir bob | |
806 | $ HOME="`pwd`/bob" |
|
808 | $ HOME="`pwd`/bob" | |
807 | $ cd bob |
|
809 | $ cd bob | |
808 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
810 | $ hg clone --pull ../alice/pubrepo pubrepo | |
809 | requesting all changes |
|
811 | requesting all changes | |
810 | adding changesets |
|
812 | adding changesets | |
811 | adding manifests |
|
813 | adding manifests | |
812 | adding file changes |
|
814 | adding file changes | |
813 | added 1 changesets with 1 changes to 1 files |
|
815 | added 1 changesets with 1 changes to 1 files | |
814 | updating to branch default |
|
816 | updating to branch default | |
815 | 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 | |
816 | getting changed largefiles |
|
818 | getting changed largefiles | |
817 | 1 largefiles updated, 0 removed |
|
819 | 1 largefiles updated, 0 removed | |
818 | $ cd .. |
|
820 | $ cd .. | |
819 | $ HOME="$ORIGHOME" |
|
821 | $ HOME="$ORIGHOME" | |
820 |
|
822 | |||
821 | 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 | |
822 | $ hg init largesymlink |
|
824 | $ hg init largesymlink | |
823 | $ cd largesymlink |
|
825 | $ cd largesymlink | |
824 | $ 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 | |
825 | $ hg add --large largefile |
|
827 | $ hg add --large largefile | |
826 | $ hg commit -m "commit a large file" |
|
828 | $ hg commit -m "commit a large file" | |
827 | $ ln -s largefile largelink |
|
829 | $ ln -s largefile largelink | |
828 | $ hg add largelink |
|
830 | $ hg add largelink | |
829 | $ hg commit -m "commit a large symlink" |
|
831 | $ hg commit -m "commit a large symlink" | |
830 | $ rm -f largelink |
|
832 | $ rm -f largelink | |
831 | $ hg up >/dev/null |
|
833 | $ hg up >/dev/null | |
832 | $ test -f largelink |
|
834 | $ test -f largelink | |
833 | [1] |
|
835 | [1] | |
834 | $ test -L largelink |
|
836 | $ test -L largelink | |
835 | [1] |
|
837 | [1] | |
836 | $ 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 | |
837 | $ hg up -C >/dev/null |
|
839 | $ hg up -C >/dev/null | |
838 | $ test -f largelink |
|
840 | $ test -f largelink | |
839 | $ test -L largelink |
|
841 | $ test -L largelink | |
840 | $ cd .. |
|
842 | $ cd .. | |
841 |
|
843 | |||
842 |
|
844 |
@@ -1,69 +1,71 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | Source bundle was generated with the following script: |
|
3 | Source bundle was generated with the following script: | |
2 |
|
4 | |||
3 | # hg init |
|
5 | # hg init | |
4 | # echo a > a |
|
6 | # echo a > a | |
5 | # ln -s a l |
|
7 | # ln -s a l | |
6 | # hg ci -Ama -d'0 0' |
|
8 | # hg ci -Ama -d'0 0' | |
7 | # mkdir b |
|
9 | # mkdir b | |
8 | # echo a > b/a |
|
10 | # echo a > b/a | |
9 | # chmod +x b/a |
|
11 | # chmod +x b/a | |
10 | # hg ci -Amb -d'1 0' |
|
12 | # hg ci -Amb -d'1 0' | |
11 |
|
13 | |||
12 | $ hg init |
|
14 | $ hg init | |
13 | $ hg -q pull "$TESTDIR/bundles/test-manifest.hg" |
|
15 | $ hg -q pull "$TESTDIR/bundles/test-manifest.hg" | |
14 |
|
16 | |||
15 | The next call is expected to return nothing: |
|
17 | The next call is expected to return nothing: | |
16 |
|
18 | |||
17 | $ hg manifest |
|
19 | $ hg manifest | |
18 |
|
20 | |||
19 | $ hg co |
|
21 | $ hg co | |
20 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
22 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
21 |
|
23 | |||
22 | $ hg manifest |
|
24 | $ hg manifest | |
23 | a |
|
25 | a | |
24 | b/a |
|
26 | b/a | |
25 | l |
|
27 | l | |
26 |
|
28 | |||
27 | $ hg manifest -v |
|
29 | $ hg manifest -v | |
28 | 644 a |
|
30 | 644 a | |
29 | 755 * b/a |
|
31 | 755 * b/a | |
30 | 644 @ l |
|
32 | 644 @ l | |
31 |
|
33 | |||
32 | $ hg manifest --debug |
|
34 | $ hg manifest --debug | |
33 | b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a |
|
35 | b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a | |
34 | b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a |
|
36 | b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 755 * b/a | |
35 | 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l |
|
37 | 047b75c6d7a3ef6a2243bd0e99f94f6ea6683597 644 @ l | |
36 |
|
38 | |||
37 | $ hg manifest -r 0 |
|
39 | $ hg manifest -r 0 | |
38 | a |
|
40 | a | |
39 | l |
|
41 | l | |
40 |
|
42 | |||
41 | $ hg manifest -r 1 |
|
43 | $ hg manifest -r 1 | |
42 | a |
|
44 | a | |
43 | b/a |
|
45 | b/a | |
44 | l |
|
46 | l | |
45 |
|
47 | |||
46 | $ hg manifest -r tip |
|
48 | $ hg manifest -r tip | |
47 | a |
|
49 | a | |
48 | b/a |
|
50 | b/a | |
49 | l |
|
51 | l | |
50 |
|
52 | |||
51 | $ hg manifest tip |
|
53 | $ hg manifest tip | |
52 | a |
|
54 | a | |
53 | b/a |
|
55 | b/a | |
54 | l |
|
56 | l | |
55 |
|
57 | |||
56 | $ hg manifest --all |
|
58 | $ hg manifest --all | |
57 | a |
|
59 | a | |
58 | b/a |
|
60 | b/a | |
59 | l |
|
61 | l | |
60 |
|
62 | |||
61 | The next two calls are expected to abort: |
|
63 | The next two calls are expected to abort: | |
62 |
|
64 | |||
63 | $ hg manifest -r 2 |
|
65 | $ hg manifest -r 2 | |
64 | abort: unknown revision '2'! |
|
66 | abort: unknown revision '2'! | |
65 | [255] |
|
67 | [255] | |
66 |
|
68 | |||
67 | $ hg manifest -r tip tip |
|
69 | $ hg manifest -r tip tip | |
68 | abort: please specify just one revision |
|
70 | abort: please specify just one revision | |
69 | [255] |
|
71 | [255] |
@@ -1,62 +1,63 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
1 |
|
2 | |||
2 | $ cat > echo.py <<EOF |
|
3 | $ cat > echo.py <<EOF | |
3 | > #!/usr/bin/env python |
|
4 | > #!/usr/bin/env python | |
4 | > import os, sys |
|
5 | > import os, sys | |
5 | > try: |
|
6 | > try: | |
6 | > import msvcrt |
|
7 | > import msvcrt | |
7 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
8 | > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
8 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
9 | > msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |
9 | > except ImportError: |
|
10 | > except ImportError: | |
10 | > pass |
|
11 | > pass | |
11 | > |
|
12 | > | |
12 | > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'): |
|
13 | > for k in ('HG_FILE', 'HG_MY_ISLINK', 'HG_OTHER_ISLINK', 'HG_BASE_ISLINK'): | |
13 | > print k, os.environ[k] |
|
14 | > print k, os.environ[k] | |
14 | > EOF |
|
15 | > EOF | |
15 |
|
16 | |||
16 | Create 2 heads containing the same file, once as |
|
17 | Create 2 heads containing the same file, once as | |
17 | a file, once as a link. Bundle was generated with: |
|
18 | a file, once as a link. Bundle was generated with: | |
18 |
|
19 | |||
19 | # hg init t |
|
20 | # hg init t | |
20 | # cd t |
|
21 | # cd t | |
21 | # echo a > a |
|
22 | # echo a > a | |
22 | # hg ci -qAm t0 -d '0 0' |
|
23 | # hg ci -qAm t0 -d '0 0' | |
23 | # echo l > l |
|
24 | # echo l > l | |
24 | # hg ci -qAm t1 -d '1 0' |
|
25 | # hg ci -qAm t1 -d '1 0' | |
25 | # hg up -C 0 |
|
26 | # hg up -C 0 | |
26 | # ln -s a l |
|
27 | # ln -s a l | |
27 | # hg ci -qAm t2 -d '2 0' |
|
28 | # hg ci -qAm t2 -d '2 0' | |
28 | # echo l2 > l2 |
|
29 | # echo l2 > l2 | |
29 | # hg ci -qAm t3 -d '3 0' |
|
30 | # hg ci -qAm t3 -d '3 0' | |
30 |
|
31 | |||
31 | $ hg init t |
|
32 | $ hg init t | |
32 | $ cd t |
|
33 | $ cd t | |
33 | $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg" |
|
34 | $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg" | |
34 | $ hg up -C 3 |
|
35 | $ hg up -C 3 | |
35 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
36 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
36 |
|
37 | |||
37 | Merge them and display *_ISLINK vars |
|
38 | Merge them and display *_ISLINK vars | |
38 | merge heads |
|
39 | merge heads | |
39 |
|
40 | |||
40 | $ hg merge --tool="python ../echo.py" |
|
41 | $ hg merge --tool="python ../echo.py" | |
41 | merging l |
|
42 | merging l | |
42 | HG_FILE l |
|
43 | HG_FILE l | |
43 | HG_MY_ISLINK 1 |
|
44 | HG_MY_ISLINK 1 | |
44 | HG_OTHER_ISLINK 0 |
|
45 | HG_OTHER_ISLINK 0 | |
45 | HG_BASE_ISLINK 0 |
|
46 | HG_BASE_ISLINK 0 | |
46 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
47 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
47 | (branch merge, don't forget to commit) |
|
48 | (branch merge, don't forget to commit) | |
48 |
|
49 | |||
49 | Test working directory symlink bit calculation wrt copies, |
|
50 | Test working directory symlink bit calculation wrt copies, | |
50 | especially on non-supporting systems. |
|
51 | especially on non-supporting systems. | |
51 | merge working directory |
|
52 | merge working directory | |
52 |
|
53 | |||
53 | $ hg up -C 2 |
|
54 | $ hg up -C 2 | |
54 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
55 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
55 | $ hg copy l l2 |
|
56 | $ hg copy l l2 | |
56 | $ HGMERGE="python ../echo.py" hg up 3 |
|
57 | $ HGMERGE="python ../echo.py" hg up 3 | |
57 | merging l2 |
|
58 | merging l2 | |
58 | HG_FILE l2 |
|
59 | HG_FILE l2 | |
59 | HG_MY_ISLINK 1 |
|
60 | HG_MY_ISLINK 1 | |
60 | HG_OTHER_ISLINK 0 |
|
61 | HG_OTHER_ISLINK 0 | |
61 | HG_BASE_ISLINK 0 |
|
62 | HG_BASE_ISLINK 0 | |
62 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
63 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
@@ -1,70 +1,72 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ hg init |
|
3 | $ hg init | |
2 |
|
4 | |||
3 | $ echo a > a |
|
5 | $ echo a > a | |
4 | $ hg ci -Amadd |
|
6 | $ hg ci -Amadd | |
5 | adding a |
|
7 | adding a | |
6 |
|
8 | |||
7 | $ chmod +x a |
|
9 | $ chmod +x a | |
8 | $ hg ci -mexecutable |
|
10 | $ hg ci -mexecutable | |
9 |
|
11 | |||
10 | $ hg up 0 |
|
12 | $ hg up 0 | |
11 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
13 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
12 | $ rm a |
|
14 | $ rm a | |
13 | $ ln -s symlink a |
|
15 | $ ln -s symlink a | |
14 | $ hg ci -msymlink |
|
16 | $ hg ci -msymlink | |
15 | created new head |
|
17 | created new head | |
16 |
|
18 | |||
17 | $ hg merge --debug |
|
19 | $ hg merge --debug | |
18 | searching for copies back to rev 1 |
|
20 | searching for copies back to rev 1 | |
19 | resolving manifests |
|
21 | resolving manifests | |
20 | overwrite None partial False |
|
22 | overwrite None partial False | |
21 | ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c |
|
23 | ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c | |
22 | conflicting flags for a |
|
24 | conflicting flags for a | |
23 | (n)one, e(x)ec or sym(l)ink? n |
|
25 | (n)one, e(x)ec or sym(l)ink? n | |
24 | a: update permissions -> e |
|
26 | a: update permissions -> e | |
25 | updating: a 1/1 files (100.00%) |
|
27 | updating: a 1/1 files (100.00%) | |
26 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
28 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
27 | (branch merge, don't forget to commit) |
|
29 | (branch merge, don't forget to commit) | |
28 |
|
30 | |||
29 |
|
31 | |||
30 | Symlink is local parent, executable is other: |
|
32 | Symlink is local parent, executable is other: | |
31 |
|
33 | |||
32 | $ if [ -h a ]; then |
|
34 | $ if [ -h a ]; then | |
33 | > echo a is a symlink |
|
35 | > echo a is a symlink | |
34 | > $TESTDIR/readlink.py a |
|
36 | > $TESTDIR/readlink.py a | |
35 | > elif [ -x a ]; then |
|
37 | > elif [ -x a ]; then | |
36 | > echo a is executable |
|
38 | > echo a is executable | |
37 | > else |
|
39 | > else | |
38 | > echo "a has no flags (default for conflicts)" |
|
40 | > echo "a has no flags (default for conflicts)" | |
39 | > fi |
|
41 | > fi | |
40 | a has no flags (default for conflicts) |
|
42 | a has no flags (default for conflicts) | |
41 |
|
43 | |||
42 | $ hg update -C 1 |
|
44 | $ hg update -C 1 | |
43 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
45 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
44 |
|
46 | |||
45 | $ hg merge --debug |
|
47 | $ hg merge --debug | |
46 | searching for copies back to rev 1 |
|
48 | searching for copies back to rev 1 | |
47 | resolving manifests |
|
49 | resolving manifests | |
48 | overwrite None partial False |
|
50 | overwrite None partial False | |
49 | ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f |
|
51 | ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f | |
50 | conflicting flags for a |
|
52 | conflicting flags for a | |
51 | (n)one, e(x)ec or sym(l)ink? n |
|
53 | (n)one, e(x)ec or sym(l)ink? n | |
52 | a: remote is newer -> g |
|
54 | a: remote is newer -> g | |
53 | updating: a 1/1 files (100.00%) |
|
55 | updating: a 1/1 files (100.00%) | |
54 | getting a |
|
56 | getting a | |
55 | 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 | |
56 | (branch merge, don't forget to commit) |
|
58 | (branch merge, don't forget to commit) | |
57 |
|
59 | |||
58 |
|
60 | |||
59 | Symlink is other parent, executable is local: |
|
61 | Symlink is other parent, executable is local: | |
60 |
|
62 | |||
61 | $ if [ -h a ]; then |
|
63 | $ if [ -h a ]; then | |
62 | > echo a is a symlink |
|
64 | > echo a is a symlink | |
63 | > $TESTDIR/readlink.py a |
|
65 | > $TESTDIR/readlink.py a | |
64 | > elif [ -x a ]; then |
|
66 | > elif [ -x a ]; then | |
65 | > echo a is executable |
|
67 | > echo a is executable | |
66 | > else |
|
68 | > else | |
67 | > echo "a has no flags (default for conflicts)" |
|
69 | > echo "a has no flags (default for conflicts)" | |
68 | > fi |
|
70 | > fi | |
69 | a has no flags (default for conflicts) |
|
71 | a has no flags (default for conflicts) | |
70 |
|
72 |
@@ -1,635 +1,637 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | $ hg init |
|
3 | $ hg init | |
2 | $ mkdir d1 d1/d11 d2 |
|
4 | $ mkdir d1 d1/d11 d2 | |
3 | $ echo d1/a > d1/a |
|
5 | $ echo d1/a > d1/a | |
4 | $ echo d1/ba > d1/ba |
|
6 | $ echo d1/ba > d1/ba | |
5 | $ echo d1/a1 > d1/d11/a1 |
|
7 | $ echo d1/a1 > d1/d11/a1 | |
6 | $ echo d1/b > d1/b |
|
8 | $ echo d1/b > d1/b | |
7 | $ echo d2/b > d2/b |
|
9 | $ echo d2/b > d2/b | |
8 | $ 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 | |
9 | $ hg commit -m "1" |
|
11 | $ hg commit -m "1" | |
10 |
|
12 | |||
11 | rename a single file |
|
13 | rename a single file | |
12 |
|
14 | |||
13 | $ hg rename d1/d11/a1 d2/c |
|
15 | $ hg rename d1/d11/a1 d2/c | |
14 | $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml |
|
16 | $ hg --config ui.portablefilenames=abort rename d1/a d1/con.xml | |
15 | 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' | |
16 | [255] |
|
18 | [255] | |
17 | $ hg sum |
|
19 | $ hg sum | |
18 | parent: 0:9b4b6e7b2c26 tip |
|
20 | parent: 0:9b4b6e7b2c26 tip | |
19 | 1 |
|
21 | 1 | |
20 | branch: default |
|
22 | branch: default | |
21 | commit: 1 renamed |
|
23 | commit: 1 renamed | |
22 | update: (current) |
|
24 | update: (current) | |
23 | $ hg status -C |
|
25 | $ hg status -C | |
24 | A d2/c |
|
26 | A d2/c | |
25 | d1/d11/a1 |
|
27 | d1/d11/a1 | |
26 | R d1/d11/a1 |
|
28 | R d1/d11/a1 | |
27 | $ hg update -C |
|
29 | $ hg update -C | |
28 | 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 | |
29 | $ rm d2/c |
|
31 | $ rm d2/c | |
30 |
|
32 | |||
31 | rename a single file using absolute paths |
|
33 | rename a single file using absolute paths | |
32 |
|
34 | |||
33 | $ hg rename `pwd`/d1/d11/a1 `pwd`/d2/c |
|
35 | $ hg rename `pwd`/d1/d11/a1 `pwd`/d2/c | |
34 | $ hg status -C |
|
36 | $ hg status -C | |
35 | A d2/c |
|
37 | A d2/c | |
36 | d1/d11/a1 |
|
38 | d1/d11/a1 | |
37 | R d1/d11/a1 |
|
39 | R d1/d11/a1 | |
38 | $ hg update -C |
|
40 | $ hg update -C | |
39 | 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 | |
40 | $ rm d2/c |
|
42 | $ rm d2/c | |
41 |
|
43 | |||
42 | rename --after a single file |
|
44 | rename --after a single file | |
43 |
|
45 | |||
44 | $ mv d1/d11/a1 d2/c |
|
46 | $ mv d1/d11/a1 d2/c | |
45 | $ hg rename --after d1/d11/a1 d2/c |
|
47 | $ hg rename --after d1/d11/a1 d2/c | |
46 | $ hg status -C |
|
48 | $ hg status -C | |
47 | A d2/c |
|
49 | A d2/c | |
48 | d1/d11/a1 |
|
50 | d1/d11/a1 | |
49 | R d1/d11/a1 |
|
51 | R d1/d11/a1 | |
50 | $ hg update -C |
|
52 | $ hg update -C | |
51 | 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 | |
52 | $ rm d2/c |
|
54 | $ rm d2/c | |
53 |
|
55 | |||
54 | rename --after a single file when src and tgt already tracked |
|
56 | rename --after a single file when src and tgt already tracked | |
55 |
|
57 | |||
56 | $ mv d1/d11/a1 d2/c |
|
58 | $ mv d1/d11/a1 d2/c | |
57 | $ hg addrem -s 0 |
|
59 | $ hg addrem -s 0 | |
58 | removing d1/d11/a1 |
|
60 | removing d1/d11/a1 | |
59 | adding d2/c |
|
61 | adding d2/c | |
60 | $ hg rename --after d1/d11/a1 d2/c |
|
62 | $ hg rename --after d1/d11/a1 d2/c | |
61 | $ hg status -C |
|
63 | $ hg status -C | |
62 | A d2/c |
|
64 | A d2/c | |
63 | d1/d11/a1 |
|
65 | d1/d11/a1 | |
64 | R d1/d11/a1 |
|
66 | R d1/d11/a1 | |
65 | $ hg update -C |
|
67 | $ hg update -C | |
66 | 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 | |
67 | $ rm d2/c |
|
69 | $ rm d2/c | |
68 |
|
70 | |||
69 | rename --after a single file to a nonexistant target filename |
|
71 | rename --after a single file to a nonexistant target filename | |
70 |
|
72 | |||
71 | $ hg rename --after d1/a dummy |
|
73 | $ hg rename --after d1/a dummy | |
72 | d1/a: not recording move - dummy does not exist |
|
74 | d1/a: not recording move - dummy does not exist | |
73 |
|
75 | |||
74 | move a single file to an existing directory |
|
76 | move a single file to an existing directory | |
75 |
|
77 | |||
76 | $ hg rename d1/d11/a1 d2 |
|
78 | $ hg rename d1/d11/a1 d2 | |
77 | $ hg status -C |
|
79 | $ hg status -C | |
78 | A d2/a1 |
|
80 | A d2/a1 | |
79 | d1/d11/a1 |
|
81 | d1/d11/a1 | |
80 | R d1/d11/a1 |
|
82 | R d1/d11/a1 | |
81 | $ hg update -C |
|
83 | $ hg update -C | |
82 | 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 | |
83 | $ rm d2/a1 |
|
85 | $ rm d2/a1 | |
84 |
|
86 | |||
85 | move --after a single file to an existing directory |
|
87 | move --after a single file to an existing directory | |
86 |
|
88 | |||
87 | $ mv d1/d11/a1 d2 |
|
89 | $ mv d1/d11/a1 d2 | |
88 | $ hg rename --after d1/d11/a1 d2 |
|
90 | $ hg rename --after d1/d11/a1 d2 | |
89 | $ hg status -C |
|
91 | $ hg status -C | |
90 | A d2/a1 |
|
92 | A d2/a1 | |
91 | d1/d11/a1 |
|
93 | d1/d11/a1 | |
92 | R d1/d11/a1 |
|
94 | R d1/d11/a1 | |
93 | $ hg update -C |
|
95 | $ hg update -C | |
94 | 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 | |
95 | $ rm d2/a1 |
|
97 | $ rm d2/a1 | |
96 |
|
98 | |||
97 | rename a file using a relative path |
|
99 | rename a file using a relative path | |
98 |
|
100 | |||
99 | $ (cd d1/d11; hg rename ../../d2/b e) |
|
101 | $ (cd d1/d11; hg rename ../../d2/b e) | |
100 | $ hg status -C |
|
102 | $ hg status -C | |
101 | A d1/d11/e |
|
103 | A d1/d11/e | |
102 | d2/b |
|
104 | d2/b | |
103 | R d2/b |
|
105 | R d2/b | |
104 | $ hg update -C |
|
106 | $ hg update -C | |
105 | 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 | |
106 | $ rm d1/d11/e |
|
108 | $ rm d1/d11/e | |
107 |
|
109 | |||
108 | rename --after a file using a relative path |
|
110 | rename --after a file using a relative path | |
109 |
|
111 | |||
110 | $ (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) | |
111 | $ hg status -C |
|
113 | $ hg status -C | |
112 | A d1/d11/e |
|
114 | A d1/d11/e | |
113 | d2/b |
|
115 | d2/b | |
114 | R d2/b |
|
116 | R d2/b | |
115 | $ hg update -C |
|
117 | $ hg update -C | |
116 | 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 | |
117 | $ rm d1/d11/e |
|
119 | $ rm d1/d11/e | |
118 |
|
120 | |||
119 | rename directory d1 as d3 |
|
121 | rename directory d1 as d3 | |
120 |
|
122 | |||
121 | $ hg rename d1/ d3 |
|
123 | $ hg rename d1/ d3 | |
122 | moving d1/a to d3/a |
|
124 | moving d1/a to d3/a | |
123 | moving d1/b to d3/b |
|
125 | moving d1/b to d3/b | |
124 | moving d1/ba to d3/ba |
|
126 | moving d1/ba to d3/ba | |
125 | moving d1/d11/a1 to d3/d11/a1 |
|
127 | moving d1/d11/a1 to d3/d11/a1 | |
126 | $ hg status -C |
|
128 | $ hg status -C | |
127 | A d3/a |
|
129 | A d3/a | |
128 | d1/a |
|
130 | d1/a | |
129 | A d3/b |
|
131 | A d3/b | |
130 | d1/b |
|
132 | d1/b | |
131 | A d3/ba |
|
133 | A d3/ba | |
132 | d1/ba |
|
134 | d1/ba | |
133 | A d3/d11/a1 |
|
135 | A d3/d11/a1 | |
134 | d1/d11/a1 |
|
136 | d1/d11/a1 | |
135 | R d1/a |
|
137 | R d1/a | |
136 | R d1/b |
|
138 | R d1/b | |
137 | R d1/ba |
|
139 | R d1/ba | |
138 | R d1/d11/a1 |
|
140 | R d1/d11/a1 | |
139 | $ hg update -C |
|
141 | $ hg update -C | |
140 | 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 | |
141 | $ rm -rf d3 |
|
143 | $ rm -rf d3 | |
142 |
|
144 | |||
143 | rename --after directory d1 as d3 |
|
145 | rename --after directory d1 as d3 | |
144 |
|
146 | |||
145 | $ mv d1 d3 |
|
147 | $ mv d1 d3 | |
146 | $ hg rename --after d1 d3 |
|
148 | $ hg rename --after d1 d3 | |
147 | moving d1/a to d3/a |
|
149 | moving d1/a to d3/a | |
148 | moving d1/b to d3/b |
|
150 | moving d1/b to d3/b | |
149 | moving d1/ba to d3/ba |
|
151 | moving d1/ba to d3/ba | |
150 | moving d1/d11/a1 to d3/d11/a1 |
|
152 | moving d1/d11/a1 to d3/d11/a1 | |
151 | $ hg status -C |
|
153 | $ hg status -C | |
152 | A d3/a |
|
154 | A d3/a | |
153 | d1/a |
|
155 | d1/a | |
154 | A d3/b |
|
156 | A d3/b | |
155 | d1/b |
|
157 | d1/b | |
156 | A d3/ba |
|
158 | A d3/ba | |
157 | d1/ba |
|
159 | d1/ba | |
158 | A d3/d11/a1 |
|
160 | A d3/d11/a1 | |
159 | d1/d11/a1 |
|
161 | d1/d11/a1 | |
160 | R d1/a |
|
162 | R d1/a | |
161 | R d1/b |
|
163 | R d1/b | |
162 | R d1/ba |
|
164 | R d1/ba | |
163 | R d1/d11/a1 |
|
165 | R d1/d11/a1 | |
164 | $ hg update -C |
|
166 | $ hg update -C | |
165 | 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 | |
166 | $ rm -rf d3 |
|
168 | $ rm -rf d3 | |
167 |
|
169 | |||
168 | move a directory using a relative path |
|
170 | move a directory using a relative path | |
169 |
|
171 | |||
170 | $ (cd d2; mkdir d3; hg rename ../d1/d11 d3) |
|
172 | $ (cd d2; mkdir d3; hg rename ../d1/d11 d3) | |
171 | moving ../d1/d11/a1 to d3/d11/a1 |
|
173 | moving ../d1/d11/a1 to d3/d11/a1 | |
172 | $ hg status -C |
|
174 | $ hg status -C | |
173 | A d2/d3/d11/a1 |
|
175 | A d2/d3/d11/a1 | |
174 | d1/d11/a1 |
|
176 | d1/d11/a1 | |
175 | R d1/d11/a1 |
|
177 | R d1/d11/a1 | |
176 | $ hg update -C |
|
178 | $ hg update -C | |
177 | 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 | |
178 | $ rm -rf d2/d3 |
|
180 | $ rm -rf d2/d3 | |
179 |
|
181 | |||
180 | move --after a directory using a relative path |
|
182 | move --after a directory using a relative path | |
181 |
|
183 | |||
182 | $ (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) | |
183 | moving ../d1/d11/a1 to d3/d11/a1 |
|
185 | moving ../d1/d11/a1 to d3/d11/a1 | |
184 | $ hg status -C |
|
186 | $ hg status -C | |
185 | A d2/d3/d11/a1 |
|
187 | A d2/d3/d11/a1 | |
186 | d1/d11/a1 |
|
188 | d1/d11/a1 | |
187 | R d1/d11/a1 |
|
189 | R d1/d11/a1 | |
188 | $ hg update -C |
|
190 | $ hg update -C | |
189 | 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 | |
190 | $ rm -rf d2/d3 |
|
192 | $ rm -rf d2/d3 | |
191 |
|
193 | |||
192 | 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) | |
193 |
|
195 | |||
194 | $ hg rename d1/d11/ d2 |
|
196 | $ hg rename d1/d11/ d2 | |
195 | moving d1/d11/a1 to d2/d11/a1 |
|
197 | moving d1/d11/a1 to d2/d11/a1 | |
196 | $ hg status -C |
|
198 | $ hg status -C | |
197 | A d2/d11/a1 |
|
199 | A d2/d11/a1 | |
198 | d1/d11/a1 |
|
200 | d1/d11/a1 | |
199 | R d1/d11/a1 |
|
201 | R d1/d11/a1 | |
200 | $ hg update -C |
|
202 | $ hg update -C | |
201 | 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 | |
202 | $ rm -rf d2/d11 |
|
204 | $ rm -rf d2/d11 | |
203 |
|
205 | |||
204 | move directories d1 and d2 to a new directory d3 |
|
206 | move directories d1 and d2 to a new directory d3 | |
205 |
|
207 | |||
206 | $ mkdir d3 |
|
208 | $ mkdir d3 | |
207 | $ hg rename d1 d2 d3 |
|
209 | $ hg rename d1 d2 d3 | |
208 | moving d1/a to d3/d1/a |
|
210 | moving d1/a to d3/d1/a | |
209 | moving d1/b to d3/d1/b |
|
211 | moving d1/b to d3/d1/b | |
210 | moving d1/ba to d3/d1/ba |
|
212 | moving d1/ba to d3/d1/ba | |
211 | moving d1/d11/a1 to d3/d1/d11/a1 |
|
213 | moving d1/d11/a1 to d3/d1/d11/a1 | |
212 | moving d2/b to d3/d2/b |
|
214 | moving d2/b to d3/d2/b | |
213 | $ hg status -C |
|
215 | $ hg status -C | |
214 | A d3/d1/a |
|
216 | A d3/d1/a | |
215 | d1/a |
|
217 | d1/a | |
216 | A d3/d1/b |
|
218 | A d3/d1/b | |
217 | d1/b |
|
219 | d1/b | |
218 | A d3/d1/ba |
|
220 | A d3/d1/ba | |
219 | d1/ba |
|
221 | d1/ba | |
220 | A d3/d1/d11/a1 |
|
222 | A d3/d1/d11/a1 | |
221 | d1/d11/a1 |
|
223 | d1/d11/a1 | |
222 | A d3/d2/b |
|
224 | A d3/d2/b | |
223 | d2/b |
|
225 | d2/b | |
224 | R d1/a |
|
226 | R d1/a | |
225 | R d1/b |
|
227 | R d1/b | |
226 | R d1/ba |
|
228 | R d1/ba | |
227 | R d1/d11/a1 |
|
229 | R d1/d11/a1 | |
228 | R d2/b |
|
230 | R d2/b | |
229 | $ hg update -C |
|
231 | $ hg update -C | |
230 | 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 | |
231 | $ rm -rf d3 |
|
233 | $ rm -rf d3 | |
232 |
|
234 | |||
233 | move --after directories d1 and d2 to a new directory d3 |
|
235 | move --after directories d1 and d2 to a new directory d3 | |
234 |
|
236 | |||
235 | $ mkdir d3 |
|
237 | $ mkdir d3 | |
236 | $ mv d1 d2 d3 |
|
238 | $ mv d1 d2 d3 | |
237 | $ hg rename --after d1 d2 d3 |
|
239 | $ hg rename --after d1 d2 d3 | |
238 | moving d1/a to d3/d1/a |
|
240 | moving d1/a to d3/d1/a | |
239 | moving d1/b to d3/d1/b |
|
241 | moving d1/b to d3/d1/b | |
240 | moving d1/ba to d3/d1/ba |
|
242 | moving d1/ba to d3/d1/ba | |
241 | moving d1/d11/a1 to d3/d1/d11/a1 |
|
243 | moving d1/d11/a1 to d3/d1/d11/a1 | |
242 | moving d2/b to d3/d2/b |
|
244 | moving d2/b to d3/d2/b | |
243 | $ hg status -C |
|
245 | $ hg status -C | |
244 | A d3/d1/a |
|
246 | A d3/d1/a | |
245 | d1/a |
|
247 | d1/a | |
246 | A d3/d1/b |
|
248 | A d3/d1/b | |
247 | d1/b |
|
249 | d1/b | |
248 | A d3/d1/ba |
|
250 | A d3/d1/ba | |
249 | d1/ba |
|
251 | d1/ba | |
250 | A d3/d1/d11/a1 |
|
252 | A d3/d1/d11/a1 | |
251 | d1/d11/a1 |
|
253 | d1/d11/a1 | |
252 | A d3/d2/b |
|
254 | A d3/d2/b | |
253 | d2/b |
|
255 | d2/b | |
254 | R d1/a |
|
256 | R d1/a | |
255 | R d1/b |
|
257 | R d1/b | |
256 | R d1/ba |
|
258 | R d1/ba | |
257 | R d1/d11/a1 |
|
259 | R d1/d11/a1 | |
258 | R d2/b |
|
260 | R d2/b | |
259 | $ hg update -C |
|
261 | $ hg update -C | |
260 | 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 | |
261 | $ rm -rf d3 |
|
263 | $ rm -rf d3 | |
262 |
|
264 | |||
263 | move everything under directory d1 to existing directory d2, do not |
|
265 | move everything under directory d1 to existing directory d2, do not | |
264 | overwrite existing files (d2/b) |
|
266 | overwrite existing files (d2/b) | |
265 |
|
267 | |||
266 | $ hg rename d1/* d2 |
|
268 | $ hg rename d1/* d2 | |
267 | d2/b: not overwriting - file exists |
|
269 | d2/b: not overwriting - file exists | |
268 | moving d1/d11/a1 to d2/d11/a1 |
|
270 | moving d1/d11/a1 to d2/d11/a1 | |
269 | $ hg status -C |
|
271 | $ hg status -C | |
270 | A d2/a |
|
272 | A d2/a | |
271 | d1/a |
|
273 | d1/a | |
272 | A d2/ba |
|
274 | A d2/ba | |
273 | d1/ba |
|
275 | d1/ba | |
274 | A d2/d11/a1 |
|
276 | A d2/d11/a1 | |
275 | d1/d11/a1 |
|
277 | d1/d11/a1 | |
276 | R d1/a |
|
278 | R d1/a | |
277 | R d1/ba |
|
279 | R d1/ba | |
278 | R d1/d11/a1 |
|
280 | R d1/d11/a1 | |
279 | $ diff -u d1/b d2/b |
|
281 | $ diff -u d1/b d2/b | |
280 | --- d1/b * (glob) |
|
282 | --- d1/b * (glob) | |
281 | +++ d2/b * (glob) |
|
283 | +++ d2/b * (glob) | |
282 | @@ * (glob) |
|
284 | @@ * (glob) | |
283 | -d1/b |
|
285 | -d1/b | |
284 | +d2/b |
|
286 | +d2/b | |
285 | [1] |
|
287 | [1] | |
286 | $ hg update -C |
|
288 | $ hg update -C | |
287 | 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 | |
288 | $ rm d2/a d2/ba d2/d11/a1 |
|
290 | $ rm d2/a d2/ba d2/d11/a1 | |
289 |
|
291 | |||
290 | attempt to move one file into a non-existent directory |
|
292 | attempt to move one file into a non-existent directory | |
291 |
|
293 | |||
292 | $ hg rename d1/a dx/ |
|
294 | $ hg rename d1/a dx/ | |
293 | abort: destination dx/ is not a directory |
|
295 | abort: destination dx/ is not a directory | |
294 | [255] |
|
296 | [255] | |
295 | $ hg status -C |
|
297 | $ hg status -C | |
296 | $ hg update -C |
|
298 | $ hg update -C | |
297 | 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 | |
298 |
|
300 | |||
299 | 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 | |
300 |
|
302 | |||
301 | $ hg rename 'glob:d1/**' dx |
|
303 | $ hg rename 'glob:d1/**' dx | |
302 | abort: with multiple sources, destination must be an existing directory |
|
304 | abort: with multiple sources, destination must be an existing directory | |
303 | [255] |
|
305 | [255] | |
304 |
|
306 | |||
305 | move every file under d1 to d2/d21 (glob) |
|
307 | move every file under d1 to d2/d21 (glob) | |
306 |
|
308 | |||
307 | $ mkdir d2/d21 |
|
309 | $ mkdir d2/d21 | |
308 | $ hg rename 'glob:d1/**' d2/d21 |
|
310 | $ hg rename 'glob:d1/**' d2/d21 | |
309 | moving d1/a to d2/d21/a |
|
311 | moving d1/a to d2/d21/a | |
310 | moving d1/b to d2/d21/b |
|
312 | moving d1/b to d2/d21/b | |
311 | moving d1/ba to d2/d21/ba |
|
313 | moving d1/ba to d2/d21/ba | |
312 | moving d1/d11/a1 to d2/d21/a1 |
|
314 | moving d1/d11/a1 to d2/d21/a1 | |
313 | $ hg status -C |
|
315 | $ hg status -C | |
314 | A d2/d21/a |
|
316 | A d2/d21/a | |
315 | d1/a |
|
317 | d1/a | |
316 | A d2/d21/a1 |
|
318 | A d2/d21/a1 | |
317 | d1/d11/a1 |
|
319 | d1/d11/a1 | |
318 | A d2/d21/b |
|
320 | A d2/d21/b | |
319 | d1/b |
|
321 | d1/b | |
320 | A d2/d21/ba |
|
322 | A d2/d21/ba | |
321 | d1/ba |
|
323 | d1/ba | |
322 | R d1/a |
|
324 | R d1/a | |
323 | R d1/b |
|
325 | R d1/b | |
324 | R d1/ba |
|
326 | R d1/ba | |
325 | R d1/d11/a1 |
|
327 | R d1/d11/a1 | |
326 | $ hg update -C |
|
328 | $ hg update -C | |
327 | 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 | |
328 | $ rm -rf d2/d21 |
|
330 | $ rm -rf d2/d21 | |
329 |
|
331 | |||
330 | move --after some files under d1 to d2/d21 (glob) |
|
332 | move --after some files under d1 to d2/d21 (glob) | |
331 |
|
333 | |||
332 | $ mkdir d2/d21 |
|
334 | $ mkdir d2/d21 | |
333 | $ mv d1/a d1/d11/a1 d2/d21 |
|
335 | $ mv d1/a d1/d11/a1 d2/d21 | |
334 | $ hg rename --after 'glob:d1/**' d2/d21 |
|
336 | $ hg rename --after 'glob:d1/**' d2/d21 | |
335 | moving d1/a to d2/d21/a |
|
337 | moving d1/a to d2/d21/a | |
336 | d1/b: not recording move - d2/d21/b does not exist |
|
338 | d1/b: not recording move - d2/d21/b does not exist | |
337 | d1/ba: not recording move - d2/d21/ba does not exist |
|
339 | d1/ba: not recording move - d2/d21/ba does not exist | |
338 | moving d1/d11/a1 to d2/d21/a1 |
|
340 | moving d1/d11/a1 to d2/d21/a1 | |
339 | $ hg status -C |
|
341 | $ hg status -C | |
340 | A d2/d21/a |
|
342 | A d2/d21/a | |
341 | d1/a |
|
343 | d1/a | |
342 | A d2/d21/a1 |
|
344 | A d2/d21/a1 | |
343 | d1/d11/a1 |
|
345 | d1/d11/a1 | |
344 | R d1/a |
|
346 | R d1/a | |
345 | R d1/d11/a1 |
|
347 | R d1/d11/a1 | |
346 | $ hg update -C |
|
348 | $ hg update -C | |
347 | 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 | |
348 | $ rm -rf d2/d21 |
|
350 | $ rm -rf d2/d21 | |
349 |
|
351 | |||
350 | 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) | |
351 |
|
353 | |||
352 | $ mkdir d2/d21 |
|
354 | $ mkdir d2/d21 | |
353 | $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21 |
|
355 | $ hg rename 're:d1/([^a][^/]*/)*a.*' d2/d21 | |
354 | moving d1/a to d2/d21/a |
|
356 | moving d1/a to d2/d21/a | |
355 | moving d1/d11/a1 to d2/d21/a1 |
|
357 | moving d1/d11/a1 to d2/d21/a1 | |
356 | $ hg status -C |
|
358 | $ hg status -C | |
357 | A d2/d21/a |
|
359 | A d2/d21/a | |
358 | d1/a |
|
360 | d1/a | |
359 | A d2/d21/a1 |
|
361 | A d2/d21/a1 | |
360 | d1/d11/a1 |
|
362 | d1/d11/a1 | |
361 | R d1/a |
|
363 | R d1/a | |
362 | R d1/d11/a1 |
|
364 | R d1/d11/a1 | |
363 | $ hg update -C |
|
365 | $ hg update -C | |
364 | 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 | |
365 | $ rm -rf d2/d21 |
|
367 | $ rm -rf d2/d21 | |
366 |
|
368 | |||
367 | attempt to overwrite an existing file |
|
369 | attempt to overwrite an existing file | |
368 |
|
370 | |||
369 | $ echo "ca" > d1/ca |
|
371 | $ echo "ca" > d1/ca | |
370 | $ hg rename d1/ba d1/ca |
|
372 | $ hg rename d1/ba d1/ca | |
371 | d1/ca: not overwriting - file exists |
|
373 | d1/ca: not overwriting - file exists | |
372 | $ hg status -C |
|
374 | $ hg status -C | |
373 | ? d1/ca |
|
375 | ? d1/ca | |
374 | $ hg update -C |
|
376 | $ hg update -C | |
375 | 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 | |
376 |
|
378 | |||
377 | forced overwrite of an existing file |
|
379 | forced overwrite of an existing file | |
378 |
|
380 | |||
379 | $ echo "ca" > d1/ca |
|
381 | $ echo "ca" > d1/ca | |
380 | $ hg rename --force d1/ba d1/ca |
|
382 | $ hg rename --force d1/ba d1/ca | |
381 | $ hg status -C |
|
383 | $ hg status -C | |
382 | A d1/ca |
|
384 | A d1/ca | |
383 | d1/ba |
|
385 | d1/ba | |
384 | R d1/ba |
|
386 | R d1/ba | |
385 | $ hg update -C |
|
387 | $ hg update -C | |
386 | 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 | |
387 | $ rm d1/ca |
|
389 | $ rm d1/ca | |
388 |
|
390 | |||
389 | attempt to overwrite an existing broken symlink |
|
391 | attempt to overwrite an existing broken symlink | |
390 |
|
392 | |||
391 | $ ln -s ba d1/ca |
|
393 | $ ln -s ba d1/ca | |
392 | $ hg rename --traceback d1/ba d1/ca |
|
394 | $ hg rename --traceback d1/ba d1/ca | |
393 | d1/ca: not overwriting - file exists |
|
395 | d1/ca: not overwriting - file exists | |
394 | $ hg status -C |
|
396 | $ hg status -C | |
395 | ? d1/ca |
|
397 | ? d1/ca | |
396 | $ hg update -C |
|
398 | $ hg update -C | |
397 | 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 | |
398 | $ rm d1/ca |
|
400 | $ rm d1/ca | |
399 |
|
401 | |||
400 | replace a symlink with a file |
|
402 | replace a symlink with a file | |
401 |
|
403 | |||
402 | $ ln -s ba d1/ca |
|
404 | $ ln -s ba d1/ca | |
403 | $ hg rename --force d1/ba d1/ca |
|
405 | $ hg rename --force d1/ba d1/ca | |
404 | $ hg status -C |
|
406 | $ hg status -C | |
405 | A d1/ca |
|
407 | A d1/ca | |
406 | d1/ba |
|
408 | d1/ba | |
407 | R d1/ba |
|
409 | R d1/ba | |
408 | $ hg update -C |
|
410 | $ hg update -C | |
409 | 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 | |
410 | $ rm d1/ca |
|
412 | $ rm d1/ca | |
411 |
|
413 | |||
412 | 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 | |
413 |
|
415 | |||
414 | $ mkdir d3 |
|
416 | $ mkdir d3 | |
415 | $ hg rename d1/* d2/* d3 |
|
417 | $ hg rename d1/* d2/* d3 | |
416 | moving d1/d11/a1 to d3/d11/a1 |
|
418 | moving d1/d11/a1 to d3/d11/a1 | |
417 | d3/b: not overwriting - d2/b collides with d1/b |
|
419 | d3/b: not overwriting - d2/b collides with d1/b | |
418 | $ hg status -C |
|
420 | $ hg status -C | |
419 | A d3/a |
|
421 | A d3/a | |
420 | d1/a |
|
422 | d1/a | |
421 | A d3/b |
|
423 | A d3/b | |
422 | d1/b |
|
424 | d1/b | |
423 | A d3/ba |
|
425 | A d3/ba | |
424 | d1/ba |
|
426 | d1/ba | |
425 | A d3/d11/a1 |
|
427 | A d3/d11/a1 | |
426 | d1/d11/a1 |
|
428 | d1/d11/a1 | |
427 | R d1/a |
|
429 | R d1/a | |
428 | R d1/b |
|
430 | R d1/b | |
429 | R d1/ba |
|
431 | R d1/ba | |
430 | R d1/d11/a1 |
|
432 | R d1/d11/a1 | |
431 | $ hg update -C |
|
433 | $ hg update -C | |
432 | 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 | |
433 | $ rm -rf d3 |
|
435 | $ rm -rf d3 | |
434 |
|
436 | |||
435 | move a whole subtree with "hg rename ." |
|
437 | move a whole subtree with "hg rename ." | |
436 |
|
438 | |||
437 | $ mkdir d3 |
|
439 | $ mkdir d3 | |
438 | $ (cd d1; hg rename . ../d3) |
|
440 | $ (cd d1; hg rename . ../d3) | |
439 | moving a to ../d3/d1/a |
|
441 | moving a to ../d3/d1/a | |
440 | moving b to ../d3/d1/b |
|
442 | moving b to ../d3/d1/b | |
441 | moving ba to ../d3/d1/ba |
|
443 | moving ba to ../d3/d1/ba | |
442 | moving d11/a1 to ../d3/d1/d11/a1 |
|
444 | moving d11/a1 to ../d3/d1/d11/a1 | |
443 | $ hg status -C |
|
445 | $ hg status -C | |
444 | A d3/d1/a |
|
446 | A d3/d1/a | |
445 | d1/a |
|
447 | d1/a | |
446 | A d3/d1/b |
|
448 | A d3/d1/b | |
447 | d1/b |
|
449 | d1/b | |
448 | A d3/d1/ba |
|
450 | A d3/d1/ba | |
449 | d1/ba |
|
451 | d1/ba | |
450 | A d3/d1/d11/a1 |
|
452 | A d3/d1/d11/a1 | |
451 | d1/d11/a1 |
|
453 | d1/d11/a1 | |
452 | R d1/a |
|
454 | R d1/a | |
453 | R d1/b |
|
455 | R d1/b | |
454 | R d1/ba |
|
456 | R d1/ba | |
455 | R d1/d11/a1 |
|
457 | R d1/d11/a1 | |
456 | $ hg update -C |
|
458 | $ hg update -C | |
457 | 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 | |
458 | $ rm -rf d3 |
|
460 | $ rm -rf d3 | |
459 |
|
461 | |||
460 | move a whole subtree with "hg rename --after ." |
|
462 | move a whole subtree with "hg rename --after ." | |
461 |
|
463 | |||
462 | $ mkdir d3 |
|
464 | $ mkdir d3 | |
463 | $ mv d1/* d3 |
|
465 | $ mv d1/* d3 | |
464 | $ (cd d1; hg rename --after . ../d3) |
|
466 | $ (cd d1; hg rename --after . ../d3) | |
465 | moving a to ../d3/a |
|
467 | moving a to ../d3/a | |
466 | moving b to ../d3/b |
|
468 | moving b to ../d3/b | |
467 | moving ba to ../d3/ba |
|
469 | moving ba to ../d3/ba | |
468 | moving d11/a1 to ../d3/d11/a1 |
|
470 | moving d11/a1 to ../d3/d11/a1 | |
469 | $ hg status -C |
|
471 | $ hg status -C | |
470 | A d3/a |
|
472 | A d3/a | |
471 | d1/a |
|
473 | d1/a | |
472 | A d3/b |
|
474 | A d3/b | |
473 | d1/b |
|
475 | d1/b | |
474 | A d3/ba |
|
476 | A d3/ba | |
475 | d1/ba |
|
477 | d1/ba | |
476 | A d3/d11/a1 |
|
478 | A d3/d11/a1 | |
477 | d1/d11/a1 |
|
479 | d1/d11/a1 | |
478 | R d1/a |
|
480 | R d1/a | |
479 | R d1/b |
|
481 | R d1/b | |
480 | R d1/ba |
|
482 | R d1/ba | |
481 | R d1/d11/a1 |
|
483 | R d1/d11/a1 | |
482 | $ hg update -C |
|
484 | $ hg update -C | |
483 | 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 | |
484 | $ rm -rf d3 |
|
486 | $ rm -rf d3 | |
485 |
|
487 | |||
486 | move the parent tree with "hg rename .." |
|
488 | move the parent tree with "hg rename .." | |
487 |
|
489 | |||
488 | $ (cd d1/d11; hg rename .. ../../d3) |
|
490 | $ (cd d1/d11; hg rename .. ../../d3) | |
489 | moving ../a to ../../d3/a |
|
491 | moving ../a to ../../d3/a | |
490 | moving ../b to ../../d3/b |
|
492 | moving ../b to ../../d3/b | |
491 | moving ../ba to ../../d3/ba |
|
493 | moving ../ba to ../../d3/ba | |
492 | moving a1 to ../../d3/d11/a1 |
|
494 | moving a1 to ../../d3/d11/a1 | |
493 | $ hg status -C |
|
495 | $ hg status -C | |
494 | A d3/a |
|
496 | A d3/a | |
495 | d1/a |
|
497 | d1/a | |
496 | A d3/b |
|
498 | A d3/b | |
497 | d1/b |
|
499 | d1/b | |
498 | A d3/ba |
|
500 | A d3/ba | |
499 | d1/ba |
|
501 | d1/ba | |
500 | A d3/d11/a1 |
|
502 | A d3/d11/a1 | |
501 | d1/d11/a1 |
|
503 | d1/d11/a1 | |
502 | R d1/a |
|
504 | R d1/a | |
503 | R d1/b |
|
505 | R d1/b | |
504 | R d1/ba |
|
506 | R d1/ba | |
505 | R d1/d11/a1 |
|
507 | R d1/d11/a1 | |
506 | $ hg update -C |
|
508 | $ hg update -C | |
507 | 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 | |
508 | $ rm -rf d3 |
|
510 | $ rm -rf d3 | |
509 |
|
511 | |||
510 | skip removed files |
|
512 | skip removed files | |
511 |
|
513 | |||
512 | $ hg remove d1/b |
|
514 | $ hg remove d1/b | |
513 | $ hg rename d1 d3 |
|
515 | $ hg rename d1 d3 | |
514 | moving d1/a to d3/a |
|
516 | moving d1/a to d3/a | |
515 | moving d1/ba to d3/ba |
|
517 | moving d1/ba to d3/ba | |
516 | moving d1/d11/a1 to d3/d11/a1 |
|
518 | moving d1/d11/a1 to d3/d11/a1 | |
517 | $ hg status -C |
|
519 | $ hg status -C | |
518 | A d3/a |
|
520 | A d3/a | |
519 | d1/a |
|
521 | d1/a | |
520 | A d3/ba |
|
522 | A d3/ba | |
521 | d1/ba |
|
523 | d1/ba | |
522 | A d3/d11/a1 |
|
524 | A d3/d11/a1 | |
523 | d1/d11/a1 |
|
525 | d1/d11/a1 | |
524 | R d1/a |
|
526 | R d1/a | |
525 | R d1/b |
|
527 | R d1/b | |
526 | R d1/ba |
|
528 | R d1/ba | |
527 | R d1/d11/a1 |
|
529 | R d1/d11/a1 | |
528 | $ hg update -C |
|
530 | $ hg update -C | |
529 | 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 | |
530 | $ rm -rf d3 |
|
532 | $ rm -rf d3 | |
531 |
|
533 | |||
532 | transitive rename |
|
534 | transitive rename | |
533 |
|
535 | |||
534 | $ hg rename d1/b d1/bb |
|
536 | $ hg rename d1/b d1/bb | |
535 | $ hg rename d1/bb d1/bc |
|
537 | $ hg rename d1/bb d1/bc | |
536 | $ hg status -C |
|
538 | $ hg status -C | |
537 | A d1/bc |
|
539 | A d1/bc | |
538 | d1/b |
|
540 | d1/b | |
539 | R d1/b |
|
541 | R d1/b | |
540 | $ hg update -C |
|
542 | $ hg update -C | |
541 | 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 | |
542 | $ rm d1/bc |
|
544 | $ rm d1/bc | |
543 |
|
545 | |||
544 | transitive rename --after |
|
546 | transitive rename --after | |
545 |
|
547 | |||
546 | $ hg rename d1/b d1/bb |
|
548 | $ hg rename d1/b d1/bb | |
547 | $ mv d1/bb d1/bc |
|
549 | $ mv d1/bb d1/bc | |
548 | $ hg rename --after d1/bb d1/bc |
|
550 | $ hg rename --after d1/bb d1/bc | |
549 | $ hg status -C |
|
551 | $ hg status -C | |
550 | A d1/bc |
|
552 | A d1/bc | |
551 | d1/b |
|
553 | d1/b | |
552 | R d1/b |
|
554 | R d1/b | |
553 | $ hg update -C |
|
555 | $ hg update -C | |
554 | 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 | |
555 | $ rm d1/bc |
|
557 | $ rm d1/bc | |
556 |
|
558 | |||
557 | $ 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)" | |
558 | # 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) | |
559 | $ hg rename d1/b d1/bb |
|
561 | $ hg rename d1/b d1/bb | |
560 | $ echo "some stuff added to d1/bb" >> d1/bb |
|
562 | $ echo "some stuff added to d1/bb" >> d1/bb | |
561 | $ hg rename d1/bb d1/b |
|
563 | $ hg rename d1/bb d1/b | |
562 | $ hg status -C |
|
564 | $ hg status -C | |
563 | M d1/b |
|
565 | M d1/b | |
564 | $ hg update -C |
|
566 | $ hg update -C | |
565 | 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 | |
566 |
|
568 | |||
567 | overwriting with renames (issue1959) |
|
569 | overwriting with renames (issue1959) | |
568 |
|
570 | |||
569 | $ hg rename d1/a d1/c |
|
571 | $ hg rename d1/a d1/c | |
570 | $ hg rename d1/b d1/a |
|
572 | $ hg rename d1/b d1/a | |
571 | $ hg status -C |
|
573 | $ hg status -C | |
572 | A d1/a |
|
574 | A d1/a | |
573 | d1/b |
|
575 | d1/b | |
574 | A d1/c |
|
576 | A d1/c | |
575 | d1/a |
|
577 | d1/a | |
576 | R d1/b |
|
578 | R d1/b | |
577 | $ hg diff --git |
|
579 | $ hg diff --git | |
578 | diff --git a/d1/b b/d1/a |
|
580 | diff --git a/d1/b b/d1/a | |
579 | rename from d1/b |
|
581 | rename from d1/b | |
580 | rename to d1/a |
|
582 | rename to d1/a | |
581 | diff --git a/d1/a b/d1/c |
|
583 | diff --git a/d1/a b/d1/c | |
582 | copy from d1/a |
|
584 | copy from d1/a | |
583 | copy to d1/c |
|
585 | copy to d1/c | |
584 | $ hg update -C |
|
586 | $ hg update -C | |
585 | 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 | |
586 |
|
588 | |||
587 | check illegal path components |
|
589 | check illegal path components | |
588 |
|
590 | |||
589 | $ hg rename d1/d11/a1 .hg/foo |
|
591 | $ hg rename d1/d11/a1 .hg/foo | |
590 | abort: path contains illegal component: .hg/foo |
|
592 | abort: path contains illegal component: .hg/foo | |
591 | [255] |
|
593 | [255] | |
592 | $ hg status -C |
|
594 | $ hg status -C | |
593 | $ hg rename d1/d11/a1 ../foo |
|
595 | $ hg rename d1/d11/a1 ../foo | |
594 | abort: ../foo not under root |
|
596 | abort: ../foo not under root | |
595 | [255] |
|
597 | [255] | |
596 | $ hg status -C |
|
598 | $ hg status -C | |
597 |
|
599 | |||
598 | $ mv d1/d11/a1 .hg/foo |
|
600 | $ mv d1/d11/a1 .hg/foo | |
599 | $ hg rename --after d1/d11/a1 .hg/foo |
|
601 | $ hg rename --after d1/d11/a1 .hg/foo | |
600 | abort: path contains illegal component: .hg/foo |
|
602 | abort: path contains illegal component: .hg/foo | |
601 | [255] |
|
603 | [255] | |
602 | $ hg status -C |
|
604 | $ hg status -C | |
603 | ! d1/d11/a1 |
|
605 | ! d1/d11/a1 | |
604 | $ hg update -C |
|
606 | $ hg update -C | |
605 | 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 | |
606 | $ rm .hg/foo |
|
608 | $ rm .hg/foo | |
607 |
|
609 | |||
608 | $ hg rename d1/d11/a1 .hg |
|
610 | $ hg rename d1/d11/a1 .hg | |
609 | abort: path contains illegal component: .hg/a1 |
|
611 | abort: path contains illegal component: .hg/a1 | |
610 | [255] |
|
612 | [255] | |
611 | $ hg status -C |
|
613 | $ hg status -C | |
612 | $ hg rename d1/d11/a1 .. |
|
614 | $ hg rename d1/d11/a1 .. | |
613 | abort: ../a1 not under root |
|
615 | abort: ../a1 not under root | |
614 | [255] |
|
616 | [255] | |
615 | $ hg status -C |
|
617 | $ hg status -C | |
616 |
|
618 | |||
617 | $ mv d1/d11/a1 .hg |
|
619 | $ mv d1/d11/a1 .hg | |
618 | $ hg rename --after d1/d11/a1 .hg |
|
620 | $ hg rename --after d1/d11/a1 .hg | |
619 | abort: path contains illegal component: .hg/a1 |
|
621 | abort: path contains illegal component: .hg/a1 | |
620 | [255] |
|
622 | [255] | |
621 | $ hg status -C |
|
623 | $ hg status -C | |
622 | ! d1/d11/a1 |
|
624 | ! d1/d11/a1 | |
623 | $ hg update -C |
|
625 | $ hg update -C | |
624 | 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 | |
625 | $ rm .hg/a1 |
|
627 | $ rm .hg/a1 | |
626 |
|
628 | |||
627 | $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo) |
|
629 | $ (cd d1/d11; hg rename ../../d2/b ../../.hg/foo) | |
628 | abort: path contains illegal component: .hg/foo |
|
630 | abort: path contains illegal component: .hg/foo | |
629 | [255] |
|
631 | [255] | |
630 | $ hg status -C |
|
632 | $ hg status -C | |
631 | $ (cd d1/d11; hg rename ../../d2/b ../../../foo) |
|
633 | $ (cd d1/d11; hg rename ../../d2/b ../../../foo) | |
632 | abort: ../../../foo not under root |
|
634 | abort: ../../../foo not under root | |
633 | [255] |
|
635 | [255] | |
634 | $ hg status -C |
|
636 | $ hg status -C | |
635 |
|
637 |
@@ -1,68 +1,70 | |||||
|
1 | $ "$TESTDIR/hghave" symlink || exit 80 | |||
|
2 | ||||
1 | Create extension that can disable symlink support: |
|
3 | Create extension that can disable symlink support: | |
2 |
|
4 | |||
3 | $ cat > nolink.py <<EOF |
|
5 | $ cat > nolink.py <<EOF | |
4 | > from mercurial import extensions, util |
|
6 | > from mercurial import extensions, util | |
5 | > def setflags(orig, f, l, x): |
|
7 | > def setflags(orig, f, l, x): | |
6 | > pass |
|
8 | > pass | |
7 | > def checklink(orig, path): |
|
9 | > def checklink(orig, path): | |
8 | > return False |
|
10 | > return False | |
9 | > def extsetup(ui): |
|
11 | > def extsetup(ui): | |
10 | > extensions.wrapfunction(util, 'setflags', setflags) |
|
12 | > extensions.wrapfunction(util, 'setflags', setflags) | |
11 | > extensions.wrapfunction(util, 'checklink', checklink) |
|
13 | > extensions.wrapfunction(util, 'checklink', checklink) | |
12 | > EOF |
|
14 | > EOF | |
13 |
|
15 | |||
14 | $ hg init unix-repo |
|
16 | $ hg init unix-repo | |
15 | $ cd unix-repo |
|
17 | $ cd unix-repo | |
16 | $ echo foo > a |
|
18 | $ echo foo > a | |
17 | $ ln -s a b |
|
19 | $ ln -s a b | |
18 | $ hg ci -Am0 |
|
20 | $ hg ci -Am0 | |
19 | adding a |
|
21 | adding a | |
20 | adding b |
|
22 | adding b | |
21 | $ cd .. |
|
23 | $ cd .. | |
22 |
|
24 | |||
23 | Simulate a checkout shared on NFS/Samba: |
|
25 | Simulate a checkout shared on NFS/Samba: | |
24 |
|
26 | |||
25 | $ hg clone -q unix-repo shared |
|
27 | $ hg clone -q unix-repo shared | |
26 | $ cd shared |
|
28 | $ cd shared | |
27 | $ rm b |
|
29 | $ rm b | |
28 | $ echo foo > b |
|
30 | $ echo foo > b | |
29 | $ hg --config extensions.n=$TESTTMP/nolink.py status --debug |
|
31 | $ hg --config extensions.n=$TESTTMP/nolink.py status --debug | |
30 | ignoring suspect symlink placeholder "b" |
|
32 | ignoring suspect symlink placeholder "b" | |
31 |
|
33 | |||
32 | Make a clone using placeholders: |
|
34 | Make a clone using placeholders: | |
33 |
|
35 | |||
34 | $ hg --config extensions.n=$TESTTMP/nolink.py clone . ../win-repo |
|
36 | $ hg --config extensions.n=$TESTTMP/nolink.py clone . ../win-repo | |
35 | updating to branch default |
|
37 | updating to branch default | |
36 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
38 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
37 | $ cd ../win-repo |
|
39 | $ cd ../win-repo | |
38 | $ cat b |
|
40 | $ cat b | |
39 | a (no-eol) |
|
41 | a (no-eol) | |
40 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug |
|
42 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug | |
41 |
|
43 | |||
42 | Write binary data to the placeholder: |
|
44 | Write binary data to the placeholder: | |
43 |
|
45 | |||
44 | >>> open('b', 'w').write('this is a binary\0') |
|
46 | >>> open('b', 'w').write('this is a binary\0') | |
45 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug |
|
47 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug | |
46 | ignoring suspect symlink placeholder "b" |
|
48 | ignoring suspect symlink placeholder "b" | |
47 |
|
49 | |||
48 | Write a long string to the placeholder: |
|
50 | Write a long string to the placeholder: | |
49 |
|
51 | |||
50 | >>> open('b', 'w').write('this' * 1000) |
|
52 | >>> open('b', 'w').write('this' * 1000) | |
51 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug |
|
53 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug | |
52 | ignoring suspect symlink placeholder "b" |
|
54 | ignoring suspect symlink placeholder "b" | |
53 |
|
55 | |||
54 | Commit shouldn't succeed: |
|
56 | Commit shouldn't succeed: | |
55 |
|
57 | |||
56 | $ hg --config extensions.n=$TESTTMP/nolink.py ci -m1 |
|
58 | $ hg --config extensions.n=$TESTTMP/nolink.py ci -m1 | |
57 | nothing changed |
|
59 | nothing changed | |
58 | [1] |
|
60 | [1] | |
59 |
|
61 | |||
60 | Write a valid string to the placeholder: |
|
62 | Write a valid string to the placeholder: | |
61 |
|
63 | |||
62 | >>> open('b', 'w').write('this') |
|
64 | >>> open('b', 'w').write('this') | |
63 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug |
|
65 | $ hg --config extensions.n=$TESTTMP/nolink.py st --debug | |
64 | M b |
|
66 | M b | |
65 | $ hg --config extensions.n=$TESTTMP/nolink.py ci -m1 |
|
67 | $ hg --config extensions.n=$TESTTMP/nolink.py ci -m1 | |
66 | $ hg manifest tip --verbose |
|
68 | $ hg manifest tip --verbose | |
67 | 644 a |
|
69 | 644 a | |
68 | 644 @ b |
|
70 | 644 @ b |
General Comments 0
You need to be logged in to leave comments.
Login now