Show More
@@ -1,288 +1,289 b'' | |||
|
1 | 1 | # hg.py - repository classes for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com> |
|
5 | 5 | # |
|
6 | 6 | # This software may be used and distributed according to the terms |
|
7 | 7 | # of the GNU General Public License, incorporated herein by reference. |
|
8 | 8 | |
|
9 | 9 | from i18n import _ |
|
10 | 10 | import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo |
|
11 | 11 | import errno, lock, os, shutil, util, extensions, error |
|
12 | 12 | import merge as _merge |
|
13 | 13 | import verify as _verify |
|
14 | 14 | |
|
15 | 15 | def _local(path): |
|
16 | 16 | return (os.path.isfile(util.drop_scheme('file', path)) and |
|
17 | 17 | bundlerepo or localrepo) |
|
18 | 18 | |
|
19 | 19 | def parseurl(url, revs=[]): |
|
20 | 20 | '''parse url#branch, returning url, branch + revs''' |
|
21 | 21 | |
|
22 | 22 | if '#' not in url: |
|
23 | 23 | return url, (revs or None), revs and revs[-1] or None |
|
24 | 24 | |
|
25 | 25 | url, branch = url.split('#', 1) |
|
26 | 26 | checkout = revs and revs[-1] or branch |
|
27 | 27 | return url, revs + [branch], checkout |
|
28 | 28 | |
|
29 | 29 | schemes = { |
|
30 | 30 | 'bundle': bundlerepo, |
|
31 | 31 | 'file': _local, |
|
32 | 32 | 'http': httprepo, |
|
33 | 33 | 'https': httprepo, |
|
34 | 34 | 'ssh': sshrepo, |
|
35 | 35 | 'static-http': statichttprepo, |
|
36 | 36 | } |
|
37 | 37 | |
|
38 | 38 | def _lookup(path): |
|
39 | 39 | scheme = 'file' |
|
40 | 40 | if path: |
|
41 | 41 | c = path.find(':') |
|
42 | 42 | if c > 0: |
|
43 | 43 | scheme = path[:c] |
|
44 | 44 | thing = schemes.get(scheme) or schemes['file'] |
|
45 | 45 | try: |
|
46 | 46 | return thing(path) |
|
47 | 47 | except TypeError: |
|
48 | 48 | return thing |
|
49 | 49 | |
|
50 | 50 | def islocal(repo): |
|
51 | 51 | '''return true if repo or path is local''' |
|
52 | 52 | if isinstance(repo, str): |
|
53 | 53 | try: |
|
54 | 54 | return _lookup(repo).islocal(repo) |
|
55 | 55 | except AttributeError: |
|
56 | 56 | return False |
|
57 | 57 | return repo.local() |
|
58 | 58 | |
|
59 | 59 | def repository(ui, path='', create=False): |
|
60 | 60 | """return a repository object for the specified path""" |
|
61 | 61 | repo = _lookup(path).instance(ui, path, create) |
|
62 | 62 | ui = getattr(repo, "ui", ui) |
|
63 | 63 | for name, module in extensions.extensions(): |
|
64 | 64 | hook = getattr(module, 'reposetup', None) |
|
65 | 65 | if hook: |
|
66 | 66 | hook(ui, repo) |
|
67 | 67 | return repo |
|
68 | 68 | |
|
69 | 69 | def defaultdest(source): |
|
70 | 70 | '''return default destination of clone if none is given''' |
|
71 | 71 | return os.path.basename(os.path.normpath(source)) |
|
72 | 72 | |
|
73 | 73 | def localpath(path): |
|
74 | 74 | if path.startswith('file://localhost/'): |
|
75 | 75 | return path[16:] |
|
76 | 76 | if path.startswith('file://'): |
|
77 | 77 | return path[7:] |
|
78 | 78 | if path.startswith('file:'): |
|
79 | 79 | return path[5:] |
|
80 | 80 | return path |
|
81 | 81 | |
|
82 | 82 | def clone(ui, source, dest=None, pull=False, rev=None, update=True, |
|
83 | 83 | stream=False): |
|
84 | 84 | """Make a copy of an existing repository. |
|
85 | 85 | |
|
86 | 86 | Create a copy of an existing repository in a new directory. The |
|
87 | 87 | source and destination are URLs, as passed to the repository |
|
88 | 88 | function. Returns a pair of repository objects, the source and |
|
89 | 89 | newly created destination. |
|
90 | 90 | |
|
91 | 91 | The location of the source is added to the new repository's |
|
92 | 92 | .hg/hgrc file, as the default to be used for future pulls and |
|
93 | 93 | pushes. |
|
94 | 94 | |
|
95 | 95 | If an exception is raised, the partly cloned/updated destination |
|
96 | 96 | repository will be deleted. |
|
97 | 97 | |
|
98 | 98 | Arguments: |
|
99 | 99 | |
|
100 | 100 | source: repository object or URL |
|
101 | 101 | |
|
102 | 102 | dest: URL of destination repository to create (defaults to base |
|
103 | 103 | name of source repository) |
|
104 | 104 | |
|
105 | 105 | pull: always pull from source repository, even in local case |
|
106 | 106 | |
|
107 | 107 | stream: stream raw data uncompressed from repository (fast over |
|
108 | 108 | LAN, slow over WAN) |
|
109 | 109 | |
|
110 | 110 | rev: revision to clone up to (implies pull=True) |
|
111 | 111 | |
|
112 | 112 | update: update working directory after clone completes, if |
|
113 | 113 | destination is local repository (True means update to default rev, |
|
114 | 114 | anything else is treated as a revision) |
|
115 | 115 | """ |
|
116 | 116 | |
|
117 | 117 | if isinstance(source, str): |
|
118 | 118 | origsource = ui.expandpath(source) |
|
119 | 119 | source, rev, checkout = parseurl(origsource, rev) |
|
120 | 120 | src_repo = repository(ui, source) |
|
121 | 121 | else: |
|
122 | 122 | src_repo = source |
|
123 | 123 | origsource = source = src_repo.url() |
|
124 | 124 | checkout = rev and rev[-1] or None |
|
125 | 125 | |
|
126 | 126 | if dest is None: |
|
127 | 127 | dest = defaultdest(source) |
|
128 | 128 | ui.status(_("destination directory: %s\n") % dest) |
|
129 | 129 | |
|
130 | 130 | dest = localpath(dest) |
|
131 | 131 | source = localpath(source) |
|
132 | 132 | |
|
133 | 133 | if os.path.exists(dest): |
|
134 | 134 | raise util.Abort(_("destination '%s' already exists") % dest) |
|
135 | 135 | |
|
136 | 136 | class DirCleanup(object): |
|
137 | 137 | def __init__(self, dir_): |
|
138 | 138 | self.rmtree = shutil.rmtree |
|
139 | 139 | self.dir_ = dir_ |
|
140 | 140 | def close(self): |
|
141 | 141 | self.dir_ = None |
|
142 | 142 | def __del__(self): |
|
143 | 143 | if self.dir_: |
|
144 | 144 | self.rmtree(self.dir_, True) |
|
145 | 145 | |
|
146 | 146 | src_lock = dest_lock = dir_cleanup = None |
|
147 | 147 | try: |
|
148 | 148 | if islocal(dest): |
|
149 | 149 | dir_cleanup = DirCleanup(dest) |
|
150 | 150 | |
|
151 | 151 | abspath = origsource |
|
152 | 152 | copy = False |
|
153 | 153 | if src_repo.cancopy() and islocal(dest): |
|
154 | 154 | abspath = os.path.abspath(util.drop_scheme('file', origsource)) |
|
155 | 155 | copy = not pull and not rev |
|
156 | 156 | |
|
157 | 157 | if copy: |
|
158 | 158 | try: |
|
159 | 159 | # we use a lock here because if we race with commit, we |
|
160 | 160 | # can end up with extra data in the cloned revlogs that's |
|
161 | 161 | # not pointed to by changesets, thus causing verify to |
|
162 | 162 | # fail |
|
163 | 163 | src_lock = src_repo.lock() |
|
164 | 164 | except error.LockError: |
|
165 | 165 | copy = False |
|
166 | 166 | |
|
167 | 167 | if copy: |
|
168 | 168 | if not os.path.exists(dest): |
|
169 | 169 | os.mkdir(dest) |
|
170 | 170 | try: |
|
171 | 171 | dest_path = os.path.realpath(os.path.join(dest, ".hg")) |
|
172 | 172 | os.mkdir(dest_path) |
|
173 | 173 | except OSError, inst: |
|
174 | 174 | if inst.errno == errno.EEXIST: |
|
175 | 175 | dir_cleanup.close() |
|
176 | 176 | raise util.Abort(_("destination '%s' already exists") |
|
177 | 177 | % dest) |
|
178 | 178 | raise |
|
179 | 179 | |
|
180 | 180 | for f in src_repo.store.copylist(): |
|
181 | 181 | src = os.path.join(src_repo.path, f) |
|
182 | 182 | dst = os.path.join(dest_path, f) |
|
183 | 183 | dstbase = os.path.dirname(dst) |
|
184 | 184 | if dstbase and not os.path.exists(dstbase): |
|
185 | 185 | os.mkdir(dstbase) |
|
186 | 186 | if os.path.exists(src): |
|
187 | 187 | if dst.endswith('data'): |
|
188 | 188 | # lock to avoid premature writing to the target |
|
189 | 189 | dest_lock = lock.lock(os.path.join(dstbase, "lock")) |
|
190 | 190 | util.copyfiles(src, dst) |
|
191 | 191 | |
|
192 | 192 | # we need to re-init the repo after manually copying the data |
|
193 | 193 | # into it |
|
194 | 194 | dest_repo = repository(ui, dest) |
|
195 | 195 | |
|
196 | 196 | else: |
|
197 | 197 | try: |
|
198 | 198 | dest_repo = repository(ui, dest, create=True) |
|
199 | 199 | except OSError, inst: |
|
200 | 200 | if inst.errno == errno.EEXIST: |
|
201 | 201 | dir_cleanup.close() |
|
202 | 202 | raise util.Abort(_("destination '%s' already exists") |
|
203 | 203 | % dest) |
|
204 | 204 | raise |
|
205 | 205 | |
|
206 | 206 | revs = None |
|
207 | 207 | if rev: |
|
208 | 208 | if 'lookup' not in src_repo.capabilities: |
|
209 | 209 | raise util.Abort(_("src repository does not support revision " |
|
210 | 210 | "lookup and so doesn't support clone by " |
|
211 | 211 | "revision")) |
|
212 | 212 | revs = [src_repo.lookup(r) for r in rev] |
|
213 | 213 | |
|
214 | 214 | if dest_repo.local(): |
|
215 | 215 | dest_repo.clone(src_repo, heads=revs, stream=stream) |
|
216 | 216 | elif src_repo.local(): |
|
217 | 217 | src_repo.push(dest_repo, revs=revs) |
|
218 | 218 | else: |
|
219 | 219 | raise util.Abort(_("clone from remote to remote not supported")) |
|
220 | 220 | |
|
221 | 221 | if dir_cleanup: |
|
222 | 222 | dir_cleanup.close() |
|
223 | 223 | |
|
224 | 224 | if dest_repo.local(): |
|
225 | 225 | fp = dest_repo.opener("hgrc", "w", text=True) |
|
226 | 226 | fp.write("[paths]\n") |
|
227 | 227 | # percent needs to be escaped for ConfigParser |
|
228 | 228 | fp.write("default = %s\n" % abspath.replace('%', '%%')) |
|
229 | 229 | fp.close() |
|
230 | 230 | |
|
231 | 231 | if update: |
|
232 | 232 | dest_repo.ui.status(_("updating working directory\n")) |
|
233 | 233 | if update is not True: |
|
234 | 234 | checkout = update |
|
235 | 235 | for test in (checkout, 'default', 'tip'): |
|
236 | 236 | try: |
|
237 | 237 | uprev = dest_repo.lookup(test) |
|
238 | 238 | break |
|
239 | 239 | except: |
|
240 | 240 | continue |
|
241 | 241 | _update(dest_repo, uprev) |
|
242 | 242 | |
|
243 | 243 | return src_repo, dest_repo |
|
244 | 244 | finally: |
|
245 | 245 | del src_lock, dest_lock, dir_cleanup |
|
246 | 246 | |
|
247 | 247 | def _showstats(repo, stats): |
|
248 | 248 | stats = ((stats[0], _("updated")), |
|
249 | 249 | (stats[1], _("merged")), |
|
250 | 250 | (stats[2], _("removed")), |
|
251 | 251 | (stats[3], _("unresolved"))) |
|
252 | 252 | note = ", ".join([_("%d files %s") % s for s in stats]) |
|
253 | 253 | repo.ui.status("%s\n" % note) |
|
254 | 254 | |
|
255 | 255 | def update(repo, node): |
|
256 | 256 | """update the working directory to node, merging linear changes""" |
|
257 | 257 | stats = _merge.update(repo, node, False, False, None) |
|
258 | 258 | _showstats(repo, stats) |
|
259 | 259 | if stats[3]: |
|
260 | 260 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n")) |
|
261 | 261 | return stats[3] > 0 |
|
262 | 262 | |
|
263 | 263 | # naming conflict in clone() |
|
264 | 264 | _update = update |
|
265 | 265 | |
|
266 | 266 | def clean(repo, node, show_stats=True): |
|
267 | 267 | """forcibly switch the working directory to node, clobbering changes""" |
|
268 | 268 | stats = _merge.update(repo, node, False, True, None) |
|
269 | 269 | if show_stats: _showstats(repo, stats) |
|
270 | 270 | return stats[3] > 0 |
|
271 | 271 | |
|
272 | 272 | def merge(repo, node, force=None, remind=True): |
|
273 | 273 | """branch merge with node, resolving changes""" |
|
274 | 274 | stats = _merge.update(repo, node, True, force, False) |
|
275 | 275 | _showstats(repo, stats) |
|
276 | 276 | if stats[3]: |
|
277 |
repo.ui.status(_("use 'hg resolve' to retry unresolved file merges |
|
|
277 | repo.ui.status(_("use 'hg resolve' to retry unresolved file merges " | |
|
278 | "or 'hg up --clean' to abandon\n")) | |
|
278 | 279 | elif remind: |
|
279 | 280 | repo.ui.status(_("(branch merge, don't forget to commit)\n")) |
|
280 | 281 | return stats[3] > 0 |
|
281 | 282 | |
|
282 | 283 | def revert(repo, node, choose): |
|
283 | 284 | """revert changes to revision in node without updating dirstate""" |
|
284 | 285 | return _merge.update(repo, node, False, True, choose)[3] > 0 |
|
285 | 286 | |
|
286 | 287 | def verify(repo): |
|
287 | 288 | """verify the consistency of a repository""" |
|
288 | 289 | return _verify.verify(repo) |
@@ -1,37 +1,37 b'' | |||
|
1 | 1 | adding a |
|
2 | 2 | ? a |
|
3 | 3 | adding a |
|
4 | 4 | A a |
|
5 | 5 | A a |
|
6 | 6 | ? b |
|
7 | 7 | A a |
|
8 | 8 | A b |
|
9 | 9 | % should fail |
|
10 | 10 | b already tracked! |
|
11 | 11 | A a |
|
12 | 12 | A b |
|
13 | 13 | % should fail |
|
14 | 14 | a already tracked! |
|
15 | 15 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
16 | 16 | created new head |
|
17 | 17 | merging a |
|
18 | 18 | warning: conflicts during merge. |
|
19 | 19 | merging a failed! |
|
20 | 20 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
21 | use 'hg resolve' to retry unresolved file merges | |
|
21 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
22 | 22 | M a |
|
23 | 23 | ? a.orig |
|
24 | 24 | % should fail |
|
25 | 25 | a already tracked! |
|
26 | 26 | M a |
|
27 | 27 | ? a.orig |
|
28 | 28 | % issue683 |
|
29 | 29 | R a |
|
30 | 30 | ? a.orig |
|
31 | 31 | M a |
|
32 | 32 | ? a.orig |
|
33 | 33 | c does not exist! |
|
34 | 34 | d does not exist! |
|
35 | 35 | M a |
|
36 | 36 | A c |
|
37 | 37 | ? a.orig |
@@ -1,14 +1,14 b'' | |||
|
1 | 1 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
2 | 2 | created new head |
|
3 | 3 | |
|
4 | 4 | % Merging a conflict araises |
|
5 | 5 | merging A |
|
6 | 6 | warning: conflicts during merge. |
|
7 | 7 | merging A failed! |
|
8 | 8 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
9 | use 'hg resolve' to retry unresolved file merges | |
|
9 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
10 | 10 | |
|
11 | 11 | % Correct the conflict without marking the file as resolved |
|
12 | 12 | abort: unresolved merge conflicts (see hg resolve) |
|
13 | 13 | |
|
14 | 14 | % Mark the conflict as resolved and commit |
@@ -1,15 +1,15 b'' | |||
|
1 | 1 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2 | 2 | created new head |
|
3 | 3 | merging a |
|
4 | 4 | warning: conflicts during merge. |
|
5 | 5 | merging a failed! |
|
6 | 6 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
7 | use 'hg resolve' to retry unresolved file merges | |
|
7 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
8 | 8 | e7fe8eb3e180+0d24b7662d3e+ tip |
|
9 | 9 | <<<<<<< local |
|
10 | 10 | something else |
|
11 | 11 | ======= |
|
12 | 12 | something |
|
13 | 13 | >>>>>>> other |
|
14 | 14 | M a |
|
15 | 15 | ? a.orig |
@@ -1,337 +1,337 b'' | |||
|
1 | 1 | % add |
|
2 | 2 | adding a |
|
3 | 3 | adding d1/d2/b |
|
4 | 4 | % modify |
|
5 | 5 | 1:e0e2b8a9156b |
|
6 | 6 | assuming destination a-hg |
|
7 | 7 | initializing svn repo 'a-hg' |
|
8 | 8 | initializing svn wc 'a-hg-wc' |
|
9 | 9 | scanning source... |
|
10 | 10 | sorting... |
|
11 | 11 | converting... |
|
12 | 12 | 1 add a file |
|
13 | 13 | 0 modify a file |
|
14 | 14 | At revision 2. |
|
15 | 15 | 2 2 test . |
|
16 | 16 | 2 2 test a |
|
17 | 17 | 2 1 test d1 |
|
18 | 18 | 2 1 test d1/d2 |
|
19 | 19 | 2 1 test d1/d2/b |
|
20 | 20 | <?xml version="1.0"?> |
|
21 | 21 | <log> |
|
22 | 22 | <logentry |
|
23 | 23 | revision="2"> |
|
24 | 24 | <author>test</author> |
|
25 | 25 | <date/> |
|
26 | 26 | <paths> |
|
27 | 27 | <path |
|
28 | 28 | action="M">/a</path> |
|
29 | 29 | </paths> |
|
30 | 30 | <msg>modify a file</msg> |
|
31 | 31 | </logentry> |
|
32 | 32 | <logentry |
|
33 | 33 | revision="1"> |
|
34 | 34 | <author>test</author> |
|
35 | 35 | <date/> |
|
36 | 36 | <paths> |
|
37 | 37 | <path |
|
38 | 38 | action="A">/a</path> |
|
39 | 39 | <path |
|
40 | 40 | action="A">/d1</path> |
|
41 | 41 | <path |
|
42 | 42 | action="A">/d1/d2</path> |
|
43 | 43 | <path |
|
44 | 44 | action="A">/d1/d2/b</path> |
|
45 | 45 | </paths> |
|
46 | 46 | <msg>add a file</msg> |
|
47 | 47 | </logentry> |
|
48 | 48 | </log> |
|
49 | 49 | a: |
|
50 | 50 | a |
|
51 | 51 | d1 |
|
52 | 52 | |
|
53 | 53 | a-hg-wc: |
|
54 | 54 | a |
|
55 | 55 | d1 |
|
56 | 56 | same |
|
57 | 57 | % rename |
|
58 | 58 | 2:7009fc4efb34 |
|
59 | 59 | assuming destination a-hg |
|
60 | 60 | initializing svn wc 'a-hg-wc' |
|
61 | 61 | scanning source... |
|
62 | 62 | sorting... |
|
63 | 63 | converting... |
|
64 | 64 | 0 rename a file |
|
65 | 65 | At revision 3. |
|
66 | 66 | 3 3 test . |
|
67 | 67 | 3 3 test b |
|
68 | 68 | 3 1 test d1 |
|
69 | 69 | 3 1 test d1/d2 |
|
70 | 70 | 3 1 test d1/d2/b |
|
71 | 71 | <?xml version="1.0"?> |
|
72 | 72 | <log> |
|
73 | 73 | <logentry |
|
74 | 74 | revision="3"> |
|
75 | 75 | <author>test</author> |
|
76 | 76 | <date/> |
|
77 | 77 | <paths> |
|
78 | 78 | <path |
|
79 | 79 | action="D">/a</path> |
|
80 | 80 | <path |
|
81 | 81 | copyfrom-path="/a" |
|
82 | 82 | copyfrom-rev="2" |
|
83 | 83 | action="A">/b</path> |
|
84 | 84 | </paths> |
|
85 | 85 | <msg>rename a file</msg> |
|
86 | 86 | </logentry> |
|
87 | 87 | </log> |
|
88 | 88 | a: |
|
89 | 89 | b |
|
90 | 90 | d1 |
|
91 | 91 | |
|
92 | 92 | a-hg-wc: |
|
93 | 93 | b |
|
94 | 94 | d1 |
|
95 | 95 | % copy |
|
96 | 96 | 3:56c519973ce6 |
|
97 | 97 | assuming destination a-hg |
|
98 | 98 | initializing svn wc 'a-hg-wc' |
|
99 | 99 | scanning source... |
|
100 | 100 | sorting... |
|
101 | 101 | converting... |
|
102 | 102 | 0 copy a file |
|
103 | 103 | At revision 4. |
|
104 | 104 | 4 4 test . |
|
105 | 105 | 4 3 test b |
|
106 | 106 | 4 4 test c |
|
107 | 107 | 4 1 test d1 |
|
108 | 108 | 4 1 test d1/d2 |
|
109 | 109 | 4 1 test d1/d2/b |
|
110 | 110 | <?xml version="1.0"?> |
|
111 | 111 | <log> |
|
112 | 112 | <logentry |
|
113 | 113 | revision="4"> |
|
114 | 114 | <author>test</author> |
|
115 | 115 | <date/> |
|
116 | 116 | <paths> |
|
117 | 117 | <path |
|
118 | 118 | copyfrom-path="/b" |
|
119 | 119 | copyfrom-rev="3" |
|
120 | 120 | action="A">/c</path> |
|
121 | 121 | </paths> |
|
122 | 122 | <msg>copy a file</msg> |
|
123 | 123 | </logentry> |
|
124 | 124 | </log> |
|
125 | 125 | a: |
|
126 | 126 | b |
|
127 | 127 | c |
|
128 | 128 | d1 |
|
129 | 129 | |
|
130 | 130 | a-hg-wc: |
|
131 | 131 | b |
|
132 | 132 | c |
|
133 | 133 | d1 |
|
134 | 134 | % remove |
|
135 | 135 | 4:ed4dc9a6f585 |
|
136 | 136 | assuming destination a-hg |
|
137 | 137 | initializing svn wc 'a-hg-wc' |
|
138 | 138 | scanning source... |
|
139 | 139 | sorting... |
|
140 | 140 | converting... |
|
141 | 141 | 0 remove a file |
|
142 | 142 | At revision 5. |
|
143 | 143 | 5 5 test . |
|
144 | 144 | 5 4 test c |
|
145 | 145 | 5 1 test d1 |
|
146 | 146 | 5 1 test d1/d2 |
|
147 | 147 | 5 1 test d1/d2/b |
|
148 | 148 | <?xml version="1.0"?> |
|
149 | 149 | <log> |
|
150 | 150 | <logentry |
|
151 | 151 | revision="5"> |
|
152 | 152 | <author>test</author> |
|
153 | 153 | <date/> |
|
154 | 154 | <paths> |
|
155 | 155 | <path |
|
156 | 156 | action="D">/b</path> |
|
157 | 157 | </paths> |
|
158 | 158 | <msg>remove a file</msg> |
|
159 | 159 | </logentry> |
|
160 | 160 | </log> |
|
161 | 161 | a: |
|
162 | 162 | c |
|
163 | 163 | d1 |
|
164 | 164 | |
|
165 | 165 | a-hg-wc: |
|
166 | 166 | c |
|
167 | 167 | d1 |
|
168 | 168 | % executable |
|
169 | 169 | 5:f205b3636d77 |
|
170 | 170 | assuming destination a-hg |
|
171 | 171 | initializing svn wc 'a-hg-wc' |
|
172 | 172 | scanning source... |
|
173 | 173 | sorting... |
|
174 | 174 | converting... |
|
175 | 175 | 0 make a file executable |
|
176 | 176 | At revision 6. |
|
177 | 177 | 6 6 test . |
|
178 | 178 | 6 6 test c |
|
179 | 179 | 6 1 test d1 |
|
180 | 180 | 6 1 test d1/d2 |
|
181 | 181 | 6 1 test d1/d2/b |
|
182 | 182 | <?xml version="1.0"?> |
|
183 | 183 | <log> |
|
184 | 184 | <logentry |
|
185 | 185 | revision="6"> |
|
186 | 186 | <author>test</author> |
|
187 | 187 | <date/> |
|
188 | 188 | <paths> |
|
189 | 189 | <path |
|
190 | 190 | action="M">/c</path> |
|
191 | 191 | </paths> |
|
192 | 192 | <msg>make a file executable</msg> |
|
193 | 193 | </logentry> |
|
194 | 194 | </log> |
|
195 | 195 | executable |
|
196 | 196 | % executable in new directory |
|
197 | 197 | adding d1/a |
|
198 | 198 | assuming destination a-hg |
|
199 | 199 | initializing svn repo 'a-hg' |
|
200 | 200 | initializing svn wc 'a-hg-wc' |
|
201 | 201 | scanning source... |
|
202 | 202 | sorting... |
|
203 | 203 | converting... |
|
204 | 204 | 0 add executable file in new directory |
|
205 | 205 | At revision 1. |
|
206 | 206 | 1 1 test . |
|
207 | 207 | 1 1 test d1 |
|
208 | 208 | 1 1 test d1/a |
|
209 | 209 | <?xml version="1.0"?> |
|
210 | 210 | <log> |
|
211 | 211 | <logentry |
|
212 | 212 | revision="1"> |
|
213 | 213 | <author>test</author> |
|
214 | 214 | <date/> |
|
215 | 215 | <paths> |
|
216 | 216 | <path |
|
217 | 217 | action="A">/d1</path> |
|
218 | 218 | <path |
|
219 | 219 | action="A">/d1/a</path> |
|
220 | 220 | </paths> |
|
221 | 221 | <msg>add executable file in new directory</msg> |
|
222 | 222 | </logentry> |
|
223 | 223 | </log> |
|
224 | 224 | executable |
|
225 | 225 | % copy to new directory |
|
226 | 226 | assuming destination a-hg |
|
227 | 227 | initializing svn wc 'a-hg-wc' |
|
228 | 228 | scanning source... |
|
229 | 229 | sorting... |
|
230 | 230 | converting... |
|
231 | 231 | 0 copy file to new directory |
|
232 | 232 | At revision 2. |
|
233 | 233 | 2 2 test . |
|
234 | 234 | 2 1 test d1 |
|
235 | 235 | 2 1 test d1/a |
|
236 | 236 | 2 2 test d2 |
|
237 | 237 | 2 2 test d2/a |
|
238 | 238 | <?xml version="1.0"?> |
|
239 | 239 | <log> |
|
240 | 240 | <logentry |
|
241 | 241 | revision="2"> |
|
242 | 242 | <author>test</author> |
|
243 | 243 | <date/> |
|
244 | 244 | <paths> |
|
245 | 245 | <path |
|
246 | 246 | action="A">/d2</path> |
|
247 | 247 | <path |
|
248 | 248 | copyfrom-path="/d1/a" |
|
249 | 249 | copyfrom-rev="1" |
|
250 | 250 | action="A">/d2/a</path> |
|
251 | 251 | </paths> |
|
252 | 252 | <msg>copy file to new directory</msg> |
|
253 | 253 | </logentry> |
|
254 | 254 | </log> |
|
255 | 255 | % branchy history |
|
256 | 256 | adding b |
|
257 | 257 | adding left-1 |
|
258 | 258 | adding left-2 |
|
259 | 259 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
260 | 260 | adding right-1 |
|
261 | 261 | created new head |
|
262 | 262 | adding right-2 |
|
263 | 263 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
264 | 264 | merging b |
|
265 | 265 | warning: conflicts during merge. |
|
266 | 266 | merging b failed! |
|
267 | 267 | 2 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
268 | use 'hg resolve' to retry unresolved file merges | |
|
268 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
269 | 269 | assuming destination b-hg |
|
270 | 270 | initializing svn repo 'b-hg' |
|
271 | 271 | initializing svn wc 'b-hg-wc' |
|
272 | 272 | scanning source... |
|
273 | 273 | sorting... |
|
274 | 274 | converting... |
|
275 | 275 | 5 base |
|
276 | 276 | 4 left-1 |
|
277 | 277 | 3 left-2 |
|
278 | 278 | 2 right-1 |
|
279 | 279 | 1 right-2 |
|
280 | 280 | 0 merge |
|
281 | 281 | % expect 4 changes |
|
282 | 282 | At revision 4. |
|
283 | 283 | 4 4 test . |
|
284 | 284 | 4 3 test b |
|
285 | 285 | 4 2 test left-1 |
|
286 | 286 | 4 3 test left-2 |
|
287 | 287 | 4 4 test right-1 |
|
288 | 288 | 4 4 test right-2 |
|
289 | 289 | <?xml version="1.0"?> |
|
290 | 290 | <log> |
|
291 | 291 | <logentry |
|
292 | 292 | revision="4"> |
|
293 | 293 | <author>test</author> |
|
294 | 294 | <date/> |
|
295 | 295 | <paths> |
|
296 | 296 | <path |
|
297 | 297 | action="A">/right-1</path> |
|
298 | 298 | <path |
|
299 | 299 | action="A">/right-2</path> |
|
300 | 300 | </paths> |
|
301 | 301 | <msg>merge</msg> |
|
302 | 302 | </logentry> |
|
303 | 303 | <logentry |
|
304 | 304 | revision="3"> |
|
305 | 305 | <author>test</author> |
|
306 | 306 | <date/> |
|
307 | 307 | <paths> |
|
308 | 308 | <path |
|
309 | 309 | action="M">/b</path> |
|
310 | 310 | <path |
|
311 | 311 | action="A">/left-2</path> |
|
312 | 312 | </paths> |
|
313 | 313 | <msg>left-2</msg> |
|
314 | 314 | </logentry> |
|
315 | 315 | <logentry |
|
316 | 316 | revision="2"> |
|
317 | 317 | <author>test</author> |
|
318 | 318 | <date/> |
|
319 | 319 | <paths> |
|
320 | 320 | <path |
|
321 | 321 | action="M">/b</path> |
|
322 | 322 | <path |
|
323 | 323 | action="A">/left-1</path> |
|
324 | 324 | </paths> |
|
325 | 325 | <msg>left-1</msg> |
|
326 | 326 | </logentry> |
|
327 | 327 | <logentry |
|
328 | 328 | revision="1"> |
|
329 | 329 | <author>test</author> |
|
330 | 330 | <date/> |
|
331 | 331 | <paths> |
|
332 | 332 | <path |
|
333 | 333 | action="A">/b</path> |
|
334 | 334 | </paths> |
|
335 | 335 | <msg>base</msg> |
|
336 | 336 | </logentry> |
|
337 | 337 | </log> |
@@ -1,502 +1,502 b'' | |||
|
1 | 1 | % help |
|
2 | 2 | keyword extension - keyword expansion in local repositories |
|
3 | 3 | |
|
4 | 4 | This extension expands RCS/CVS-like or self-customized $Keywords$ |
|
5 | 5 | in tracked text files selected by your configuration. |
|
6 | 6 | |
|
7 | 7 | Keywords are only expanded in local repositories and not stored in |
|
8 | 8 | the change history. The mechanism can be regarded as a convenience |
|
9 | 9 | for the current user or for archive distribution. |
|
10 | 10 | |
|
11 | 11 | Configuration is done in the [keyword] and [keywordmaps] sections |
|
12 | 12 | of hgrc files. |
|
13 | 13 | |
|
14 | 14 | Example: |
|
15 | 15 | |
|
16 | 16 | [keyword] |
|
17 | 17 | # expand keywords in every python file except those matching "x*" |
|
18 | 18 | **.py = |
|
19 | 19 | x* = ignore |
|
20 | 20 | |
|
21 | 21 | Note: the more specific you are in your filename patterns |
|
22 | 22 | the less you lose speed in huge repos. |
|
23 | 23 | |
|
24 | 24 | For [keywordmaps] template mapping and expansion demonstration and |
|
25 | 25 | control run "hg kwdemo". |
|
26 | 26 | |
|
27 | 27 | An additional date template filter {date|utcdate} is provided. |
|
28 | 28 | |
|
29 | 29 | The default template mappings (view with "hg kwdemo -d") can be replaced |
|
30 | 30 | with customized keywords and templates. |
|
31 | 31 | Again, run "hg kwdemo" to control the results of your config changes. |
|
32 | 32 | |
|
33 | 33 | Before changing/disabling active keywords, run "hg kwshrink" to avoid |
|
34 | 34 | the risk of inadvertedly storing expanded keywords in the change history. |
|
35 | 35 | |
|
36 | 36 | To force expansion after enabling it, or a configuration change, run |
|
37 | 37 | "hg kwexpand". |
|
38 | 38 | |
|
39 | 39 | Also, when committing with the record extension or using mq's qrecord, be aware |
|
40 | 40 | that keywords cannot be updated. Again, run "hg kwexpand" on the files in |
|
41 | 41 | question to update keyword expansions after all changes have been checked in. |
|
42 | 42 | |
|
43 | 43 | Expansions spanning more than one line and incremental expansions, |
|
44 | 44 | like CVS' $Log$, are not supported. A keyword template map |
|
45 | 45 | "Log = {desc}" expands to the first line of the changeset description. |
|
46 | 46 | |
|
47 | 47 | list of commands: |
|
48 | 48 | |
|
49 | 49 | kwdemo print [keywordmaps] configuration and an expansion example |
|
50 | 50 | kwexpand expand keywords in working directory |
|
51 | 51 | kwfiles print files currently configured for keyword expansion |
|
52 | 52 | kwshrink revert expanded keywords in working directory |
|
53 | 53 | |
|
54 | 54 | enabled extensions: |
|
55 | 55 | |
|
56 | 56 | keyword keyword expansion in local repositories |
|
57 | 57 | mq patch management and development |
|
58 | 58 | notify hook extension to email notifications on commits/pushes |
|
59 | 59 | |
|
60 | 60 | use "hg -v help keyword" to show aliases and global options |
|
61 | 61 | % hg kwdemo |
|
62 | 62 | [extensions] |
|
63 | 63 | hgext.keyword = |
|
64 | 64 | [keyword] |
|
65 | 65 | * = |
|
66 | 66 | b = ignore |
|
67 | 67 | demo.txt = |
|
68 | 68 | [keywordmaps] |
|
69 | 69 | RCSFile = {file|basename},v |
|
70 | 70 | Author = {author|user} |
|
71 | 71 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
|
72 | 72 | Source = {root}/{file},v |
|
73 | 73 | Date = {date|utcdate} |
|
74 | 74 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
|
75 | 75 | Revision = {node|short} |
|
76 | 76 | $RCSFile: demo.txt,v $ |
|
77 | 77 | $Author: test $ |
|
78 | 78 | $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ |
|
79 | 79 | $Source: /TMP/demo.txt,v $ |
|
80 | 80 | $Date: 2000/00/00 00:00:00 $ |
|
81 | 81 | $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ |
|
82 | 82 | $Revision: xxxxxxxxxxxx $ |
|
83 | 83 | [extensions] |
|
84 | 84 | hgext.keyword = |
|
85 | 85 | [keyword] |
|
86 | 86 | * = |
|
87 | 87 | b = ignore |
|
88 | 88 | demo.txt = |
|
89 | 89 | [keywordmaps] |
|
90 | 90 | Branch = {branches} |
|
91 | 91 | $Branch: demobranch $ |
|
92 | 92 | % kwshrink should exit silently in empty/invalid repo |
|
93 | 93 | pulling from test-keyword.hg |
|
94 | 94 | requesting all changes |
|
95 | 95 | adding changesets |
|
96 | 96 | adding manifests |
|
97 | 97 | adding file changes |
|
98 | 98 | added 1 changesets with 1 changes to 1 files |
|
99 | 99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 100 | % cat |
|
101 | 101 | expand $Id$ |
|
102 | 102 | do not process $Id: |
|
103 | 103 | xxx $ |
|
104 | 104 | ignore $Id$ |
|
105 | 105 | % addremove |
|
106 | 106 | adding a |
|
107 | 107 | adding b |
|
108 | 108 | % status |
|
109 | 109 | A a |
|
110 | 110 | A b |
|
111 | 111 | % default keyword expansion including commit hook |
|
112 | 112 | % interrupted commit should not change state or run commit hook |
|
113 | 113 | a |
|
114 | 114 | b |
|
115 | 115 | transaction abort! |
|
116 | 116 | rollback completed |
|
117 | 117 | abort: empty commit message |
|
118 | 118 | % status |
|
119 | 119 | A a |
|
120 | 120 | A b |
|
121 | 121 | % commit |
|
122 | 122 | a |
|
123 | 123 | b |
|
124 | 124 | overwriting a expanding keywords |
|
125 | 125 | running hook commit.test: cp a hooktest |
|
126 | 126 | committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
127 | 127 | % status |
|
128 | 128 | ? hooktest |
|
129 | 129 | % identify |
|
130 | 130 | ef63ca68695b |
|
131 | 131 | % cat |
|
132 | 132 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
133 | 133 | do not process $Id: |
|
134 | 134 | xxx $ |
|
135 | 135 | ignore $Id$ |
|
136 | 136 | % hg cat |
|
137 | 137 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
138 | 138 | do not process $Id: |
|
139 | 139 | xxx $ |
|
140 | 140 | ignore $Id$ |
|
141 | 141 | a |
|
142 | 142 | % diff a hooktest |
|
143 | 143 | % removing commit hook from config |
|
144 | 144 | % bundle |
|
145 | 145 | 2 changesets found |
|
146 | 146 | % notify on pull to check whether keywords stay as is in email |
|
147 | 147 | % ie. if patch.diff wrapper acts as it should |
|
148 | 148 | % pull from bundle |
|
149 | 149 | pulling from ../kw.hg |
|
150 | 150 | requesting all changes |
|
151 | 151 | adding changesets |
|
152 | 152 | adding manifests |
|
153 | 153 | adding file changes |
|
154 | 154 | added 2 changesets with 3 changes to 3 files |
|
155 | 155 | |
|
156 | 156 | diff -r 000000000000 -r a2392c293916 sym |
|
157 | 157 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
158 | 158 | +++ b/sym Sat Feb 09 20:25:47 2008 +0100 |
|
159 | 159 | @@ -0,0 +1,1 @@ |
|
160 | 160 | +a |
|
161 | 161 | \ No newline at end of file |
|
162 | 162 | |
|
163 | 163 | diff -r a2392c293916 -r ef63ca68695b a |
|
164 | 164 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
165 | 165 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 |
|
166 | 166 | @@ -0,0 +1,3 @@ |
|
167 | 167 | +expand $Id$ |
|
168 | 168 | +do not process $Id: |
|
169 | 169 | +xxx $ |
|
170 | 170 | diff -r a2392c293916 -r ef63ca68695b b |
|
171 | 171 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
172 | 172 | +++ b/b Thu Jan 01 00:00:00 1970 +0000 |
|
173 | 173 | @@ -0,0 +1,1 @@ |
|
174 | 174 | +ignore $Id$ |
|
175 | 175 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
176 | 176 | % remove notify config |
|
177 | 177 | % touch |
|
178 | 178 | % status |
|
179 | 179 | % update |
|
180 | 180 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
181 | 181 | % cat |
|
182 | 182 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
183 | 183 | do not process $Id: |
|
184 | 184 | xxx $ |
|
185 | 185 | ignore $Id$ |
|
186 | 186 | % check whether expansion is filewise |
|
187 | 187 | % commit c |
|
188 | 188 | adding c |
|
189 | 189 | % force expansion |
|
190 | 190 | overwriting a expanding keywords |
|
191 | 191 | overwriting c expanding keywords |
|
192 | 192 | % compare changenodes in a c |
|
193 | 193 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
194 | 194 | do not process $Id: |
|
195 | 195 | xxx $ |
|
196 | 196 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
197 | 197 | tests for different changenodes |
|
198 | 198 | % qinit -c |
|
199 | 199 | % qimport |
|
200 | 200 | % qcommit |
|
201 | 201 | % keywords should not be expanded in patch |
|
202 | 202 | # HG changeset patch |
|
203 | 203 | # User User Name <user@example.com> |
|
204 | 204 | # Date 1 0 |
|
205 | 205 | # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad |
|
206 | 206 | # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 |
|
207 | 207 | cndiff |
|
208 | 208 | |
|
209 | 209 | diff -r ef63ca68695b -r 40a904bbbe4c c |
|
210 | 210 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
211 | 211 | +++ b/c Thu Jan 01 00:00:01 1970 +0000 |
|
212 | 212 | @@ -0,0 +1,2 @@ |
|
213 | 213 | +$Id$ |
|
214 | 214 | +tests for different changenodes |
|
215 | 215 | % qpop |
|
216 | 216 | patch queue now empty |
|
217 | 217 | % qgoto - should imply qpush |
|
218 | 218 | applying mqtest.diff |
|
219 | 219 | now at: mqtest.diff |
|
220 | 220 | % cat |
|
221 | 221 | $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
|
222 | 222 | tests for different changenodes |
|
223 | 223 | % qpop and move on |
|
224 | 224 | patch queue now empty |
|
225 | 225 | % copy |
|
226 | 226 | % kwfiles added |
|
227 | 227 | a |
|
228 | 228 | c |
|
229 | 229 | % commit |
|
230 | 230 | c |
|
231 | 231 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
|
232 | 232 | overwriting c expanding keywords |
|
233 | 233 | committed changeset 2:e22d299ac0c2bd8897b3df5114374b9e4d4ca62f |
|
234 | 234 | % cat a c |
|
235 | 235 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
236 | 236 | do not process $Id: |
|
237 | 237 | xxx $ |
|
238 | 238 | expand $Id: c,v e22d299ac0c2 1970/01/01 00:00:01 user $ |
|
239 | 239 | do not process $Id: |
|
240 | 240 | xxx $ |
|
241 | 241 | % touch copied c |
|
242 | 242 | % status |
|
243 | 243 | % kwfiles |
|
244 | 244 | a |
|
245 | 245 | c |
|
246 | 246 | % diff --rev |
|
247 | 247 | diff -r ef63ca68695b c |
|
248 | 248 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
249 | 249 | @@ -0,0 +1,3 @@ |
|
250 | 250 | +expand $Id$ |
|
251 | 251 | +do not process $Id: |
|
252 | 252 | +xxx $ |
|
253 | 253 | % rollback |
|
254 | 254 | rolling back last transaction |
|
255 | 255 | % status |
|
256 | 256 | A c |
|
257 | 257 | % update -C |
|
258 | 258 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
259 | 259 | % custom keyword expansion |
|
260 | 260 | % try with kwdemo |
|
261 | 261 | [extensions] |
|
262 | 262 | hgext.keyword = |
|
263 | 263 | [keyword] |
|
264 | 264 | * = |
|
265 | 265 | b = ignore |
|
266 | 266 | demo.txt = |
|
267 | 267 | [keywordmaps] |
|
268 | 268 | Xinfo = {author}: {desc} |
|
269 | 269 | $Xinfo: test: hg keyword config and expansion example $ |
|
270 | 270 | % cat |
|
271 | 271 | expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
|
272 | 272 | do not process $Id: |
|
273 | 273 | xxx $ |
|
274 | 274 | ignore $Id$ |
|
275 | 275 | % hg cat |
|
276 | 276 | expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ |
|
277 | 277 | do not process $Id: |
|
278 | 278 | xxx $ |
|
279 | 279 | ignore $Id$ |
|
280 | 280 | a |
|
281 | 281 | % interrupted commit should not change state |
|
282 | 282 | transaction abort! |
|
283 | 283 | rollback completed |
|
284 | 284 | abort: empty commit message |
|
285 | 285 | % status |
|
286 | 286 | M a |
|
287 | 287 | ? log |
|
288 | 288 | % commit |
|
289 | 289 | a |
|
290 | 290 | overwriting a expanding keywords |
|
291 | 291 | committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
292 | 292 | % status |
|
293 | 293 | % verify |
|
294 | 294 | checking changesets |
|
295 | 295 | checking manifests |
|
296 | 296 | crosschecking files in changesets and manifests |
|
297 | 297 | checking files |
|
298 | 298 | 3 files, 3 changesets, 4 total revisions |
|
299 | 299 | % cat |
|
300 | 300 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
301 | 301 | do not process $Id: |
|
302 | 302 | xxx $ |
|
303 | 303 | $Xinfo: User Name <user@example.com>: firstline $ |
|
304 | 304 | ignore $Id$ |
|
305 | 305 | % hg cat |
|
306 | 306 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
307 | 307 | do not process $Id: |
|
308 | 308 | xxx $ |
|
309 | 309 | $Xinfo: User Name <user@example.com>: firstline $ |
|
310 | 310 | ignore $Id$ |
|
311 | 311 | a |
|
312 | 312 | % annotate |
|
313 | 313 | 1: expand $Id$ |
|
314 | 314 | 1: do not process $Id: |
|
315 | 315 | 1: xxx $ |
|
316 | 316 | 2: $Xinfo$ |
|
317 | 317 | % remove |
|
318 | 318 | committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 |
|
319 | 319 | % status |
|
320 | 320 | % rollback |
|
321 | 321 | rolling back last transaction |
|
322 | 322 | % status |
|
323 | 323 | R a |
|
324 | 324 | % revert a |
|
325 | 325 | % cat a |
|
326 | 326 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
327 | 327 | do not process $Id: |
|
328 | 328 | xxx $ |
|
329 | 329 | $Xinfo: User Name <user@example.com>: firstline $ |
|
330 | 330 | % clone to test incoming |
|
331 | 331 | requesting all changes |
|
332 | 332 | adding changesets |
|
333 | 333 | adding manifests |
|
334 | 334 | adding file changes |
|
335 | 335 | added 2 changesets with 3 changes to 3 files |
|
336 | 336 | updating working directory |
|
337 | 337 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
338 | 338 | % incoming |
|
339 | 339 | comparing with test-keyword/Test |
|
340 | 340 | searching for changes |
|
341 | 341 | changeset: 2:bb948857c743 |
|
342 | 342 | tag: tip |
|
343 | 343 | user: User Name <user@example.com> |
|
344 | 344 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
345 | 345 | summary: firstline |
|
346 | 346 | |
|
347 | 347 | % commit rejecttest |
|
348 | 348 | a |
|
349 | 349 | overwriting a expanding keywords |
|
350 | 350 | committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 |
|
351 | 351 | % export |
|
352 | 352 | % import |
|
353 | 353 | applying ../rejecttest.diff |
|
354 | 354 | % cat |
|
355 | 355 | expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
|
356 | 356 | do not process $Id: rejecttest |
|
357 | 357 | xxx $ |
|
358 | 358 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
359 | 359 | ignore $Id$ |
|
360 | 360 | |
|
361 | 361 | % rollback |
|
362 | 362 | rolling back last transaction |
|
363 | 363 | % clean update |
|
364 | 364 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
365 | 365 | % kwexpand/kwshrink on selected files |
|
366 | 366 | % copy a x/a |
|
367 | 367 | % kwexpand a |
|
368 | 368 | overwriting a expanding keywords |
|
369 | 369 | % kwexpand x/a should abort |
|
370 | 370 | abort: outstanding uncommitted changes |
|
371 | 371 | x/a |
|
372 | 372 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
|
373 | 373 | overwriting x/a expanding keywords |
|
374 | 374 | committed changeset 3:cfa68229c1167443337266ebac453c73b1d5d16e |
|
375 | 375 | % cat a |
|
376 | 376 | expand $Id: x/a cfa68229c116 Thu, 01 Jan 1970 00:00:03 +0000 user $ |
|
377 | 377 | do not process $Id: |
|
378 | 378 | xxx $ |
|
379 | 379 | $Xinfo: User Name <user@example.com>: xa $ |
|
380 | 380 | % kwshrink a inside directory x |
|
381 | 381 | overwriting x/a shrinking keywords |
|
382 | 382 | % cat a |
|
383 | 383 | expand $Id$ |
|
384 | 384 | do not process $Id: |
|
385 | 385 | xxx $ |
|
386 | 386 | $Xinfo$ |
|
387 | 387 | % kwexpand nonexistent |
|
388 | 388 | nonexistent: |
|
389 | 389 | % hg serve |
|
390 | 390 | % expansion |
|
391 | 391 | % hgweb file |
|
392 | 392 | 200 Script output follows |
|
393 | 393 | |
|
394 | 394 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
395 | 395 | do not process $Id: |
|
396 | 396 | xxx $ |
|
397 | 397 | $Xinfo: User Name <user@example.com>: firstline $ |
|
398 | 398 | % no expansion |
|
399 | 399 | % hgweb annotate |
|
400 | 400 | 200 Script output follows |
|
401 | 401 | |
|
402 | 402 | |
|
403 | 403 | user@1: expand $Id$ |
|
404 | 404 | user@1: do not process $Id: |
|
405 | 405 | user@1: xxx $ |
|
406 | 406 | user@2: $Xinfo$ |
|
407 | 407 | |
|
408 | 408 | |
|
409 | 409 | |
|
410 | 410 | |
|
411 | 411 | % hgweb changeset |
|
412 | 412 | 200 Script output follows |
|
413 | 413 | |
|
414 | 414 | |
|
415 | 415 | # HG changeset patch |
|
416 | 416 | # User User Name <user@example.com> |
|
417 | 417 | # Date 3 0 |
|
418 | 418 | # Node ID cfa68229c1167443337266ebac453c73b1d5d16e |
|
419 | 419 | # Parent bb948857c743469b22bbf51f7ec8112279ca5d83 |
|
420 | 420 | xa |
|
421 | 421 | |
|
422 | 422 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
423 | 423 | +++ b/x/a Thu Jan 01 00:00:03 1970 +0000 |
|
424 | 424 | @@ -0,0 +1,4 @@ |
|
425 | 425 | +expand $Id$ |
|
426 | 426 | +do not process $Id: |
|
427 | 427 | +xxx $ |
|
428 | 428 | +$Xinfo$ |
|
429 | 429 | |
|
430 | 430 | % hgweb filediff |
|
431 | 431 | 200 Script output follows |
|
432 | 432 | |
|
433 | 433 | |
|
434 | 434 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
435 | 435 | +++ b/a Thu Jan 01 00:00:02 1970 +0000 |
|
436 | 436 | @@ -1,3 +1,4 @@ |
|
437 | 437 | expand $Id$ |
|
438 | 438 | do not process $Id: |
|
439 | 439 | xxx $ |
|
440 | 440 | +$Xinfo$ |
|
441 | 441 | |
|
442 | 442 | |
|
443 | 443 | |
|
444 | 444 | |
|
445 | 445 | % errors encountered |
|
446 | 446 | % merge/resolve |
|
447 | 447 | % simplemerge |
|
448 | 448 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
449 | 449 | created new head |
|
450 | 450 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
451 | 451 | (branch merge, don't forget to commit) |
|
452 | 452 | $Id: m 8731e1dadc99 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
453 | 453 | foo |
|
454 | 454 | % conflict |
|
455 | 455 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
456 | 456 | created new head |
|
457 | 457 | merging m |
|
458 | 458 | warning: conflicts during merge. |
|
459 | 459 | merging m failed! |
|
460 | 460 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
461 | use 'hg resolve' to retry unresolved file merges | |
|
461 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
462 | 462 | % keyword stays outside conflict zone |
|
463 | 463 | $Id$ |
|
464 | 464 | <<<<<<< local |
|
465 | 465 | bar |
|
466 | 466 | ======= |
|
467 | 467 | foo |
|
468 | 468 | >>>>>>> other |
|
469 | 469 | % resolve to local |
|
470 | 470 | $Id: m 43dfd2854b5b Thu, 01 Jan 1970 00:00:00 +0000 test $ |
|
471 | 471 | bar |
|
472 | 472 | % switch off expansion |
|
473 | 473 | % kwshrink with unknown file u |
|
474 | 474 | overwriting a shrinking keywords |
|
475 | 475 | overwriting m shrinking keywords |
|
476 | 476 | overwriting x/a shrinking keywords |
|
477 | 477 | % cat |
|
478 | 478 | expand $Id$ |
|
479 | 479 | do not process $Id: |
|
480 | 480 | xxx $ |
|
481 | 481 | $Xinfo$ |
|
482 | 482 | ignore $Id$ |
|
483 | 483 | % hg cat |
|
484 | 484 | expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
485 | 485 | do not process $Id: |
|
486 | 486 | xxx $ |
|
487 | 487 | $Xinfo: User Name <user@example.com>: firstline $ |
|
488 | 488 | ignore $Id$ |
|
489 | 489 | a |
|
490 | 490 | % cat |
|
491 | 491 | expand $Id$ |
|
492 | 492 | do not process $Id: |
|
493 | 493 | xxx $ |
|
494 | 494 | $Xinfo$ |
|
495 | 495 | ignore $Id$ |
|
496 | 496 | % hg cat |
|
497 | 497 | expand $Id$ |
|
498 | 498 | do not process $Id: |
|
499 | 499 | xxx $ |
|
500 | 500 | $Xinfo$ |
|
501 | 501 | ignore $Id$ |
|
502 | 502 | a |
@@ -1,41 +1,41 b'' | |||
|
1 | 1 | # initial file contents |
|
2 | 2 | adding f |
|
3 | 3 | line 1 |
|
4 | 4 | line 2 |
|
5 | 5 | line 3 |
|
6 | 6 | # branch 1: editing line 1 |
|
7 | 7 | # branch 2: editing line 3 |
|
8 | 8 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
9 | 9 | created new head |
|
10 | 10 | # merge using internal:fail tool |
|
11 | 11 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
12 | use 'hg resolve' to retry unresolved file merges | |
|
12 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
13 | 13 | line 1 |
|
14 | 14 | line 2 |
|
15 | 15 | third line |
|
16 | 16 | M f |
|
17 | 17 | # merge using internal:local tool |
|
18 | 18 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
19 | 19 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
20 | 20 | (branch merge, don't forget to commit) |
|
21 | 21 | line 1 |
|
22 | 22 | line 2 |
|
23 | 23 | third line |
|
24 | 24 | M f |
|
25 | 25 | # merge using internal:other tool |
|
26 | 26 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
27 | 27 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
28 | 28 | (branch merge, don't forget to commit) |
|
29 | 29 | first line |
|
30 | 30 | line 2 |
|
31 | 31 | line 3 |
|
32 | 32 | M f |
|
33 | 33 | # merge using default tool |
|
34 | 34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
35 | 35 | merging f |
|
36 | 36 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
37 | 37 | (branch merge, don't forget to commit) |
|
38 | 38 | first line |
|
39 | 39 | line 2 |
|
40 | 40 | third line |
|
41 | 41 | M f |
@@ -1,395 +1,395 b'' | |||
|
1 | 1 | # revision 0 |
|
2 | 2 | adding f |
|
3 | 3 | # revision 1 |
|
4 | 4 | # revision 2 |
|
5 | 5 | created new head |
|
6 | 6 | # revision 3 - simple to merge |
|
7 | 7 | created new head |
|
8 | 8 | |
|
9 | 9 | |
|
10 | 10 | Tool selection |
|
11 | 11 | |
|
12 | 12 | # default is internal merge: |
|
13 | 13 | [merge-tools] |
|
14 | 14 | # hg update -C 1 |
|
15 | 15 | # hg merge -r 2 |
|
16 | 16 | merging f |
|
17 | 17 | warning: conflicts during merge. |
|
18 | 18 | merging f failed! |
|
19 | 19 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
20 | use 'hg resolve' to retry unresolved file merges | |
|
20 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
21 | 21 | # cat f |
|
22 | 22 | <<<<<<< local |
|
23 | 23 | revision 1 |
|
24 | 24 | ======= |
|
25 | 25 | revision 2 |
|
26 | 26 | >>>>>>> other |
|
27 | 27 | space |
|
28 | 28 | # hg stat |
|
29 | 29 | M f |
|
30 | 30 | ? f.orig |
|
31 | 31 | |
|
32 | 32 | # simplest hgrc using false for merge: |
|
33 | 33 | [merge-tools] |
|
34 | 34 | false.whatever= |
|
35 | 35 | # hg update -C 1 |
|
36 | 36 | # hg merge -r 2 |
|
37 | 37 | merging f |
|
38 | 38 | merging f failed! |
|
39 | 39 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
40 | use 'hg resolve' to retry unresolved file merges | |
|
40 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
41 | 41 | # cat f |
|
42 | 42 | revision 1 |
|
43 | 43 | space |
|
44 | 44 | # hg stat |
|
45 | 45 | M f |
|
46 | 46 | ? f.orig |
|
47 | 47 | |
|
48 | 48 | # true with higher .priority gets precedence: |
|
49 | 49 | [merge-tools] |
|
50 | 50 | false.whatever= |
|
51 | 51 | true.priority=1 |
|
52 | 52 | # hg update -C 1 |
|
53 | 53 | # hg merge -r 2 |
|
54 | 54 | merging f |
|
55 | 55 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
56 | 56 | (branch merge, don't forget to commit) |
|
57 | 57 | # cat f |
|
58 | 58 | revision 1 |
|
59 | 59 | space |
|
60 | 60 | # hg stat |
|
61 | 61 | M f |
|
62 | 62 | |
|
63 | 63 | # unless lowered on command line: |
|
64 | 64 | [merge-tools] |
|
65 | 65 | false.whatever= |
|
66 | 66 | true.priority=1 |
|
67 | 67 | # hg update -C 1 |
|
68 | 68 | # hg merge -r 2 --config merge-tools.true.priority=-7 |
|
69 | 69 | merging f |
|
70 | 70 | merging f failed! |
|
71 | 71 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
72 | use 'hg resolve' to retry unresolved file merges | |
|
72 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
73 | 73 | # cat f |
|
74 | 74 | revision 1 |
|
75 | 75 | space |
|
76 | 76 | # hg stat |
|
77 | 77 | M f |
|
78 | 78 | ? f.orig |
|
79 | 79 | |
|
80 | 80 | # or false set higher on command line: |
|
81 | 81 | [merge-tools] |
|
82 | 82 | false.whatever= |
|
83 | 83 | true.priority=1 |
|
84 | 84 | # hg update -C 1 |
|
85 | 85 | # hg merge -r 2 --config merge-tools.false.priority=117 |
|
86 | 86 | merging f |
|
87 | 87 | merging f failed! |
|
88 | 88 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
89 | use 'hg resolve' to retry unresolved file merges | |
|
89 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
90 | 90 | # cat f |
|
91 | 91 | revision 1 |
|
92 | 92 | space |
|
93 | 93 | # hg stat |
|
94 | 94 | M f |
|
95 | 95 | ? f.orig |
|
96 | 96 | |
|
97 | 97 | # or true.executable not found in PATH: |
|
98 | 98 | [merge-tools] |
|
99 | 99 | false.whatever= |
|
100 | 100 | true.priority=1 |
|
101 | 101 | # hg update -C 1 |
|
102 | 102 | # hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool |
|
103 | 103 | merging f |
|
104 | 104 | merging f failed! |
|
105 | 105 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
106 | use 'hg resolve' to retry unresolved file merges | |
|
106 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
107 | 107 | # cat f |
|
108 | 108 | revision 1 |
|
109 | 109 | space |
|
110 | 110 | # hg stat |
|
111 | 111 | M f |
|
112 | 112 | ? f.orig |
|
113 | 113 | |
|
114 | 114 | # or true.executable with bogus path: |
|
115 | 115 | [merge-tools] |
|
116 | 116 | false.whatever= |
|
117 | 117 | true.priority=1 |
|
118 | 118 | # hg update -C 1 |
|
119 | 119 | # hg merge -r 2 --config merge-tools.true.executable=/bin/nonexistingmergetool |
|
120 | 120 | merging f |
|
121 | 121 | merging f failed! |
|
122 | 122 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
123 | use 'hg resolve' to retry unresolved file merges | |
|
123 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
124 | 124 | # cat f |
|
125 | 125 | revision 1 |
|
126 | 126 | space |
|
127 | 127 | # hg stat |
|
128 | 128 | M f |
|
129 | 129 | ? f.orig |
|
130 | 130 | |
|
131 | 131 | # but true.executable set to cat found in PATH works: |
|
132 | 132 | [merge-tools] |
|
133 | 133 | false.whatever= |
|
134 | 134 | true.priority=1 |
|
135 | 135 | true.executable=cat |
|
136 | 136 | # hg update -C 1 |
|
137 | 137 | # hg merge -r 2 |
|
138 | 138 | revision 1 |
|
139 | 139 | space |
|
140 | 140 | revision 0 |
|
141 | 141 | space |
|
142 | 142 | revision 2 |
|
143 | 143 | space |
|
144 | 144 | merging f |
|
145 | 145 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
146 | 146 | (branch merge, don't forget to commit) |
|
147 | 147 | # cat f |
|
148 | 148 | revision 1 |
|
149 | 149 | space |
|
150 | 150 | # hg stat |
|
151 | 151 | M f |
|
152 | 152 | |
|
153 | 153 | # and true.executable set to cat with path works: |
|
154 | 154 | [merge-tools] |
|
155 | 155 | false.whatever= |
|
156 | 156 | true.priority=1 |
|
157 | 157 | true.executable=cat |
|
158 | 158 | # hg update -C 1 |
|
159 | 159 | # hg merge -r 2 --config merge-tools.true.executable=/bin/cat |
|
160 | 160 | revision 1 |
|
161 | 161 | space |
|
162 | 162 | revision 0 |
|
163 | 163 | space |
|
164 | 164 | revision 2 |
|
165 | 165 | space |
|
166 | 166 | merging f |
|
167 | 167 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
168 | 168 | (branch merge, don't forget to commit) |
|
169 | 169 | # cat f |
|
170 | 170 | revision 1 |
|
171 | 171 | space |
|
172 | 172 | # hg stat |
|
173 | 173 | M f |
|
174 | 174 | |
|
175 | 175 | |
|
176 | 176 | Tool selection and merge-patterns |
|
177 | 177 | |
|
178 | 178 | # merge-patterns specifies new tool false: |
|
179 | 179 | [merge-tools] |
|
180 | 180 | false.whatever= |
|
181 | 181 | true.priority=1 |
|
182 | 182 | true.executable=cat |
|
183 | 183 | # hg update -C 1 |
|
184 | 184 | # hg merge -r 2 --config merge-patterns.f=false |
|
185 | 185 | merging f |
|
186 | 186 | merging f failed! |
|
187 | 187 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
188 | use 'hg resolve' to retry unresolved file merges | |
|
188 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
189 | 189 | # cat f |
|
190 | 190 | revision 1 |
|
191 | 191 | space |
|
192 | 192 | # hg stat |
|
193 | 193 | M f |
|
194 | 194 | ? f.orig |
|
195 | 195 | |
|
196 | 196 | # merge-patterns specifies executable not found in PATH and gets warning: |
|
197 | 197 | [merge-tools] |
|
198 | 198 | false.whatever= |
|
199 | 199 | true.priority=1 |
|
200 | 200 | true.executable=cat |
|
201 | 201 | # hg update -C 1 |
|
202 | 202 | # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool |
|
203 | 203 | couldn't find merge tool true specified for f |
|
204 | 204 | merging f |
|
205 | 205 | merging f failed! |
|
206 | 206 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
207 | use 'hg resolve' to retry unresolved file merges | |
|
207 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
208 | 208 | # cat f |
|
209 | 209 | revision 1 |
|
210 | 210 | space |
|
211 | 211 | # hg stat |
|
212 | 212 | M f |
|
213 | 213 | ? f.orig |
|
214 | 214 | |
|
215 | 215 | # merge-patterns specifies executable with bogus path and gets warning: |
|
216 | 216 | [merge-tools] |
|
217 | 217 | false.whatever= |
|
218 | 218 | true.priority=1 |
|
219 | 219 | true.executable=cat |
|
220 | 220 | # hg update -C 1 |
|
221 | 221 | # hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/bin/nonexistingmergetool |
|
222 | 222 | couldn't find merge tool true specified for f |
|
223 | 223 | merging f |
|
224 | 224 | merging f failed! |
|
225 | 225 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
226 | use 'hg resolve' to retry unresolved file merges | |
|
226 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
227 | 227 | # cat f |
|
228 | 228 | revision 1 |
|
229 | 229 | space |
|
230 | 230 | # hg stat |
|
231 | 231 | M f |
|
232 | 232 | ? f.orig |
|
233 | 233 | |
|
234 | 234 | |
|
235 | 235 | Premerge |
|
236 | 236 | |
|
237 | 237 | # Default is silent simplemerge: |
|
238 | 238 | [merge-tools] |
|
239 | 239 | false.whatever= |
|
240 | 240 | true.priority=1 |
|
241 | 241 | true.executable=cat |
|
242 | 242 | # hg update -C 1 |
|
243 | 243 | # hg merge -r 3 |
|
244 | 244 | merging f |
|
245 | 245 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
246 | 246 | (branch merge, don't forget to commit) |
|
247 | 247 | # cat f |
|
248 | 248 | revision 1 |
|
249 | 249 | space |
|
250 | 250 | revision 3 |
|
251 | 251 | # hg stat |
|
252 | 252 | M f |
|
253 | 253 | |
|
254 | 254 | # .premerge=True is same: |
|
255 | 255 | [merge-tools] |
|
256 | 256 | false.whatever= |
|
257 | 257 | true.priority=1 |
|
258 | 258 | true.executable=cat |
|
259 | 259 | # hg update -C 1 |
|
260 | 260 | # hg merge -r 3 --config merge-tools.true.premerge=True |
|
261 | 261 | merging f |
|
262 | 262 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
263 | 263 | (branch merge, don't forget to commit) |
|
264 | 264 | # cat f |
|
265 | 265 | revision 1 |
|
266 | 266 | space |
|
267 | 267 | revision 3 |
|
268 | 268 | # hg stat |
|
269 | 269 | M f |
|
270 | 270 | |
|
271 | 271 | # .premerge=False executes merge-tool: |
|
272 | 272 | [merge-tools] |
|
273 | 273 | false.whatever= |
|
274 | 274 | true.priority=1 |
|
275 | 275 | true.executable=cat |
|
276 | 276 | # hg update -C 1 |
|
277 | 277 | # hg merge -r 3 --config merge-tools.true.premerge=False |
|
278 | 278 | revision 1 |
|
279 | 279 | space |
|
280 | 280 | revision 0 |
|
281 | 281 | space |
|
282 | 282 | revision 0 |
|
283 | 283 | space |
|
284 | 284 | revision 3 |
|
285 | 285 | merging f |
|
286 | 286 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
287 | 287 | (branch merge, don't forget to commit) |
|
288 | 288 | # cat f |
|
289 | 289 | revision 1 |
|
290 | 290 | space |
|
291 | 291 | # hg stat |
|
292 | 292 | M f |
|
293 | 293 | |
|
294 | 294 | |
|
295 | 295 | Tool execution |
|
296 | 296 | |
|
297 | 297 | # set tools.args explicit to include $base $local $other $output: |
|
298 | 298 | [merge-tools] |
|
299 | 299 | false.whatever= |
|
300 | 300 | true.priority=1 |
|
301 | 301 | true.executable=cat |
|
302 | 302 | # hg update -C 1 |
|
303 | 303 | ==> ... <== |
|
304 | 304 | revision 0 |
|
305 | 305 | space |
|
306 | 306 | |
|
307 | 307 | ==> ... <== |
|
308 | 308 | revision 1 |
|
309 | 309 | space |
|
310 | 310 | |
|
311 | 311 | ==> ... <== |
|
312 | 312 | revision 2 |
|
313 | 313 | space |
|
314 | 314 | |
|
315 | 315 | ==> ... <== |
|
316 | 316 | revision 1 |
|
317 | 317 | space |
|
318 | 318 | merging f |
|
319 | 319 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
320 | 320 | (branch merge, don't forget to commit) |
|
321 | 321 | # cat f |
|
322 | 322 | revision 1 |
|
323 | 323 | space |
|
324 | 324 | # hg stat |
|
325 | 325 | M f |
|
326 | 326 | |
|
327 | 327 | # Merge with "echo mergeresult > $local": |
|
328 | 328 | [merge-tools] |
|
329 | 329 | false.whatever= |
|
330 | 330 | true.priority=1 |
|
331 | 331 | true.executable=cat |
|
332 | 332 | # hg update -C 1 |
|
333 | 333 | merging f |
|
334 | 334 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
335 | 335 | (branch merge, don't forget to commit) |
|
336 | 336 | # cat f |
|
337 | 337 | mergeresult |
|
338 | 338 | # hg stat |
|
339 | 339 | M f |
|
340 | 340 | |
|
341 | 341 | # - and $local is the file f: |
|
342 | 342 | [merge-tools] |
|
343 | 343 | false.whatever= |
|
344 | 344 | true.priority=1 |
|
345 | 345 | true.executable=cat |
|
346 | 346 | # hg update -C 1 |
|
347 | 347 | merging f |
|
348 | 348 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
349 | 349 | (branch merge, don't forget to commit) |
|
350 | 350 | # cat f |
|
351 | 351 | mergeresult |
|
352 | 352 | # hg stat |
|
353 | 353 | M f |
|
354 | 354 | |
|
355 | 355 | # Merge with "echo mergeresult > $output" - the variable is a bit magic: |
|
356 | 356 | [merge-tools] |
|
357 | 357 | false.whatever= |
|
358 | 358 | true.priority=1 |
|
359 | 359 | true.executable=cat |
|
360 | 360 | # hg update -C 1 |
|
361 | 361 | merging f |
|
362 | 362 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
363 | 363 | (branch merge, don't forget to commit) |
|
364 | 364 | # cat f |
|
365 | 365 | mergeresult |
|
366 | 366 | # hg stat |
|
367 | 367 | M f |
|
368 | 368 | |
|
369 | 369 | |
|
370 | 370 | Merge post-processing |
|
371 | 371 | |
|
372 | 372 | # cat is a bad merge-tool and doesn't change: |
|
373 | 373 | [merge-tools] |
|
374 | 374 | false.whatever= |
|
375 | 375 | true.priority=1 |
|
376 | 376 | true.executable=cat |
|
377 | 377 | # hg update -C 1 |
|
378 | 378 | # hg merge -r 2 --config merge-tools.true.checkchanged=1 |
|
379 | 379 | revision 1 |
|
380 | 380 | space |
|
381 | 381 | revision 0 |
|
382 | 382 | space |
|
383 | 383 | revision 2 |
|
384 | 384 | space |
|
385 | 385 | merging f |
|
386 | 386 | merging f failed! |
|
387 | 387 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
388 | use 'hg resolve' to retry unresolved file merges | |
|
388 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
389 | 389 | # cat f |
|
390 | 390 | revision 1 |
|
391 | 391 | space |
|
392 | 392 | # hg stat |
|
393 | 393 | M f |
|
394 | 394 | ? f.orig |
|
395 | 395 |
@@ -1,77 +1,77 b'' | |||
|
1 | 1 | updating working directory |
|
2 | 2 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
3 | 3 | pulling from ../test-a |
|
4 | 4 | searching for changes |
|
5 | 5 | adding changesets |
|
6 | 6 | adding manifests |
|
7 | 7 | adding file changes |
|
8 | 8 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
9 | 9 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
10 | 10 | merging test.txt |
|
11 | 11 | warning: conflicts during merge. |
|
12 | 12 | merging test.txt failed! |
|
13 | 13 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
14 | use 'hg resolve' to retry unresolved file merges | |
|
14 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
15 | 15 | pulling from ../test-a |
|
16 | 16 | searching for changes |
|
17 | 17 | adding changesets |
|
18 | 18 | adding manifests |
|
19 | 19 | adding file changes |
|
20 | 20 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
21 | 21 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
22 | 22 | resolving manifests |
|
23 | 23 | overwrite None partial False |
|
24 | 24 | ancestor faaea63e63a9 local 451c744aabcc+ remote a070d41e8360 |
|
25 | 25 | searching for copies back to rev 1 |
|
26 | 26 | test.txt: versions differ -> m |
|
27 | 27 | preserving test.txt for resolve of test.txt |
|
28 | 28 | picked tool 'internal:merge' for test.txt (binary False symlink False) |
|
29 | 29 | merging test.txt |
|
30 | 30 | my test.txt@451c744aabcc+ other test.txt@a070d41e8360 ancestor test.txt@faaea63e63a9 |
|
31 | 31 | warning: conflicts during merge. |
|
32 | 32 | merging test.txt failed! |
|
33 | 33 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
34 | use 'hg resolve' to retry unresolved file merges | |
|
34 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
35 | 35 | one |
|
36 | 36 | <<<<<<< local |
|
37 | 37 | two-point-five |
|
38 | 38 | ======= |
|
39 | 39 | two-point-one |
|
40 | 40 | >>>>>>> other |
|
41 | 41 | three |
|
42 | 42 | rev offset length base linkrev nodeid p1 p2 |
|
43 | 43 | 0 0 7 0 0 01365c4cca56 000000000000 000000000000 |
|
44 | 44 | 1 7 9 1 1 7b013192566a 01365c4cca56 000000000000 |
|
45 | 45 | 2 16 15 2 2 8fe46a3eb557 01365c4cca56 000000000000 |
|
46 | 46 | 3 31 27 2 3 fc3148072371 7b013192566a 8fe46a3eb557 |
|
47 | 47 | 4 58 25 4 4 d40249267ae3 8fe46a3eb557 000000000000 |
|
48 | 48 | changeset: 4:a070d41e8360 |
|
49 | 49 | tag: tip |
|
50 | 50 | parent: 2:faaea63e63a9 |
|
51 | 51 | user: test |
|
52 | 52 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
53 | 53 | summary: two -> two-point-one |
|
54 | 54 | |
|
55 | 55 | changeset: 3:451c744aabcc |
|
56 | 56 | parent: 1:e409be6afcc0 |
|
57 | 57 | parent: 2:faaea63e63a9 |
|
58 | 58 | user: test |
|
59 | 59 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
60 | 60 | summary: Merge 1 |
|
61 | 61 | |
|
62 | 62 | changeset: 2:faaea63e63a9 |
|
63 | 63 | parent: 0:095c92b91f1a |
|
64 | 64 | user: test |
|
65 | 65 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
66 | 66 | summary: Numbers as words |
|
67 | 67 | |
|
68 | 68 | changeset: 1:e409be6afcc0 |
|
69 | 69 | user: test |
|
70 | 70 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
71 | 71 | summary: 2 -> 2.5 |
|
72 | 72 | |
|
73 | 73 | changeset: 0:095c92b91f1a |
|
74 | 74 | user: test |
|
75 | 75 | date: Mon Jan 12 13:46:40 1970 +0000 |
|
76 | 76 | summary: Initial |
|
77 | 77 |
@@ -1,39 +1,39 b'' | |||
|
1 | 1 | adding bar |
|
2 | 2 | adding foo |
|
3 | 3 | adding quux1 |
|
4 | 4 | adding quux2 |
|
5 | 5 | created new head |
|
6 | 6 | merging bar |
|
7 | 7 | merging bar failed! |
|
8 | 8 | merging foo and baz to baz |
|
9 | 9 | 1 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
10 | use 'hg resolve' to retry unresolved file merges | |
|
10 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
11 | 11 | U bar |
|
12 | 12 | R baz |
|
13 | 13 | 3 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
14 | 14 | merging bar |
|
15 | 15 | merging bar failed! |
|
16 | 16 | merging baz and foo to baz |
|
17 | 17 | 1 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
18 | use 'hg resolve' to retry unresolved file merges | |
|
18 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
19 | 19 | % show unresolved |
|
20 | 20 | U bar |
|
21 | 21 | R baz |
|
22 | 22 | % unmark baz |
|
23 | 23 | % show |
|
24 | 24 | U bar |
|
25 | 25 | U baz |
|
26 | 26 | % re-resolve baz |
|
27 | 27 | merging baz and foo to baz |
|
28 | 28 | % after |
|
29 | 29 | U bar |
|
30 | 30 | R baz |
|
31 | 31 | % resolve all warning |
|
32 | 32 | abort: no files or directories specified; use --all to remerge all files |
|
33 | 33 | % resolve all |
|
34 | 34 | merging bar |
|
35 | 35 | warning: conflicts during merge. |
|
36 | 36 | merging bar failed! |
|
37 | 37 | % after |
|
38 | 38 | U bar |
|
39 | 39 | R baz |
@@ -1,8 +1,8 b'' | |||
|
1 | 1 | adding file |
|
2 | 2 | % create a second head |
|
3 | 3 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
4 | 4 | created new head |
|
5 | 5 | % failing merge |
|
6 | 6 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
7 | use 'hg resolve' to retry unresolved file merges | |
|
7 | use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon | |
|
8 | 8 | % resolve -l, should be empty |
General Comments 0
You need to be logged in to leave comments.
Login now