##// END OF EJS Templates
largefiles: teach log to handle patterns...
Matt Harbison -
r24206:13c1e66f default
parent child Browse files
Show More
@@ -1,1365 +1,1378
1 # Copyright 2009-2010 Gregory P. Ward
1 # Copyright 2009-2010 Gregory P. Ward
2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
3 # Copyright 2010-2011 Fog Creek Software
3 # Copyright 2010-2011 Fog Creek Software
4 # Copyright 2010-2011 Unity Technologies
4 # Copyright 2010-2011 Unity Technologies
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 '''Overridden Mercurial commands and functions for the largefiles extension'''
9 '''Overridden Mercurial commands and functions for the largefiles extension'''
10
10
11 import os
11 import os
12 import copy
12 import copy
13
13
14 from mercurial import hg, util, cmdutil, scmutil, match as match_, \
14 from mercurial import hg, util, cmdutil, scmutil, match as match_, \
15 archival, pathutil, revset
15 archival, pathutil, revset
16 from mercurial.i18n import _
16 from mercurial.i18n import _
17 from mercurial.node import hex
17 from mercurial.node import hex
18
18
19 import lfutil
19 import lfutil
20 import lfcommands
20 import lfcommands
21 import basestore
21 import basestore
22
22
23 # -- Utility functions: commonly/repeatedly needed functionality ---------------
23 # -- Utility functions: commonly/repeatedly needed functionality ---------------
24
24
25 def composelargefilematcher(match, manifest):
25 def composelargefilematcher(match, manifest):
26 '''create a matcher that matches only the largefiles in the original
26 '''create a matcher that matches only the largefiles in the original
27 matcher'''
27 matcher'''
28 m = copy.copy(match)
28 m = copy.copy(match)
29 lfile = lambda f: lfutil.standin(f) in manifest
29 lfile = lambda f: lfutil.standin(f) in manifest
30 m._files = filter(lfile, m._files)
30 m._files = filter(lfile, m._files)
31 m._fmap = set(m._files)
31 m._fmap = set(m._files)
32 m._always = False
32 m._always = False
33 origmatchfn = m.matchfn
33 origmatchfn = m.matchfn
34 m.matchfn = lambda f: lfile(f) and origmatchfn(f)
34 m.matchfn = lambda f: lfile(f) and origmatchfn(f)
35 return m
35 return m
36
36
37 def composenormalfilematcher(match, manifest, exclude=None):
37 def composenormalfilematcher(match, manifest, exclude=None):
38 excluded = set()
38 excluded = set()
39 if exclude is not None:
39 if exclude is not None:
40 excluded.update(exclude)
40 excluded.update(exclude)
41
41
42 m = copy.copy(match)
42 m = copy.copy(match)
43 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
43 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
44 manifest or f in excluded)
44 manifest or f in excluded)
45 m._files = filter(notlfile, m._files)
45 m._files = filter(notlfile, m._files)
46 m._fmap = set(m._files)
46 m._fmap = set(m._files)
47 m._always = False
47 m._always = False
48 origmatchfn = m.matchfn
48 origmatchfn = m.matchfn
49 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
49 m.matchfn = lambda f: notlfile(f) and origmatchfn(f)
50 return m
50 return m
51
51
52 def installnormalfilesmatchfn(manifest):
52 def installnormalfilesmatchfn(manifest):
53 '''installmatchfn with a matchfn that ignores all largefiles'''
53 '''installmatchfn with a matchfn that ignores all largefiles'''
54 def overridematch(ctx, pats=[], opts={}, globbed=False,
54 def overridematch(ctx, pats=[], opts={}, globbed=False,
55 default='relpath'):
55 default='relpath'):
56 match = oldmatch(ctx, pats, opts, globbed, default)
56 match = oldmatch(ctx, pats, opts, globbed, default)
57 return composenormalfilematcher(match, manifest)
57 return composenormalfilematcher(match, manifest)
58 oldmatch = installmatchfn(overridematch)
58 oldmatch = installmatchfn(overridematch)
59
59
60 def installmatchfn(f):
60 def installmatchfn(f):
61 '''monkey patch the scmutil module with a custom match function.
61 '''monkey patch the scmutil module with a custom match function.
62 Warning: it is monkey patching the _module_ on runtime! Not thread safe!'''
62 Warning: it is monkey patching the _module_ on runtime! Not thread safe!'''
63 oldmatch = scmutil.match
63 oldmatch = scmutil.match
64 setattr(f, 'oldmatch', oldmatch)
64 setattr(f, 'oldmatch', oldmatch)
65 scmutil.match = f
65 scmutil.match = f
66 return oldmatch
66 return oldmatch
67
67
68 def restorematchfn():
68 def restorematchfn():
69 '''restores scmutil.match to what it was before installmatchfn
69 '''restores scmutil.match to what it was before installmatchfn
70 was called. no-op if scmutil.match is its original function.
70 was called. no-op if scmutil.match is its original function.
71
71
72 Note that n calls to installmatchfn will require n calls to
72 Note that n calls to installmatchfn will require n calls to
73 restore the original matchfn.'''
73 restore the original matchfn.'''
74 scmutil.match = getattr(scmutil.match, 'oldmatch')
74 scmutil.match = getattr(scmutil.match, 'oldmatch')
75
75
76 def installmatchandpatsfn(f):
76 def installmatchandpatsfn(f):
77 oldmatchandpats = scmutil.matchandpats
77 oldmatchandpats = scmutil.matchandpats
78 setattr(f, 'oldmatchandpats', oldmatchandpats)
78 setattr(f, 'oldmatchandpats', oldmatchandpats)
79 scmutil.matchandpats = f
79 scmutil.matchandpats = f
80 return oldmatchandpats
80 return oldmatchandpats
81
81
82 def restorematchandpatsfn():
82 def restorematchandpatsfn():
83 '''restores scmutil.matchandpats to what it was before
83 '''restores scmutil.matchandpats to what it was before
84 installmatchandpatsfn was called. No-op if scmutil.matchandpats
84 installmatchandpatsfn was called. No-op if scmutil.matchandpats
85 is its original function.
85 is its original function.
86
86
87 Note that n calls to installmatchandpatsfn will require n calls
87 Note that n calls to installmatchandpatsfn will require n calls
88 to restore the original matchfn.'''
88 to restore the original matchfn.'''
89 scmutil.matchandpats = getattr(scmutil.matchandpats, 'oldmatchandpats',
89 scmutil.matchandpats = getattr(scmutil.matchandpats, 'oldmatchandpats',
90 scmutil.matchandpats)
90 scmutil.matchandpats)
91
91
92 def addlargefiles(ui, repo, isaddremove, matcher, **opts):
92 def addlargefiles(ui, repo, isaddremove, matcher, **opts):
93 large = opts.get('large')
93 large = opts.get('large')
94 lfsize = lfutil.getminsize(
94 lfsize = lfutil.getminsize(
95 ui, lfutil.islfilesrepo(repo), opts.get('lfsize'))
95 ui, lfutil.islfilesrepo(repo), opts.get('lfsize'))
96
96
97 lfmatcher = None
97 lfmatcher = None
98 if lfutil.islfilesrepo(repo):
98 if lfutil.islfilesrepo(repo):
99 lfpats = ui.configlist(lfutil.longname, 'patterns', default=[])
99 lfpats = ui.configlist(lfutil.longname, 'patterns', default=[])
100 if lfpats:
100 if lfpats:
101 lfmatcher = match_.match(repo.root, '', list(lfpats))
101 lfmatcher = match_.match(repo.root, '', list(lfpats))
102
102
103 lfnames = []
103 lfnames = []
104 m = copy.copy(matcher)
104 m = copy.copy(matcher)
105 m.bad = lambda x, y: None
105 m.bad = lambda x, y: None
106 wctx = repo[None]
106 wctx = repo[None]
107 for f in repo.walk(m):
107 for f in repo.walk(m):
108 exact = m.exact(f)
108 exact = m.exact(f)
109 lfile = lfutil.standin(f) in wctx
109 lfile = lfutil.standin(f) in wctx
110 nfile = f in wctx
110 nfile = f in wctx
111 exists = lfile or nfile
111 exists = lfile or nfile
112
112
113 # addremove in core gets fancy with the name, add doesn't
113 # addremove in core gets fancy with the name, add doesn't
114 if isaddremove:
114 if isaddremove:
115 name = m.uipath(f)
115 name = m.uipath(f)
116 else:
116 else:
117 name = m.rel(f)
117 name = m.rel(f)
118
118
119 # Don't warn the user when they attempt to add a normal tracked file.
119 # Don't warn the user when they attempt to add a normal tracked file.
120 # The normal add code will do that for us.
120 # The normal add code will do that for us.
121 if exact and exists:
121 if exact and exists:
122 if lfile:
122 if lfile:
123 ui.warn(_('%s already a largefile\n') % name)
123 ui.warn(_('%s already a largefile\n') % name)
124 continue
124 continue
125
125
126 if (exact or not exists) and not lfutil.isstandin(f):
126 if (exact or not exists) and not lfutil.isstandin(f):
127 # In case the file was removed previously, but not committed
127 # In case the file was removed previously, but not committed
128 # (issue3507)
128 # (issue3507)
129 if not repo.wvfs.exists(f):
129 if not repo.wvfs.exists(f):
130 continue
130 continue
131
131
132 abovemin = (lfsize and
132 abovemin = (lfsize and
133 repo.wvfs.lstat(f).st_size >= lfsize * 1024 * 1024)
133 repo.wvfs.lstat(f).st_size >= lfsize * 1024 * 1024)
134 if large or abovemin or (lfmatcher and lfmatcher(f)):
134 if large or abovemin or (lfmatcher and lfmatcher(f)):
135 lfnames.append(f)
135 lfnames.append(f)
136 if ui.verbose or not exact:
136 if ui.verbose or not exact:
137 ui.status(_('adding %s as a largefile\n') % name)
137 ui.status(_('adding %s as a largefile\n') % name)
138
138
139 bad = []
139 bad = []
140
140
141 # Need to lock, otherwise there could be a race condition between
141 # Need to lock, otherwise there could be a race condition between
142 # when standins are created and added to the repo.
142 # when standins are created and added to the repo.
143 wlock = repo.wlock()
143 wlock = repo.wlock()
144 try:
144 try:
145 if not opts.get('dry_run'):
145 if not opts.get('dry_run'):
146 standins = []
146 standins = []
147 lfdirstate = lfutil.openlfdirstate(ui, repo)
147 lfdirstate = lfutil.openlfdirstate(ui, repo)
148 for f in lfnames:
148 for f in lfnames:
149 standinname = lfutil.standin(f)
149 standinname = lfutil.standin(f)
150 lfutil.writestandin(repo, standinname, hash='',
150 lfutil.writestandin(repo, standinname, hash='',
151 executable=lfutil.getexecutable(repo.wjoin(f)))
151 executable=lfutil.getexecutable(repo.wjoin(f)))
152 standins.append(standinname)
152 standins.append(standinname)
153 if lfdirstate[f] == 'r':
153 if lfdirstate[f] == 'r':
154 lfdirstate.normallookup(f)
154 lfdirstate.normallookup(f)
155 else:
155 else:
156 lfdirstate.add(f)
156 lfdirstate.add(f)
157 lfdirstate.write()
157 lfdirstate.write()
158 bad += [lfutil.splitstandin(f)
158 bad += [lfutil.splitstandin(f)
159 for f in repo[None].add(standins)
159 for f in repo[None].add(standins)
160 if f in m.files()]
160 if f in m.files()]
161
161
162 added = [f for f in lfnames if f not in bad]
162 added = [f for f in lfnames if f not in bad]
163 finally:
163 finally:
164 wlock.release()
164 wlock.release()
165 return added, bad
165 return added, bad
166
166
167 def removelargefiles(ui, repo, isaddremove, matcher, **opts):
167 def removelargefiles(ui, repo, isaddremove, matcher, **opts):
168 after = opts.get('after')
168 after = opts.get('after')
169 m = composelargefilematcher(matcher, repo[None].manifest())
169 m = composelargefilematcher(matcher, repo[None].manifest())
170 try:
170 try:
171 repo.lfstatus = True
171 repo.lfstatus = True
172 s = repo.status(match=m, clean=not isaddremove)
172 s = repo.status(match=m, clean=not isaddremove)
173 finally:
173 finally:
174 repo.lfstatus = False
174 repo.lfstatus = False
175 manifest = repo[None].manifest()
175 manifest = repo[None].manifest()
176 modified, added, deleted, clean = [[f for f in list
176 modified, added, deleted, clean = [[f for f in list
177 if lfutil.standin(f) in manifest]
177 if lfutil.standin(f) in manifest]
178 for list in (s.modified, s.added,
178 for list in (s.modified, s.added,
179 s.deleted, s.clean)]
179 s.deleted, s.clean)]
180
180
181 def warn(files, msg):
181 def warn(files, msg):
182 for f in files:
182 for f in files:
183 ui.warn(msg % m.rel(f))
183 ui.warn(msg % m.rel(f))
184 return int(len(files) > 0)
184 return int(len(files) > 0)
185
185
186 result = 0
186 result = 0
187
187
188 if after:
188 if after:
189 remove = deleted
189 remove = deleted
190 result = warn(modified + added + clean,
190 result = warn(modified + added + clean,
191 _('not removing %s: file still exists\n'))
191 _('not removing %s: file still exists\n'))
192 else:
192 else:
193 remove = deleted + clean
193 remove = deleted + clean
194 result = warn(modified, _('not removing %s: file is modified (use -f'
194 result = warn(modified, _('not removing %s: file is modified (use -f'
195 ' to force removal)\n'))
195 ' to force removal)\n'))
196 result = warn(added, _('not removing %s: file has been marked for add'
196 result = warn(added, _('not removing %s: file has been marked for add'
197 ' (use forget to undo)\n')) or result
197 ' (use forget to undo)\n')) or result
198
198
199 # Need to lock because standin files are deleted then removed from the
199 # Need to lock because standin files are deleted then removed from the
200 # repository and we could race in-between.
200 # repository and we could race in-between.
201 wlock = repo.wlock()
201 wlock = repo.wlock()
202 try:
202 try:
203 lfdirstate = lfutil.openlfdirstate(ui, repo)
203 lfdirstate = lfutil.openlfdirstate(ui, repo)
204 for f in sorted(remove):
204 for f in sorted(remove):
205 if ui.verbose or not m.exact(f):
205 if ui.verbose or not m.exact(f):
206 # addremove in core gets fancy with the name, remove doesn't
206 # addremove in core gets fancy with the name, remove doesn't
207 if isaddremove:
207 if isaddremove:
208 name = m.uipath(f)
208 name = m.uipath(f)
209 else:
209 else:
210 name = m.rel(f)
210 name = m.rel(f)
211 ui.status(_('removing %s\n') % name)
211 ui.status(_('removing %s\n') % name)
212
212
213 if not opts.get('dry_run'):
213 if not opts.get('dry_run'):
214 if not after:
214 if not after:
215 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
215 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
216
216
217 if opts.get('dry_run'):
217 if opts.get('dry_run'):
218 return result
218 return result
219
219
220 remove = [lfutil.standin(f) for f in remove]
220 remove = [lfutil.standin(f) for f in remove]
221 # If this is being called by addremove, let the original addremove
221 # If this is being called by addremove, let the original addremove
222 # function handle this.
222 # function handle this.
223 if not isaddremove:
223 if not isaddremove:
224 for f in remove:
224 for f in remove:
225 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
225 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
226 repo[None].forget(remove)
226 repo[None].forget(remove)
227
227
228 for f in remove:
228 for f in remove:
229 lfutil.synclfdirstate(repo, lfdirstate, lfutil.splitstandin(f),
229 lfutil.synclfdirstate(repo, lfdirstate, lfutil.splitstandin(f),
230 False)
230 False)
231
231
232 lfdirstate.write()
232 lfdirstate.write()
233 finally:
233 finally:
234 wlock.release()
234 wlock.release()
235
235
236 return result
236 return result
237
237
238 # For overriding mercurial.hgweb.webcommands so that largefiles will
238 # For overriding mercurial.hgweb.webcommands so that largefiles will
239 # appear at their right place in the manifests.
239 # appear at their right place in the manifests.
240 def decodepath(orig, path):
240 def decodepath(orig, path):
241 return lfutil.splitstandin(path) or path
241 return lfutil.splitstandin(path) or path
242
242
243 # -- Wrappers: modify existing commands --------------------------------
243 # -- Wrappers: modify existing commands --------------------------------
244
244
245 def overrideadd(orig, ui, repo, *pats, **opts):
245 def overrideadd(orig, ui, repo, *pats, **opts):
246 if opts.get('normal') and opts.get('large'):
246 if opts.get('normal') and opts.get('large'):
247 raise util.Abort(_('--normal cannot be used with --large'))
247 raise util.Abort(_('--normal cannot be used with --large'))
248 return orig(ui, repo, *pats, **opts)
248 return orig(ui, repo, *pats, **opts)
249
249
250 def cmdutiladd(orig, ui, repo, matcher, prefix, explicitonly, **opts):
250 def cmdutiladd(orig, ui, repo, matcher, prefix, explicitonly, **opts):
251 # The --normal flag short circuits this override
251 # The --normal flag short circuits this override
252 if opts.get('normal'):
252 if opts.get('normal'):
253 return orig(ui, repo, matcher, prefix, explicitonly, **opts)
253 return orig(ui, repo, matcher, prefix, explicitonly, **opts)
254
254
255 ladded, lbad = addlargefiles(ui, repo, False, matcher, **opts)
255 ladded, lbad = addlargefiles(ui, repo, False, matcher, **opts)
256 normalmatcher = composenormalfilematcher(matcher, repo[None].manifest(),
256 normalmatcher = composenormalfilematcher(matcher, repo[None].manifest(),
257 ladded)
257 ladded)
258 bad = orig(ui, repo, normalmatcher, prefix, explicitonly, **opts)
258 bad = orig(ui, repo, normalmatcher, prefix, explicitonly, **opts)
259
259
260 bad.extend(f for f in lbad)
260 bad.extend(f for f in lbad)
261 return bad
261 return bad
262
262
263 def cmdutilremove(orig, ui, repo, matcher, prefix, after, force, subrepos):
263 def cmdutilremove(orig, ui, repo, matcher, prefix, after, force, subrepos):
264 normalmatcher = composenormalfilematcher(matcher, repo[None].manifest())
264 normalmatcher = composenormalfilematcher(matcher, repo[None].manifest())
265 result = orig(ui, repo, normalmatcher, prefix, after, force, subrepos)
265 result = orig(ui, repo, normalmatcher, prefix, after, force, subrepos)
266 return removelargefiles(ui, repo, False, matcher, after=after,
266 return removelargefiles(ui, repo, False, matcher, after=after,
267 force=force) or result
267 force=force) or result
268
268
269 def overridestatusfn(orig, repo, rev2, **opts):
269 def overridestatusfn(orig, repo, rev2, **opts):
270 try:
270 try:
271 repo._repo.lfstatus = True
271 repo._repo.lfstatus = True
272 return orig(repo, rev2, **opts)
272 return orig(repo, rev2, **opts)
273 finally:
273 finally:
274 repo._repo.lfstatus = False
274 repo._repo.lfstatus = False
275
275
276 def overridestatus(orig, ui, repo, *pats, **opts):
276 def overridestatus(orig, ui, repo, *pats, **opts):
277 try:
277 try:
278 repo.lfstatus = True
278 repo.lfstatus = True
279 return orig(ui, repo, *pats, **opts)
279 return orig(ui, repo, *pats, **opts)
280 finally:
280 finally:
281 repo.lfstatus = False
281 repo.lfstatus = False
282
282
283 def overridedirty(orig, repo, ignoreupdate=False):
283 def overridedirty(orig, repo, ignoreupdate=False):
284 try:
284 try:
285 repo._repo.lfstatus = True
285 repo._repo.lfstatus = True
286 return orig(repo, ignoreupdate)
286 return orig(repo, ignoreupdate)
287 finally:
287 finally:
288 repo._repo.lfstatus = False
288 repo._repo.lfstatus = False
289
289
290 def overridelog(orig, ui, repo, *pats, **opts):
290 def overridelog(orig, ui, repo, *pats, **opts):
291 def overridematchandpats(ctx, pats=[], opts={}, globbed=False,
291 def overridematchandpats(ctx, pats=[], opts={}, globbed=False,
292 default='relpath'):
292 default='relpath'):
293 """Matcher that merges root directory with .hglf, suitable for log.
293 """Matcher that merges root directory with .hglf, suitable for log.
294 It is still possible to match .hglf directly.
294 It is still possible to match .hglf directly.
295 For any listed files run log on the standin too.
295 For any listed files run log on the standin too.
296 matchfn tries both the given filename and with .hglf stripped.
296 matchfn tries both the given filename and with .hglf stripped.
297 """
297 """
298 matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default)
298 matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default)
299 m, p = copy.copy(matchandpats)
299 m, p = copy.copy(matchandpats)
300
300
301 if m.always():
301 if m.always():
302 # We want to match everything anyway, so there's no benefit trying
302 # We want to match everything anyway, so there's no benefit trying
303 # to add standins.
303 # to add standins.
304 return matchandpats
304 return matchandpats
305
305
306 pats = set(p)
306 pats = set(p)
307 # TODO: handling of patterns in both cases below
307
308 def fixpats(pat, tostandin=lfutil.standin):
309 kindpat = match_._patsplit(pat, None)
310
311 if kindpat[0] is not None:
312 return kindpat[0] + ':' + tostandin(kindpat[1])
313 return tostandin(kindpat[1])
314
308 if m._cwd:
315 if m._cwd:
309 if os.path.isabs(m._cwd):
316 if os.path.isabs(m._cwd):
310 # TODO: handle largefile magic when invoked from other cwd
317 # TODO: handle largefile magic when invoked from other cwd
311 return matchandpats
318 return matchandpats
312 back = (m._cwd.count('/') + 1) * '../'
319 back = (m._cwd.count('/') + 1) * '../'
313 pats.update(back + lfutil.standin(m._cwd + '/' + f) for f in p)
320
321 def tostandin(f):
322 return back + lfutil.standin(m._cwd + '/' + f)
323
324 pats.update(fixpats(f, tostandin) for f in p)
314 else:
325 else:
315 pats.update(lfutil.standin(f) for f in p)
326 pats.update(fixpats(f) for f in p)
316
327
317 for i in range(0, len(m._files)):
328 for i in range(0, len(m._files)):
329 # Don't add '.hglf' to m.files, since that is already covered by '.'
330 if m._files[i] == '.':
331 continue
318 standin = lfutil.standin(m._files[i])
332 standin = lfutil.standin(m._files[i])
319 # If the "standin" is a directory, append instead of replace to
333 # If the "standin" is a directory, append instead of replace to
320 # support naming a directory on the command line with only
334 # support naming a directory on the command line with only
321 # largefiles. The original directory is kept to support normal
335 # largefiles. The original directory is kept to support normal
322 # files.
336 # files.
323 if standin in repo[ctx.node()]:
337 if standin in repo[ctx.node()]:
324 m._files[i] = standin
338 m._files[i] = standin
325 elif m._files[i] not in repo[ctx.node()] \
339 elif m._files[i] not in repo[ctx.node()] \
326 and repo.wvfs.isdir(standin):
340 and repo.wvfs.isdir(standin):
327 m._files.append(standin)
341 m._files.append(standin)
328 pats.add(standin)
329
342
330 m._fmap = set(m._files)
343 m._fmap = set(m._files)
331 m._always = False
344 m._always = False
332 origmatchfn = m.matchfn
345 origmatchfn = m.matchfn
333 def lfmatchfn(f):
346 def lfmatchfn(f):
334 lf = lfutil.splitstandin(f)
347 lf = lfutil.splitstandin(f)
335 if lf is not None and origmatchfn(lf):
348 if lf is not None and origmatchfn(lf):
336 return True
349 return True
337 r = origmatchfn(f)
350 r = origmatchfn(f)
338 return r
351 return r
339 m.matchfn = lfmatchfn
352 m.matchfn = lfmatchfn
340
353
341 return m, pats
354 return m, pats
342
355
343 # For hg log --patch, the match object is used in two different senses:
356 # For hg log --patch, the match object is used in two different senses:
344 # (1) to determine what revisions should be printed out, and
357 # (1) to determine what revisions should be printed out, and
345 # (2) to determine what files to print out diffs for.
358 # (2) to determine what files to print out diffs for.
346 # The magic matchandpats override should be used for case (1) but not for
359 # The magic matchandpats override should be used for case (1) but not for
347 # case (2).
360 # case (2).
348 def overridemakelogfilematcher(repo, pats, opts):
361 def overridemakelogfilematcher(repo, pats, opts):
349 pctx = repo[None]
362 pctx = repo[None]
350 match, pats = oldmatchandpats(pctx, pats, opts)
363 match, pats = oldmatchandpats(pctx, pats, opts)
351 return lambda rev: match
364 return lambda rev: match
352
365
353 oldmatchandpats = installmatchandpatsfn(overridematchandpats)
366 oldmatchandpats = installmatchandpatsfn(overridematchandpats)
354 oldmakelogfilematcher = cmdutil._makenofollowlogfilematcher
367 oldmakelogfilematcher = cmdutil._makenofollowlogfilematcher
355 setattr(cmdutil, '_makenofollowlogfilematcher', overridemakelogfilematcher)
368 setattr(cmdutil, '_makenofollowlogfilematcher', overridemakelogfilematcher)
356
369
357 try:
370 try:
358 return orig(ui, repo, *pats, **opts)
371 return orig(ui, repo, *pats, **opts)
359 finally:
372 finally:
360 restorematchandpatsfn()
373 restorematchandpatsfn()
361 setattr(cmdutil, '_makenofollowlogfilematcher', oldmakelogfilematcher)
374 setattr(cmdutil, '_makenofollowlogfilematcher', oldmakelogfilematcher)
362
375
363 def overrideverify(orig, ui, repo, *pats, **opts):
376 def overrideverify(orig, ui, repo, *pats, **opts):
364 large = opts.pop('large', False)
377 large = opts.pop('large', False)
365 all = opts.pop('lfa', False)
378 all = opts.pop('lfa', False)
366 contents = opts.pop('lfc', False)
379 contents = opts.pop('lfc', False)
367
380
368 result = orig(ui, repo, *pats, **opts)
381 result = orig(ui, repo, *pats, **opts)
369 if large or all or contents:
382 if large or all or contents:
370 result = result or lfcommands.verifylfiles(ui, repo, all, contents)
383 result = result or lfcommands.verifylfiles(ui, repo, all, contents)
371 return result
384 return result
372
385
373 def overridedebugstate(orig, ui, repo, *pats, **opts):
386 def overridedebugstate(orig, ui, repo, *pats, **opts):
374 large = opts.pop('large', False)
387 large = opts.pop('large', False)
375 if large:
388 if large:
376 class fakerepo(object):
389 class fakerepo(object):
377 dirstate = lfutil.openlfdirstate(ui, repo)
390 dirstate = lfutil.openlfdirstate(ui, repo)
378 orig(ui, fakerepo, *pats, **opts)
391 orig(ui, fakerepo, *pats, **opts)
379 else:
392 else:
380 orig(ui, repo, *pats, **opts)
393 orig(ui, repo, *pats, **opts)
381
394
382 # Override needs to refresh standins so that update's normal merge
395 # Override needs to refresh standins so that update's normal merge
383 # will go through properly. Then the other update hook (overriding repo.update)
396 # will go through properly. Then the other update hook (overriding repo.update)
384 # will get the new files. Filemerge is also overridden so that the merge
397 # will get the new files. Filemerge is also overridden so that the merge
385 # will merge standins correctly.
398 # will merge standins correctly.
386 def overrideupdate(orig, ui, repo, *pats, **opts):
399 def overrideupdate(orig, ui, repo, *pats, **opts):
387 # Need to lock between the standins getting updated and their
400 # Need to lock between the standins getting updated and their
388 # largefiles getting updated
401 # largefiles getting updated
389 wlock = repo.wlock()
402 wlock = repo.wlock()
390 try:
403 try:
391 if opts['check']:
404 if opts['check']:
392 lfdirstate = lfutil.openlfdirstate(ui, repo)
405 lfdirstate = lfutil.openlfdirstate(ui, repo)
393 unsure, s = lfdirstate.status(
406 unsure, s = lfdirstate.status(
394 match_.always(repo.root, repo.getcwd()),
407 match_.always(repo.root, repo.getcwd()),
395 [], False, False, False)
408 [], False, False, False)
396
409
397 mod = len(s.modified) > 0
410 mod = len(s.modified) > 0
398 for lfile in unsure:
411 for lfile in unsure:
399 standin = lfutil.standin(lfile)
412 standin = lfutil.standin(lfile)
400 if repo['.'][standin].data().strip() != \
413 if repo['.'][standin].data().strip() != \
401 lfutil.hashfile(repo.wjoin(lfile)):
414 lfutil.hashfile(repo.wjoin(lfile)):
402 mod = True
415 mod = True
403 else:
416 else:
404 lfdirstate.normal(lfile)
417 lfdirstate.normal(lfile)
405 lfdirstate.write()
418 lfdirstate.write()
406 if mod:
419 if mod:
407 raise util.Abort(_('uncommitted changes'))
420 raise util.Abort(_('uncommitted changes'))
408 return orig(ui, repo, *pats, **opts)
421 return orig(ui, repo, *pats, **opts)
409 finally:
422 finally:
410 wlock.release()
423 wlock.release()
411
424
412 # Before starting the manifest merge, merge.updates will call
425 # Before starting the manifest merge, merge.updates will call
413 # _checkunknownfile to check if there are any files in the merged-in
426 # _checkunknownfile to check if there are any files in the merged-in
414 # changeset that collide with unknown files in the working copy.
427 # changeset that collide with unknown files in the working copy.
415 #
428 #
416 # The largefiles are seen as unknown, so this prevents us from merging
429 # The largefiles are seen as unknown, so this prevents us from merging
417 # in a file 'foo' if we already have a largefile with the same name.
430 # in a file 'foo' if we already have a largefile with the same name.
418 #
431 #
419 # The overridden function filters the unknown files by removing any
432 # The overridden function filters the unknown files by removing any
420 # largefiles. This makes the merge proceed and we can then handle this
433 # largefiles. This makes the merge proceed and we can then handle this
421 # case further in the overridden calculateupdates function below.
434 # case further in the overridden calculateupdates function below.
422 def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None):
435 def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None):
423 if lfutil.standin(repo.dirstate.normalize(f)) in wctx:
436 if lfutil.standin(repo.dirstate.normalize(f)) in wctx:
424 return False
437 return False
425 return origfn(repo, wctx, mctx, f, f2)
438 return origfn(repo, wctx, mctx, f, f2)
426
439
427 # The manifest merge handles conflicts on the manifest level. We want
440 # The manifest merge handles conflicts on the manifest level. We want
428 # to handle changes in largefile-ness of files at this level too.
441 # to handle changes in largefile-ness of files at this level too.
429 #
442 #
430 # The strategy is to run the original calculateupdates and then process
443 # The strategy is to run the original calculateupdates and then process
431 # the action list it outputs. There are two cases we need to deal with:
444 # the action list it outputs. There are two cases we need to deal with:
432 #
445 #
433 # 1. Normal file in p1, largefile in p2. Here the largefile is
446 # 1. Normal file in p1, largefile in p2. Here the largefile is
434 # detected via its standin file, which will enter the working copy
447 # detected via its standin file, which will enter the working copy
435 # with a "get" action. It is not "merge" since the standin is all
448 # with a "get" action. It is not "merge" since the standin is all
436 # Mercurial is concerned with at this level -- the link to the
449 # Mercurial is concerned with at this level -- the link to the
437 # existing normal file is not relevant here.
450 # existing normal file is not relevant here.
438 #
451 #
439 # 2. Largefile in p1, normal file in p2. Here we get a "merge" action
452 # 2. Largefile in p1, normal file in p2. Here we get a "merge" action
440 # since the largefile will be present in the working copy and
453 # since the largefile will be present in the working copy and
441 # different from the normal file in p2. Mercurial therefore
454 # different from the normal file in p2. Mercurial therefore
442 # triggers a merge action.
455 # triggers a merge action.
443 #
456 #
444 # In both cases, we prompt the user and emit new actions to either
457 # In both cases, we prompt the user and emit new actions to either
445 # remove the standin (if the normal file was kept) or to remove the
458 # remove the standin (if the normal file was kept) or to remove the
446 # normal file and get the standin (if the largefile was kept). The
459 # normal file and get the standin (if the largefile was kept). The
447 # default prompt answer is to use the largefile version since it was
460 # default prompt answer is to use the largefile version since it was
448 # presumably changed on purpose.
461 # presumably changed on purpose.
449 #
462 #
450 # Finally, the merge.applyupdates function will then take care of
463 # Finally, the merge.applyupdates function will then take care of
451 # writing the files into the working copy and lfcommands.updatelfiles
464 # writing the files into the working copy and lfcommands.updatelfiles
452 # will update the largefiles.
465 # will update the largefiles.
453 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
466 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
454 partial, acceptremote, followcopies):
467 partial, acceptremote, followcopies):
455 overwrite = force and not branchmerge
468 overwrite = force and not branchmerge
456 actions, diverge, renamedelete = origfn(
469 actions, diverge, renamedelete = origfn(
457 repo, p1, p2, pas, branchmerge, force, partial, acceptremote,
470 repo, p1, p2, pas, branchmerge, force, partial, acceptremote,
458 followcopies)
471 followcopies)
459
472
460 if overwrite:
473 if overwrite:
461 return actions, diverge, renamedelete
474 return actions, diverge, renamedelete
462
475
463 # Convert to dictionary with filename as key and action as value.
476 # Convert to dictionary with filename as key and action as value.
464 lfiles = set()
477 lfiles = set()
465 for f in actions:
478 for f in actions:
466 splitstandin = f and lfutil.splitstandin(f)
479 splitstandin = f and lfutil.splitstandin(f)
467 if splitstandin in p1:
480 if splitstandin in p1:
468 lfiles.add(splitstandin)
481 lfiles.add(splitstandin)
469 elif lfutil.standin(f) in p1:
482 elif lfutil.standin(f) in p1:
470 lfiles.add(f)
483 lfiles.add(f)
471
484
472 for lfile in lfiles:
485 for lfile in lfiles:
473 standin = lfutil.standin(lfile)
486 standin = lfutil.standin(lfile)
474 (lm, largs, lmsg) = actions.get(lfile, (None, None, None))
487 (lm, largs, lmsg) = actions.get(lfile, (None, None, None))
475 (sm, sargs, smsg) = actions.get(standin, (None, None, None))
488 (sm, sargs, smsg) = actions.get(standin, (None, None, None))
476 if sm in ('g', 'dc') and lm != 'r':
489 if sm in ('g', 'dc') and lm != 'r':
477 # Case 1: normal file in the working copy, largefile in
490 # Case 1: normal file in the working copy, largefile in
478 # the second parent
491 # the second parent
479 usermsg = _('remote turned local normal file %s into a largefile\n'
492 usermsg = _('remote turned local normal file %s into a largefile\n'
480 'use (l)argefile or keep (n)ormal file?'
493 'use (l)argefile or keep (n)ormal file?'
481 '$$ &Largefile $$ &Normal file') % lfile
494 '$$ &Largefile $$ &Normal file') % lfile
482 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
495 if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile
483 actions[lfile] = ('r', None, 'replaced by standin')
496 actions[lfile] = ('r', None, 'replaced by standin')
484 actions[standin] = ('g', sargs, 'replaces standin')
497 actions[standin] = ('g', sargs, 'replaces standin')
485 else: # keep local normal file
498 else: # keep local normal file
486 actions[lfile] = ('k', None, 'replaces standin')
499 actions[lfile] = ('k', None, 'replaces standin')
487 if branchmerge:
500 if branchmerge:
488 actions[standin] = ('k', None, 'replaced by non-standin')
501 actions[standin] = ('k', None, 'replaced by non-standin')
489 else:
502 else:
490 actions[standin] = ('r', None, 'replaced by non-standin')
503 actions[standin] = ('r', None, 'replaced by non-standin')
491 elif lm in ('g', 'dc') and sm != 'r':
504 elif lm in ('g', 'dc') and sm != 'r':
492 # Case 2: largefile in the working copy, normal file in
505 # Case 2: largefile in the working copy, normal file in
493 # the second parent
506 # the second parent
494 usermsg = _('remote turned local largefile %s into a normal file\n'
507 usermsg = _('remote turned local largefile %s into a normal file\n'
495 'keep (l)argefile or use (n)ormal file?'
508 'keep (l)argefile or use (n)ormal file?'
496 '$$ &Largefile $$ &Normal file') % lfile
509 '$$ &Largefile $$ &Normal file') % lfile
497 if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile
510 if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile
498 if branchmerge:
511 if branchmerge:
499 # largefile can be restored from standin safely
512 # largefile can be restored from standin safely
500 actions[lfile] = ('k', None, 'replaced by standin')
513 actions[lfile] = ('k', None, 'replaced by standin')
501 actions[standin] = ('k', None, 'replaces standin')
514 actions[standin] = ('k', None, 'replaces standin')
502 else:
515 else:
503 # "lfile" should be marked as "removed" without
516 # "lfile" should be marked as "removed" without
504 # removal of itself
517 # removal of itself
505 actions[lfile] = ('lfmr', None,
518 actions[lfile] = ('lfmr', None,
506 'forget non-standin largefile')
519 'forget non-standin largefile')
507
520
508 # linear-merge should treat this largefile as 're-added'
521 # linear-merge should treat this largefile as 're-added'
509 actions[standin] = ('a', None, 'keep standin')
522 actions[standin] = ('a', None, 'keep standin')
510 else: # pick remote normal file
523 else: # pick remote normal file
511 actions[lfile] = ('g', largs, 'replaces standin')
524 actions[lfile] = ('g', largs, 'replaces standin')
512 actions[standin] = ('r', None, 'replaced by non-standin')
525 actions[standin] = ('r', None, 'replaced by non-standin')
513
526
514 return actions, diverge, renamedelete
527 return actions, diverge, renamedelete
515
528
516 def mergerecordupdates(orig, repo, actions, branchmerge):
529 def mergerecordupdates(orig, repo, actions, branchmerge):
517 if 'lfmr' in actions:
530 if 'lfmr' in actions:
518 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
531 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
519 for lfile, args, msg in actions['lfmr']:
532 for lfile, args, msg in actions['lfmr']:
520 # this should be executed before 'orig', to execute 'remove'
533 # this should be executed before 'orig', to execute 'remove'
521 # before all other actions
534 # before all other actions
522 repo.dirstate.remove(lfile)
535 repo.dirstate.remove(lfile)
523 # make sure lfile doesn't get synclfdirstate'd as normal
536 # make sure lfile doesn't get synclfdirstate'd as normal
524 lfdirstate.add(lfile)
537 lfdirstate.add(lfile)
525 lfdirstate.write()
538 lfdirstate.write()
526
539
527 return orig(repo, actions, branchmerge)
540 return orig(repo, actions, branchmerge)
528
541
529
542
530 # Override filemerge to prompt the user about how they wish to merge
543 # Override filemerge to prompt the user about how they wish to merge
531 # largefiles. This will handle identical edits without prompting the user.
544 # largefiles. This will handle identical edits without prompting the user.
532 def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca, labels=None):
545 def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca, labels=None):
533 if not lfutil.isstandin(orig):
546 if not lfutil.isstandin(orig):
534 return origfn(repo, mynode, orig, fcd, fco, fca, labels=labels)
547 return origfn(repo, mynode, orig, fcd, fco, fca, labels=labels)
535
548
536 ahash = fca.data().strip().lower()
549 ahash = fca.data().strip().lower()
537 dhash = fcd.data().strip().lower()
550 dhash = fcd.data().strip().lower()
538 ohash = fco.data().strip().lower()
551 ohash = fco.data().strip().lower()
539 if (ohash != ahash and
552 if (ohash != ahash and
540 ohash != dhash and
553 ohash != dhash and
541 (dhash == ahash or
554 (dhash == ahash or
542 repo.ui.promptchoice(
555 repo.ui.promptchoice(
543 _('largefile %s has a merge conflict\nancestor was %s\n'
556 _('largefile %s has a merge conflict\nancestor was %s\n'
544 'keep (l)ocal %s or\ntake (o)ther %s?'
557 'keep (l)ocal %s or\ntake (o)ther %s?'
545 '$$ &Local $$ &Other') %
558 '$$ &Local $$ &Other') %
546 (lfutil.splitstandin(orig), ahash, dhash, ohash),
559 (lfutil.splitstandin(orig), ahash, dhash, ohash),
547 0) == 1)):
560 0) == 1)):
548 repo.wwrite(fcd.path(), fco.data(), fco.flags())
561 repo.wwrite(fcd.path(), fco.data(), fco.flags())
549 return 0
562 return 0
550
563
551 # Copy first changes the matchers to match standins instead of
564 # Copy first changes the matchers to match standins instead of
552 # largefiles. Then it overrides util.copyfile in that function it
565 # largefiles. Then it overrides util.copyfile in that function it
553 # checks if the destination largefile already exists. It also keeps a
566 # checks if the destination largefile already exists. It also keeps a
554 # list of copied files so that the largefiles can be copied and the
567 # list of copied files so that the largefiles can be copied and the
555 # dirstate updated.
568 # dirstate updated.
556 def overridecopy(orig, ui, repo, pats, opts, rename=False):
569 def overridecopy(orig, ui, repo, pats, opts, rename=False):
557 # doesn't remove largefile on rename
570 # doesn't remove largefile on rename
558 if len(pats) < 2:
571 if len(pats) < 2:
559 # this isn't legal, let the original function deal with it
572 # this isn't legal, let the original function deal with it
560 return orig(ui, repo, pats, opts, rename)
573 return orig(ui, repo, pats, opts, rename)
561
574
562 # This could copy both lfiles and normal files in one command,
575 # This could copy both lfiles and normal files in one command,
563 # but we don't want to do that. First replace their matcher to
576 # but we don't want to do that. First replace their matcher to
564 # only match normal files and run it, then replace it to just
577 # only match normal files and run it, then replace it to just
565 # match largefiles and run it again.
578 # match largefiles and run it again.
566 nonormalfiles = False
579 nonormalfiles = False
567 nolfiles = False
580 nolfiles = False
568 installnormalfilesmatchfn(repo[None].manifest())
581 installnormalfilesmatchfn(repo[None].manifest())
569 try:
582 try:
570 try:
583 try:
571 result = orig(ui, repo, pats, opts, rename)
584 result = orig(ui, repo, pats, opts, rename)
572 except util.Abort, e:
585 except util.Abort, e:
573 if str(e) != _('no files to copy'):
586 if str(e) != _('no files to copy'):
574 raise e
587 raise e
575 else:
588 else:
576 nonormalfiles = True
589 nonormalfiles = True
577 result = 0
590 result = 0
578 finally:
591 finally:
579 restorematchfn()
592 restorematchfn()
580
593
581 # The first rename can cause our current working directory to be removed.
594 # The first rename can cause our current working directory to be removed.
582 # In that case there is nothing left to copy/rename so just quit.
595 # In that case there is nothing left to copy/rename so just quit.
583 try:
596 try:
584 repo.getcwd()
597 repo.getcwd()
585 except OSError:
598 except OSError:
586 return result
599 return result
587
600
588 def makestandin(relpath):
601 def makestandin(relpath):
589 path = pathutil.canonpath(repo.root, repo.getcwd(), relpath)
602 path = pathutil.canonpath(repo.root, repo.getcwd(), relpath)
590 return os.path.join(repo.wjoin(lfutil.standin(path)))
603 return os.path.join(repo.wjoin(lfutil.standin(path)))
591
604
592 fullpats = scmutil.expandpats(pats)
605 fullpats = scmutil.expandpats(pats)
593 dest = fullpats[-1]
606 dest = fullpats[-1]
594
607
595 if os.path.isdir(dest):
608 if os.path.isdir(dest):
596 if not os.path.isdir(makestandin(dest)):
609 if not os.path.isdir(makestandin(dest)):
597 os.makedirs(makestandin(dest))
610 os.makedirs(makestandin(dest))
598
611
599 try:
612 try:
600 try:
613 try:
601 # When we call orig below it creates the standins but we don't add
614 # When we call orig below it creates the standins but we don't add
602 # them to the dir state until later so lock during that time.
615 # them to the dir state until later so lock during that time.
603 wlock = repo.wlock()
616 wlock = repo.wlock()
604
617
605 manifest = repo[None].manifest()
618 manifest = repo[None].manifest()
606 def overridematch(ctx, pats=[], opts={}, globbed=False,
619 def overridematch(ctx, pats=[], opts={}, globbed=False,
607 default='relpath'):
620 default='relpath'):
608 newpats = []
621 newpats = []
609 # The patterns were previously mangled to add the standin
622 # The patterns were previously mangled to add the standin
610 # directory; we need to remove that now
623 # directory; we need to remove that now
611 for pat in pats:
624 for pat in pats:
612 if match_.patkind(pat) is None and lfutil.shortname in pat:
625 if match_.patkind(pat) is None and lfutil.shortname in pat:
613 newpats.append(pat.replace(lfutil.shortname, ''))
626 newpats.append(pat.replace(lfutil.shortname, ''))
614 else:
627 else:
615 newpats.append(pat)
628 newpats.append(pat)
616 match = oldmatch(ctx, newpats, opts, globbed, default)
629 match = oldmatch(ctx, newpats, opts, globbed, default)
617 m = copy.copy(match)
630 m = copy.copy(match)
618 lfile = lambda f: lfutil.standin(f) in manifest
631 lfile = lambda f: lfutil.standin(f) in manifest
619 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
632 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
620 m._fmap = set(m._files)
633 m._fmap = set(m._files)
621 origmatchfn = m.matchfn
634 origmatchfn = m.matchfn
622 m.matchfn = lambda f: (lfutil.isstandin(f) and
635 m.matchfn = lambda f: (lfutil.isstandin(f) and
623 (f in manifest) and
636 (f in manifest) and
624 origmatchfn(lfutil.splitstandin(f)) or
637 origmatchfn(lfutil.splitstandin(f)) or
625 None)
638 None)
626 return m
639 return m
627 oldmatch = installmatchfn(overridematch)
640 oldmatch = installmatchfn(overridematch)
628 listpats = []
641 listpats = []
629 for pat in pats:
642 for pat in pats:
630 if match_.patkind(pat) is not None:
643 if match_.patkind(pat) is not None:
631 listpats.append(pat)
644 listpats.append(pat)
632 else:
645 else:
633 listpats.append(makestandin(pat))
646 listpats.append(makestandin(pat))
634
647
635 try:
648 try:
636 origcopyfile = util.copyfile
649 origcopyfile = util.copyfile
637 copiedfiles = []
650 copiedfiles = []
638 def overridecopyfile(src, dest):
651 def overridecopyfile(src, dest):
639 if (lfutil.shortname in src and
652 if (lfutil.shortname in src and
640 dest.startswith(repo.wjoin(lfutil.shortname))):
653 dest.startswith(repo.wjoin(lfutil.shortname))):
641 destlfile = dest.replace(lfutil.shortname, '')
654 destlfile = dest.replace(lfutil.shortname, '')
642 if not opts['force'] and os.path.exists(destlfile):
655 if not opts['force'] and os.path.exists(destlfile):
643 raise IOError('',
656 raise IOError('',
644 _('destination largefile already exists'))
657 _('destination largefile already exists'))
645 copiedfiles.append((src, dest))
658 copiedfiles.append((src, dest))
646 origcopyfile(src, dest)
659 origcopyfile(src, dest)
647
660
648 util.copyfile = overridecopyfile
661 util.copyfile = overridecopyfile
649 result += orig(ui, repo, listpats, opts, rename)
662 result += orig(ui, repo, listpats, opts, rename)
650 finally:
663 finally:
651 util.copyfile = origcopyfile
664 util.copyfile = origcopyfile
652
665
653 lfdirstate = lfutil.openlfdirstate(ui, repo)
666 lfdirstate = lfutil.openlfdirstate(ui, repo)
654 for (src, dest) in copiedfiles:
667 for (src, dest) in copiedfiles:
655 if (lfutil.shortname in src and
668 if (lfutil.shortname in src and
656 dest.startswith(repo.wjoin(lfutil.shortname))):
669 dest.startswith(repo.wjoin(lfutil.shortname))):
657 srclfile = src.replace(repo.wjoin(lfutil.standin('')), '')
670 srclfile = src.replace(repo.wjoin(lfutil.standin('')), '')
658 destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '')
671 destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '')
659 destlfiledir = os.path.dirname(repo.wjoin(destlfile)) or '.'
672 destlfiledir = os.path.dirname(repo.wjoin(destlfile)) or '.'
660 if not os.path.isdir(destlfiledir):
673 if not os.path.isdir(destlfiledir):
661 os.makedirs(destlfiledir)
674 os.makedirs(destlfiledir)
662 if rename:
675 if rename:
663 os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
676 os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
664
677
665 # The file is gone, but this deletes any empty parent
678 # The file is gone, but this deletes any empty parent
666 # directories as a side-effect.
679 # directories as a side-effect.
667 util.unlinkpath(repo.wjoin(srclfile), True)
680 util.unlinkpath(repo.wjoin(srclfile), True)
668 lfdirstate.remove(srclfile)
681 lfdirstate.remove(srclfile)
669 else:
682 else:
670 util.copyfile(repo.wjoin(srclfile),
683 util.copyfile(repo.wjoin(srclfile),
671 repo.wjoin(destlfile))
684 repo.wjoin(destlfile))
672
685
673 lfdirstate.add(destlfile)
686 lfdirstate.add(destlfile)
674 lfdirstate.write()
687 lfdirstate.write()
675 except util.Abort, e:
688 except util.Abort, e:
676 if str(e) != _('no files to copy'):
689 if str(e) != _('no files to copy'):
677 raise e
690 raise e
678 else:
691 else:
679 nolfiles = True
692 nolfiles = True
680 finally:
693 finally:
681 restorematchfn()
694 restorematchfn()
682 wlock.release()
695 wlock.release()
683
696
684 if nolfiles and nonormalfiles:
697 if nolfiles and nonormalfiles:
685 raise util.Abort(_('no files to copy'))
698 raise util.Abort(_('no files to copy'))
686
699
687 return result
700 return result
688
701
689 # When the user calls revert, we have to be careful to not revert any
702 # When the user calls revert, we have to be careful to not revert any
690 # changes to other largefiles accidentally. This means we have to keep
703 # changes to other largefiles accidentally. This means we have to keep
691 # track of the largefiles that are being reverted so we only pull down
704 # track of the largefiles that are being reverted so we only pull down
692 # the necessary largefiles.
705 # the necessary largefiles.
693 #
706 #
694 # Standins are only updated (to match the hash of largefiles) before
707 # Standins are only updated (to match the hash of largefiles) before
695 # commits. Update the standins then run the original revert, changing
708 # commits. Update the standins then run the original revert, changing
696 # the matcher to hit standins instead of largefiles. Based on the
709 # the matcher to hit standins instead of largefiles. Based on the
697 # resulting standins update the largefiles.
710 # resulting standins update the largefiles.
698 def overriderevert(orig, ui, repo, *pats, **opts):
711 def overriderevert(orig, ui, repo, *pats, **opts):
699 # Because we put the standins in a bad state (by updating them)
712 # Because we put the standins in a bad state (by updating them)
700 # and then return them to a correct state we need to lock to
713 # and then return them to a correct state we need to lock to
701 # prevent others from changing them in their incorrect state.
714 # prevent others from changing them in their incorrect state.
702 wlock = repo.wlock()
715 wlock = repo.wlock()
703 try:
716 try:
704 lfdirstate = lfutil.openlfdirstate(ui, repo)
717 lfdirstate = lfutil.openlfdirstate(ui, repo)
705 s = lfutil.lfdirstatestatus(lfdirstate, repo)
718 s = lfutil.lfdirstatestatus(lfdirstate, repo)
706 lfdirstate.write()
719 lfdirstate.write()
707 for lfile in s.modified:
720 for lfile in s.modified:
708 lfutil.updatestandin(repo, lfutil.standin(lfile))
721 lfutil.updatestandin(repo, lfutil.standin(lfile))
709 for lfile in s.deleted:
722 for lfile in s.deleted:
710 if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
723 if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
711 os.unlink(repo.wjoin(lfutil.standin(lfile)))
724 os.unlink(repo.wjoin(lfutil.standin(lfile)))
712
725
713 oldstandins = lfutil.getstandinsstate(repo)
726 oldstandins = lfutil.getstandinsstate(repo)
714
727
715 def overridematch(ctx, pats=[], opts={}, globbed=False,
728 def overridematch(ctx, pats=[], opts={}, globbed=False,
716 default='relpath'):
729 default='relpath'):
717 match = oldmatch(ctx, pats, opts, globbed, default)
730 match = oldmatch(ctx, pats, opts, globbed, default)
718 m = copy.copy(match)
731 m = copy.copy(match)
719
732
720 # revert supports recursing into subrepos, and though largefiles
733 # revert supports recursing into subrepos, and though largefiles
721 # currently doesn't work correctly in that case, this match is
734 # currently doesn't work correctly in that case, this match is
722 # called, so the lfdirstate above may not be the correct one for
735 # called, so the lfdirstate above may not be the correct one for
723 # this invocation of match.
736 # this invocation of match.
724 lfdirstate = lfutil.openlfdirstate(ctx._repo.ui, ctx._repo, False)
737 lfdirstate = lfutil.openlfdirstate(ctx._repo.ui, ctx._repo, False)
725
738
726 def tostandin(f):
739 def tostandin(f):
727 if lfutil.standin(f) in ctx:
740 if lfutil.standin(f) in ctx:
728 return lfutil.standin(f)
741 return lfutil.standin(f)
729 elif lfutil.standin(f) in repo[None] or lfdirstate[f] == 'r':
742 elif lfutil.standin(f) in repo[None] or lfdirstate[f] == 'r':
730 return None
743 return None
731 return f
744 return f
732 m._files = [tostandin(f) for f in m._files]
745 m._files = [tostandin(f) for f in m._files]
733 m._files = [f for f in m._files if f is not None]
746 m._files = [f for f in m._files if f is not None]
734 m._fmap = set(m._files)
747 m._fmap = set(m._files)
735 origmatchfn = m.matchfn
748 origmatchfn = m.matchfn
736 def matchfn(f):
749 def matchfn(f):
737 if lfutil.isstandin(f):
750 if lfutil.isstandin(f):
738 return (origmatchfn(lfutil.splitstandin(f)) and
751 return (origmatchfn(lfutil.splitstandin(f)) and
739 (f in repo[None] or f in ctx))
752 (f in repo[None] or f in ctx))
740 return origmatchfn(f)
753 return origmatchfn(f)
741 m.matchfn = matchfn
754 m.matchfn = matchfn
742 return m
755 return m
743 oldmatch = installmatchfn(overridematch)
756 oldmatch = installmatchfn(overridematch)
744 try:
757 try:
745 orig(ui, repo, *pats, **opts)
758 orig(ui, repo, *pats, **opts)
746 finally:
759 finally:
747 restorematchfn()
760 restorematchfn()
748
761
749 newstandins = lfutil.getstandinsstate(repo)
762 newstandins = lfutil.getstandinsstate(repo)
750 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
763 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
751 # lfdirstate should be 'normallookup'-ed for updated files,
764 # lfdirstate should be 'normallookup'-ed for updated files,
752 # because reverting doesn't touch dirstate for 'normal' files
765 # because reverting doesn't touch dirstate for 'normal' files
753 # when target revision is explicitly specified: in such case,
766 # when target revision is explicitly specified: in such case,
754 # 'n' and valid timestamp in dirstate doesn't ensure 'clean'
767 # 'n' and valid timestamp in dirstate doesn't ensure 'clean'
755 # of target (standin) file.
768 # of target (standin) file.
756 lfcommands.updatelfiles(ui, repo, filelist, printmessage=False,
769 lfcommands.updatelfiles(ui, repo, filelist, printmessage=False,
757 normallookup=True)
770 normallookup=True)
758
771
759 finally:
772 finally:
760 wlock.release()
773 wlock.release()
761
774
762 # after pulling changesets, we need to take some extra care to get
775 # after pulling changesets, we need to take some extra care to get
763 # largefiles updated remotely
776 # largefiles updated remotely
764 def overridepull(orig, ui, repo, source=None, **opts):
777 def overridepull(orig, ui, repo, source=None, **opts):
765 revsprepull = len(repo)
778 revsprepull = len(repo)
766 if not source:
779 if not source:
767 source = 'default'
780 source = 'default'
768 repo.lfpullsource = source
781 repo.lfpullsource = source
769 result = orig(ui, repo, source, **opts)
782 result = orig(ui, repo, source, **opts)
770 revspostpull = len(repo)
783 revspostpull = len(repo)
771 lfrevs = opts.get('lfrev', [])
784 lfrevs = opts.get('lfrev', [])
772 if opts.get('all_largefiles'):
785 if opts.get('all_largefiles'):
773 lfrevs.append('pulled()')
786 lfrevs.append('pulled()')
774 if lfrevs and revspostpull > revsprepull:
787 if lfrevs and revspostpull > revsprepull:
775 numcached = 0
788 numcached = 0
776 repo.firstpulled = revsprepull # for pulled() revset expression
789 repo.firstpulled = revsprepull # for pulled() revset expression
777 try:
790 try:
778 for rev in scmutil.revrange(repo, lfrevs):
791 for rev in scmutil.revrange(repo, lfrevs):
779 ui.note(_('pulling largefiles for revision %s\n') % rev)
792 ui.note(_('pulling largefiles for revision %s\n') % rev)
780 (cached, missing) = lfcommands.cachelfiles(ui, repo, rev)
793 (cached, missing) = lfcommands.cachelfiles(ui, repo, rev)
781 numcached += len(cached)
794 numcached += len(cached)
782 finally:
795 finally:
783 del repo.firstpulled
796 del repo.firstpulled
784 ui.status(_("%d largefiles cached\n") % numcached)
797 ui.status(_("%d largefiles cached\n") % numcached)
785 return result
798 return result
786
799
787 def pulledrevsetsymbol(repo, subset, x):
800 def pulledrevsetsymbol(repo, subset, x):
788 """``pulled()``
801 """``pulled()``
789 Changesets that just has been pulled.
802 Changesets that just has been pulled.
790
803
791 Only available with largefiles from pull --lfrev expressions.
804 Only available with largefiles from pull --lfrev expressions.
792
805
793 .. container:: verbose
806 .. container:: verbose
794
807
795 Some examples:
808 Some examples:
796
809
797 - pull largefiles for all new changesets::
810 - pull largefiles for all new changesets::
798
811
799 hg pull -lfrev "pulled()"
812 hg pull -lfrev "pulled()"
800
813
801 - pull largefiles for all new branch heads::
814 - pull largefiles for all new branch heads::
802
815
803 hg pull -lfrev "head(pulled()) and not closed()"
816 hg pull -lfrev "head(pulled()) and not closed()"
804
817
805 """
818 """
806
819
807 try:
820 try:
808 firstpulled = repo.firstpulled
821 firstpulled = repo.firstpulled
809 except AttributeError:
822 except AttributeError:
810 raise util.Abort(_("pulled() only available in --lfrev"))
823 raise util.Abort(_("pulled() only available in --lfrev"))
811 return revset.baseset([r for r in subset if r >= firstpulled])
824 return revset.baseset([r for r in subset if r >= firstpulled])
812
825
813 def overrideclone(orig, ui, source, dest=None, **opts):
826 def overrideclone(orig, ui, source, dest=None, **opts):
814 d = dest
827 d = dest
815 if d is None:
828 if d is None:
816 d = hg.defaultdest(source)
829 d = hg.defaultdest(source)
817 if opts.get('all_largefiles') and not hg.islocal(d):
830 if opts.get('all_largefiles') and not hg.islocal(d):
818 raise util.Abort(_(
831 raise util.Abort(_(
819 '--all-largefiles is incompatible with non-local destination %s') %
832 '--all-largefiles is incompatible with non-local destination %s') %
820 d)
833 d)
821
834
822 return orig(ui, source, dest, **opts)
835 return orig(ui, source, dest, **opts)
823
836
824 def hgclone(orig, ui, opts, *args, **kwargs):
837 def hgclone(orig, ui, opts, *args, **kwargs):
825 result = orig(ui, opts, *args, **kwargs)
838 result = orig(ui, opts, *args, **kwargs)
826
839
827 if result is not None:
840 if result is not None:
828 sourcerepo, destrepo = result
841 sourcerepo, destrepo = result
829 repo = destrepo.local()
842 repo = destrepo.local()
830
843
831 # If largefiles is required for this repo, permanently enable it locally
844 # If largefiles is required for this repo, permanently enable it locally
832 if 'largefiles' in repo.requirements:
845 if 'largefiles' in repo.requirements:
833 fp = repo.vfs('hgrc', 'a', text=True)
846 fp = repo.vfs('hgrc', 'a', text=True)
834 try:
847 try:
835 fp.write('\n[extensions]\nlargefiles=\n')
848 fp.write('\n[extensions]\nlargefiles=\n')
836 finally:
849 finally:
837 fp.close()
850 fp.close()
838
851
839 # Caching is implicitly limited to 'rev' option, since the dest repo was
852 # Caching is implicitly limited to 'rev' option, since the dest repo was
840 # truncated at that point. The user may expect a download count with
853 # truncated at that point. The user may expect a download count with
841 # this option, so attempt whether or not this is a largefile repo.
854 # this option, so attempt whether or not this is a largefile repo.
842 if opts.get('all_largefiles'):
855 if opts.get('all_largefiles'):
843 success, missing = lfcommands.downloadlfiles(ui, repo, None)
856 success, missing = lfcommands.downloadlfiles(ui, repo, None)
844
857
845 if missing != 0:
858 if missing != 0:
846 return None
859 return None
847
860
848 return result
861 return result
849
862
850 def overriderebase(orig, ui, repo, **opts):
863 def overriderebase(orig, ui, repo, **opts):
851 if not util.safehasattr(repo, '_largefilesenabled'):
864 if not util.safehasattr(repo, '_largefilesenabled'):
852 return orig(ui, repo, **opts)
865 return orig(ui, repo, **opts)
853
866
854 resuming = opts.get('continue')
867 resuming = opts.get('continue')
855 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
868 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
856 repo._lfstatuswriters.append(lambda *msg, **opts: None)
869 repo._lfstatuswriters.append(lambda *msg, **opts: None)
857 try:
870 try:
858 return orig(ui, repo, **opts)
871 return orig(ui, repo, **opts)
859 finally:
872 finally:
860 repo._lfstatuswriters.pop()
873 repo._lfstatuswriters.pop()
861 repo._lfcommithooks.pop()
874 repo._lfcommithooks.pop()
862
875
863 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
876 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
864 prefix='', mtime=None, subrepos=None):
877 prefix='', mtime=None, subrepos=None):
865 # No need to lock because we are only reading history and
878 # No need to lock because we are only reading history and
866 # largefile caches, neither of which are modified.
879 # largefile caches, neither of which are modified.
867 lfcommands.cachelfiles(repo.ui, repo, node)
880 lfcommands.cachelfiles(repo.ui, repo, node)
868
881
869 if kind not in archival.archivers:
882 if kind not in archival.archivers:
870 raise util.Abort(_("unknown archive type '%s'") % kind)
883 raise util.Abort(_("unknown archive type '%s'") % kind)
871
884
872 ctx = repo[node]
885 ctx = repo[node]
873
886
874 if kind == 'files':
887 if kind == 'files':
875 if prefix:
888 if prefix:
876 raise util.Abort(
889 raise util.Abort(
877 _('cannot give prefix when archiving to files'))
890 _('cannot give prefix when archiving to files'))
878 else:
891 else:
879 prefix = archival.tidyprefix(dest, kind, prefix)
892 prefix = archival.tidyprefix(dest, kind, prefix)
880
893
881 def write(name, mode, islink, getdata):
894 def write(name, mode, islink, getdata):
882 if matchfn and not matchfn(name):
895 if matchfn and not matchfn(name):
883 return
896 return
884 data = getdata()
897 data = getdata()
885 if decode:
898 if decode:
886 data = repo.wwritedata(name, data)
899 data = repo.wwritedata(name, data)
887 archiver.addfile(prefix + name, mode, islink, data)
900 archiver.addfile(prefix + name, mode, islink, data)
888
901
889 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
902 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
890
903
891 if repo.ui.configbool("ui", "archivemeta", True):
904 if repo.ui.configbool("ui", "archivemeta", True):
892 def metadata():
905 def metadata():
893 base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
906 base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
894 hex(repo.changelog.node(0)), hex(node), ctx.branch())
907 hex(repo.changelog.node(0)), hex(node), ctx.branch())
895
908
896 tags = ''.join('tag: %s\n' % t for t in ctx.tags()
909 tags = ''.join('tag: %s\n' % t for t in ctx.tags()
897 if repo.tagtype(t) == 'global')
910 if repo.tagtype(t) == 'global')
898 if not tags:
911 if not tags:
899 repo.ui.pushbuffer()
912 repo.ui.pushbuffer()
900 opts = {'template': '{latesttag}\n{latesttagdistance}',
913 opts = {'template': '{latesttag}\n{latesttagdistance}',
901 'style': '', 'patch': None, 'git': None}
914 'style': '', 'patch': None, 'git': None}
902 cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
915 cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
903 ltags, dist = repo.ui.popbuffer().split('\n')
916 ltags, dist = repo.ui.popbuffer().split('\n')
904 tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':'))
917 tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':'))
905 tags += 'latesttagdistance: %s\n' % dist
918 tags += 'latesttagdistance: %s\n' % dist
906
919
907 return base + tags
920 return base + tags
908
921
909 write('.hg_archival.txt', 0644, False, metadata)
922 write('.hg_archival.txt', 0644, False, metadata)
910
923
911 for f in ctx:
924 for f in ctx:
912 ff = ctx.flags(f)
925 ff = ctx.flags(f)
913 getdata = ctx[f].data
926 getdata = ctx[f].data
914 if lfutil.isstandin(f):
927 if lfutil.isstandin(f):
915 path = lfutil.findfile(repo, getdata().strip())
928 path = lfutil.findfile(repo, getdata().strip())
916 if path is None:
929 if path is None:
917 raise util.Abort(
930 raise util.Abort(
918 _('largefile %s not found in repo store or system cache')
931 _('largefile %s not found in repo store or system cache')
919 % lfutil.splitstandin(f))
932 % lfutil.splitstandin(f))
920 f = lfutil.splitstandin(f)
933 f = lfutil.splitstandin(f)
921
934
922 def getdatafn():
935 def getdatafn():
923 fd = None
936 fd = None
924 try:
937 try:
925 fd = open(path, 'rb')
938 fd = open(path, 'rb')
926 return fd.read()
939 return fd.read()
927 finally:
940 finally:
928 if fd:
941 if fd:
929 fd.close()
942 fd.close()
930
943
931 getdata = getdatafn
944 getdata = getdatafn
932 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
945 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
933
946
934 if subrepos:
947 if subrepos:
935 for subpath in sorted(ctx.substate):
948 for subpath in sorted(ctx.substate):
936 sub = ctx.sub(subpath)
949 sub = ctx.sub(subpath)
937 submatch = match_.narrowmatcher(subpath, matchfn)
950 submatch = match_.narrowmatcher(subpath, matchfn)
938 sub.archive(archiver, prefix, submatch)
951 sub.archive(archiver, prefix, submatch)
939
952
940 archiver.done()
953 archiver.done()
941
954
942 def hgsubrepoarchive(orig, repo, archiver, prefix, match=None):
955 def hgsubrepoarchive(orig, repo, archiver, prefix, match=None):
943 repo._get(repo._state + ('hg',))
956 repo._get(repo._state + ('hg',))
944 rev = repo._state[1]
957 rev = repo._state[1]
945 ctx = repo._repo[rev]
958 ctx = repo._repo[rev]
946
959
947 lfcommands.cachelfiles(repo.ui, repo._repo, ctx.node())
960 lfcommands.cachelfiles(repo.ui, repo._repo, ctx.node())
948
961
949 def write(name, mode, islink, getdata):
962 def write(name, mode, islink, getdata):
950 # At this point, the standin has been replaced with the largefile name,
963 # At this point, the standin has been replaced with the largefile name,
951 # so the normal matcher works here without the lfutil variants.
964 # so the normal matcher works here without the lfutil variants.
952 if match and not match(f):
965 if match and not match(f):
953 return
966 return
954 data = getdata()
967 data = getdata()
955
968
956 archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data)
969 archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data)
957
970
958 for f in ctx:
971 for f in ctx:
959 ff = ctx.flags(f)
972 ff = ctx.flags(f)
960 getdata = ctx[f].data
973 getdata = ctx[f].data
961 if lfutil.isstandin(f):
974 if lfutil.isstandin(f):
962 path = lfutil.findfile(repo._repo, getdata().strip())
975 path = lfutil.findfile(repo._repo, getdata().strip())
963 if path is None:
976 if path is None:
964 raise util.Abort(
977 raise util.Abort(
965 _('largefile %s not found in repo store or system cache')
978 _('largefile %s not found in repo store or system cache')
966 % lfutil.splitstandin(f))
979 % lfutil.splitstandin(f))
967 f = lfutil.splitstandin(f)
980 f = lfutil.splitstandin(f)
968
981
969 def getdatafn():
982 def getdatafn():
970 fd = None
983 fd = None
971 try:
984 try:
972 fd = open(os.path.join(prefix, path), 'rb')
985 fd = open(os.path.join(prefix, path), 'rb')
973 return fd.read()
986 return fd.read()
974 finally:
987 finally:
975 if fd:
988 if fd:
976 fd.close()
989 fd.close()
977
990
978 getdata = getdatafn
991 getdata = getdatafn
979
992
980 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
993 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
981
994
982 for subpath in sorted(ctx.substate):
995 for subpath in sorted(ctx.substate):
983 sub = ctx.sub(subpath)
996 sub = ctx.sub(subpath)
984 submatch = match_.narrowmatcher(subpath, match)
997 submatch = match_.narrowmatcher(subpath, match)
985 sub.archive(archiver, os.path.join(prefix, repo._path) + '/', submatch)
998 sub.archive(archiver, os.path.join(prefix, repo._path) + '/', submatch)
986
999
987 # If a largefile is modified, the change is not reflected in its
1000 # If a largefile is modified, the change is not reflected in its
988 # standin until a commit. cmdutil.bailifchanged() raises an exception
1001 # standin until a commit. cmdutil.bailifchanged() raises an exception
989 # if the repo has uncommitted changes. Wrap it to also check if
1002 # if the repo has uncommitted changes. Wrap it to also check if
990 # largefiles were changed. This is used by bisect, backout and fetch.
1003 # largefiles were changed. This is used by bisect, backout and fetch.
991 def overridebailifchanged(orig, repo):
1004 def overridebailifchanged(orig, repo):
992 orig(repo)
1005 orig(repo)
993 repo.lfstatus = True
1006 repo.lfstatus = True
994 s = repo.status()
1007 s = repo.status()
995 repo.lfstatus = False
1008 repo.lfstatus = False
996 if s.modified or s.added or s.removed or s.deleted:
1009 if s.modified or s.added or s.removed or s.deleted:
997 raise util.Abort(_('uncommitted changes'))
1010 raise util.Abort(_('uncommitted changes'))
998
1011
999 def cmdutilforget(orig, ui, repo, match, prefix, explicitonly):
1012 def cmdutilforget(orig, ui, repo, match, prefix, explicitonly):
1000 normalmatcher = composenormalfilematcher(match, repo[None].manifest())
1013 normalmatcher = composenormalfilematcher(match, repo[None].manifest())
1001 bad, forgot = orig(ui, repo, normalmatcher, prefix, explicitonly)
1014 bad, forgot = orig(ui, repo, normalmatcher, prefix, explicitonly)
1002 m = composelargefilematcher(match, repo[None].manifest())
1015 m = composelargefilematcher(match, repo[None].manifest())
1003
1016
1004 try:
1017 try:
1005 repo.lfstatus = True
1018 repo.lfstatus = True
1006 s = repo.status(match=m, clean=True)
1019 s = repo.status(match=m, clean=True)
1007 finally:
1020 finally:
1008 repo.lfstatus = False
1021 repo.lfstatus = False
1009 forget = sorted(s.modified + s.added + s.deleted + s.clean)
1022 forget = sorted(s.modified + s.added + s.deleted + s.clean)
1010 forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()]
1023 forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()]
1011
1024
1012 for f in forget:
1025 for f in forget:
1013 if lfutil.standin(f) not in repo.dirstate and not \
1026 if lfutil.standin(f) not in repo.dirstate and not \
1014 repo.wvfs.isdir(lfutil.standin(f)):
1027 repo.wvfs.isdir(lfutil.standin(f)):
1015 ui.warn(_('not removing %s: file is already untracked\n')
1028 ui.warn(_('not removing %s: file is already untracked\n')
1016 % m.rel(f))
1029 % m.rel(f))
1017 bad.append(f)
1030 bad.append(f)
1018
1031
1019 for f in forget:
1032 for f in forget:
1020 if ui.verbose or not m.exact(f):
1033 if ui.verbose or not m.exact(f):
1021 ui.status(_('removing %s\n') % m.rel(f))
1034 ui.status(_('removing %s\n') % m.rel(f))
1022
1035
1023 # Need to lock because standin files are deleted then removed from the
1036 # Need to lock because standin files are deleted then removed from the
1024 # repository and we could race in-between.
1037 # repository and we could race in-between.
1025 wlock = repo.wlock()
1038 wlock = repo.wlock()
1026 try:
1039 try:
1027 lfdirstate = lfutil.openlfdirstate(ui, repo)
1040 lfdirstate = lfutil.openlfdirstate(ui, repo)
1028 for f in forget:
1041 for f in forget:
1029 if lfdirstate[f] == 'a':
1042 if lfdirstate[f] == 'a':
1030 lfdirstate.drop(f)
1043 lfdirstate.drop(f)
1031 else:
1044 else:
1032 lfdirstate.remove(f)
1045 lfdirstate.remove(f)
1033 lfdirstate.write()
1046 lfdirstate.write()
1034 standins = [lfutil.standin(f) for f in forget]
1047 standins = [lfutil.standin(f) for f in forget]
1035 for f in standins:
1048 for f in standins:
1036 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1049 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
1037 rejected = repo[None].forget(standins)
1050 rejected = repo[None].forget(standins)
1038 finally:
1051 finally:
1039 wlock.release()
1052 wlock.release()
1040
1053
1041 bad.extend(f for f in rejected if f in m.files())
1054 bad.extend(f for f in rejected if f in m.files())
1042 forgot.extend(f for f in forget if f not in rejected)
1055 forgot.extend(f for f in forget if f not in rejected)
1043 return bad, forgot
1056 return bad, forgot
1044
1057
1045 def _getoutgoings(repo, other, missing, addfunc):
1058 def _getoutgoings(repo, other, missing, addfunc):
1046 """get pairs of filename and largefile hash in outgoing revisions
1059 """get pairs of filename and largefile hash in outgoing revisions
1047 in 'missing'.
1060 in 'missing'.
1048
1061
1049 largefiles already existing on 'other' repository are ignored.
1062 largefiles already existing on 'other' repository are ignored.
1050
1063
1051 'addfunc' is invoked with each unique pairs of filename and
1064 'addfunc' is invoked with each unique pairs of filename and
1052 largefile hash value.
1065 largefile hash value.
1053 """
1066 """
1054 knowns = set()
1067 knowns = set()
1055 lfhashes = set()
1068 lfhashes = set()
1056 def dedup(fn, lfhash):
1069 def dedup(fn, lfhash):
1057 k = (fn, lfhash)
1070 k = (fn, lfhash)
1058 if k not in knowns:
1071 if k not in knowns:
1059 knowns.add(k)
1072 knowns.add(k)
1060 lfhashes.add(lfhash)
1073 lfhashes.add(lfhash)
1061 lfutil.getlfilestoupload(repo, missing, dedup)
1074 lfutil.getlfilestoupload(repo, missing, dedup)
1062 if lfhashes:
1075 if lfhashes:
1063 lfexists = basestore._openstore(repo, other).exists(lfhashes)
1076 lfexists = basestore._openstore(repo, other).exists(lfhashes)
1064 for fn, lfhash in knowns:
1077 for fn, lfhash in knowns:
1065 if not lfexists[lfhash]: # lfhash doesn't exist on "other"
1078 if not lfexists[lfhash]: # lfhash doesn't exist on "other"
1066 addfunc(fn, lfhash)
1079 addfunc(fn, lfhash)
1067
1080
1068 def outgoinghook(ui, repo, other, opts, missing):
1081 def outgoinghook(ui, repo, other, opts, missing):
1069 if opts.pop('large', None):
1082 if opts.pop('large', None):
1070 lfhashes = set()
1083 lfhashes = set()
1071 if ui.debugflag:
1084 if ui.debugflag:
1072 toupload = {}
1085 toupload = {}
1073 def addfunc(fn, lfhash):
1086 def addfunc(fn, lfhash):
1074 if fn not in toupload:
1087 if fn not in toupload:
1075 toupload[fn] = []
1088 toupload[fn] = []
1076 toupload[fn].append(lfhash)
1089 toupload[fn].append(lfhash)
1077 lfhashes.add(lfhash)
1090 lfhashes.add(lfhash)
1078 def showhashes(fn):
1091 def showhashes(fn):
1079 for lfhash in sorted(toupload[fn]):
1092 for lfhash in sorted(toupload[fn]):
1080 ui.debug(' %s\n' % (lfhash))
1093 ui.debug(' %s\n' % (lfhash))
1081 else:
1094 else:
1082 toupload = set()
1095 toupload = set()
1083 def addfunc(fn, lfhash):
1096 def addfunc(fn, lfhash):
1084 toupload.add(fn)
1097 toupload.add(fn)
1085 lfhashes.add(lfhash)
1098 lfhashes.add(lfhash)
1086 def showhashes(fn):
1099 def showhashes(fn):
1087 pass
1100 pass
1088 _getoutgoings(repo, other, missing, addfunc)
1101 _getoutgoings(repo, other, missing, addfunc)
1089
1102
1090 if not toupload:
1103 if not toupload:
1091 ui.status(_('largefiles: no files to upload\n'))
1104 ui.status(_('largefiles: no files to upload\n'))
1092 else:
1105 else:
1093 ui.status(_('largefiles to upload (%d entities):\n')
1106 ui.status(_('largefiles to upload (%d entities):\n')
1094 % (len(lfhashes)))
1107 % (len(lfhashes)))
1095 for file in sorted(toupload):
1108 for file in sorted(toupload):
1096 ui.status(lfutil.splitstandin(file) + '\n')
1109 ui.status(lfutil.splitstandin(file) + '\n')
1097 showhashes(file)
1110 showhashes(file)
1098 ui.status('\n')
1111 ui.status('\n')
1099
1112
1100 def summaryremotehook(ui, repo, opts, changes):
1113 def summaryremotehook(ui, repo, opts, changes):
1101 largeopt = opts.get('large', False)
1114 largeopt = opts.get('large', False)
1102 if changes is None:
1115 if changes is None:
1103 if largeopt:
1116 if largeopt:
1104 return (False, True) # only outgoing check is needed
1117 return (False, True) # only outgoing check is needed
1105 else:
1118 else:
1106 return (False, False)
1119 return (False, False)
1107 elif largeopt:
1120 elif largeopt:
1108 url, branch, peer, outgoing = changes[1]
1121 url, branch, peer, outgoing = changes[1]
1109 if peer is None:
1122 if peer is None:
1110 # i18n: column positioning for "hg summary"
1123 # i18n: column positioning for "hg summary"
1111 ui.status(_('largefiles: (no remote repo)\n'))
1124 ui.status(_('largefiles: (no remote repo)\n'))
1112 return
1125 return
1113
1126
1114 toupload = set()
1127 toupload = set()
1115 lfhashes = set()
1128 lfhashes = set()
1116 def addfunc(fn, lfhash):
1129 def addfunc(fn, lfhash):
1117 toupload.add(fn)
1130 toupload.add(fn)
1118 lfhashes.add(lfhash)
1131 lfhashes.add(lfhash)
1119 _getoutgoings(repo, peer, outgoing.missing, addfunc)
1132 _getoutgoings(repo, peer, outgoing.missing, addfunc)
1120
1133
1121 if not toupload:
1134 if not toupload:
1122 # i18n: column positioning for "hg summary"
1135 # i18n: column positioning for "hg summary"
1123 ui.status(_('largefiles: (no files to upload)\n'))
1136 ui.status(_('largefiles: (no files to upload)\n'))
1124 else:
1137 else:
1125 # i18n: column positioning for "hg summary"
1138 # i18n: column positioning for "hg summary"
1126 ui.status(_('largefiles: %d entities for %d files to upload\n')
1139 ui.status(_('largefiles: %d entities for %d files to upload\n')
1127 % (len(lfhashes), len(toupload)))
1140 % (len(lfhashes), len(toupload)))
1128
1141
1129 def overridesummary(orig, ui, repo, *pats, **opts):
1142 def overridesummary(orig, ui, repo, *pats, **opts):
1130 try:
1143 try:
1131 repo.lfstatus = True
1144 repo.lfstatus = True
1132 orig(ui, repo, *pats, **opts)
1145 orig(ui, repo, *pats, **opts)
1133 finally:
1146 finally:
1134 repo.lfstatus = False
1147 repo.lfstatus = False
1135
1148
1136 def scmutiladdremove(orig, repo, matcher, prefix, opts={}, dry_run=None,
1149 def scmutiladdremove(orig, repo, matcher, prefix, opts={}, dry_run=None,
1137 similarity=None):
1150 similarity=None):
1138 if not lfutil.islfilesrepo(repo):
1151 if not lfutil.islfilesrepo(repo):
1139 return orig(repo, matcher, prefix, opts, dry_run, similarity)
1152 return orig(repo, matcher, prefix, opts, dry_run, similarity)
1140 # Get the list of missing largefiles so we can remove them
1153 # Get the list of missing largefiles so we can remove them
1141 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1154 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1142 unsure, s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [],
1155 unsure, s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [],
1143 False, False, False)
1156 False, False, False)
1144
1157
1145 # Call into the normal remove code, but the removing of the standin, we want
1158 # Call into the normal remove code, but the removing of the standin, we want
1146 # to have handled by original addremove. Monkey patching here makes sure
1159 # to have handled by original addremove. Monkey patching here makes sure
1147 # we don't remove the standin in the largefiles code, preventing a very
1160 # we don't remove the standin in the largefiles code, preventing a very
1148 # confused state later.
1161 # confused state later.
1149 if s.deleted:
1162 if s.deleted:
1150 m = copy.copy(matcher)
1163 m = copy.copy(matcher)
1151
1164
1152 # The m._files and m._map attributes are not changed to the deleted list
1165 # The m._files and m._map attributes are not changed to the deleted list
1153 # because that affects the m.exact() test, which in turn governs whether
1166 # because that affects the m.exact() test, which in turn governs whether
1154 # or not the file name is printed, and how. Simply limit the original
1167 # or not the file name is printed, and how. Simply limit the original
1155 # matches to those in the deleted status list.
1168 # matches to those in the deleted status list.
1156 matchfn = m.matchfn
1169 matchfn = m.matchfn
1157 m.matchfn = lambda f: f in s.deleted and matchfn(f)
1170 m.matchfn = lambda f: f in s.deleted and matchfn(f)
1158
1171
1159 removelargefiles(repo.ui, repo, True, m, **opts)
1172 removelargefiles(repo.ui, repo, True, m, **opts)
1160 # Call into the normal add code, and any files that *should* be added as
1173 # Call into the normal add code, and any files that *should* be added as
1161 # largefiles will be
1174 # largefiles will be
1162 added, bad = addlargefiles(repo.ui, repo, True, matcher, **opts)
1175 added, bad = addlargefiles(repo.ui, repo, True, matcher, **opts)
1163 # Now that we've handled largefiles, hand off to the original addremove
1176 # Now that we've handled largefiles, hand off to the original addremove
1164 # function to take care of the rest. Make sure it doesn't do anything with
1177 # function to take care of the rest. Make sure it doesn't do anything with
1165 # largefiles by passing a matcher that will ignore them.
1178 # largefiles by passing a matcher that will ignore them.
1166 matcher = composenormalfilematcher(matcher, repo[None].manifest(), added)
1179 matcher = composenormalfilematcher(matcher, repo[None].manifest(), added)
1167 return orig(repo, matcher, prefix, opts, dry_run, similarity)
1180 return orig(repo, matcher, prefix, opts, dry_run, similarity)
1168
1181
1169 # Calling purge with --all will cause the largefiles to be deleted.
1182 # Calling purge with --all will cause the largefiles to be deleted.
1170 # Override repo.status to prevent this from happening.
1183 # Override repo.status to prevent this from happening.
1171 def overridepurge(orig, ui, repo, *dirs, **opts):
1184 def overridepurge(orig, ui, repo, *dirs, **opts):
1172 # XXX Monkey patching a repoview will not work. The assigned attribute will
1185 # XXX Monkey patching a repoview will not work. The assigned attribute will
1173 # be set on the unfiltered repo, but we will only lookup attributes in the
1186 # be set on the unfiltered repo, but we will only lookup attributes in the
1174 # unfiltered repo if the lookup in the repoview object itself fails. As the
1187 # unfiltered repo if the lookup in the repoview object itself fails. As the
1175 # monkey patched method exists on the repoview class the lookup will not
1188 # monkey patched method exists on the repoview class the lookup will not
1176 # fail. As a result, the original version will shadow the monkey patched
1189 # fail. As a result, the original version will shadow the monkey patched
1177 # one, defeating the monkey patch.
1190 # one, defeating the monkey patch.
1178 #
1191 #
1179 # As a work around we use an unfiltered repo here. We should do something
1192 # As a work around we use an unfiltered repo here. We should do something
1180 # cleaner instead.
1193 # cleaner instead.
1181 repo = repo.unfiltered()
1194 repo = repo.unfiltered()
1182 oldstatus = repo.status
1195 oldstatus = repo.status
1183 def overridestatus(node1='.', node2=None, match=None, ignored=False,
1196 def overridestatus(node1='.', node2=None, match=None, ignored=False,
1184 clean=False, unknown=False, listsubrepos=False):
1197 clean=False, unknown=False, listsubrepos=False):
1185 r = oldstatus(node1, node2, match, ignored, clean, unknown,
1198 r = oldstatus(node1, node2, match, ignored, clean, unknown,
1186 listsubrepos)
1199 listsubrepos)
1187 lfdirstate = lfutil.openlfdirstate(ui, repo)
1200 lfdirstate = lfutil.openlfdirstate(ui, repo)
1188 unknown = [f for f in r.unknown if lfdirstate[f] == '?']
1201 unknown = [f for f in r.unknown if lfdirstate[f] == '?']
1189 ignored = [f for f in r.ignored if lfdirstate[f] == '?']
1202 ignored = [f for f in r.ignored if lfdirstate[f] == '?']
1190 return scmutil.status(r.modified, r.added, r.removed, r.deleted,
1203 return scmutil.status(r.modified, r.added, r.removed, r.deleted,
1191 unknown, ignored, r.clean)
1204 unknown, ignored, r.clean)
1192 repo.status = overridestatus
1205 repo.status = overridestatus
1193 orig(ui, repo, *dirs, **opts)
1206 orig(ui, repo, *dirs, **opts)
1194 repo.status = oldstatus
1207 repo.status = oldstatus
1195 def overriderollback(orig, ui, repo, **opts):
1208 def overriderollback(orig, ui, repo, **opts):
1196 wlock = repo.wlock()
1209 wlock = repo.wlock()
1197 try:
1210 try:
1198 before = repo.dirstate.parents()
1211 before = repo.dirstate.parents()
1199 orphans = set(f for f in repo.dirstate
1212 orphans = set(f for f in repo.dirstate
1200 if lfutil.isstandin(f) and repo.dirstate[f] != 'r')
1213 if lfutil.isstandin(f) and repo.dirstate[f] != 'r')
1201 result = orig(ui, repo, **opts)
1214 result = orig(ui, repo, **opts)
1202 after = repo.dirstate.parents()
1215 after = repo.dirstate.parents()
1203 if before == after:
1216 if before == after:
1204 return result # no need to restore standins
1217 return result # no need to restore standins
1205
1218
1206 pctx = repo['.']
1219 pctx = repo['.']
1207 for f in repo.dirstate:
1220 for f in repo.dirstate:
1208 if lfutil.isstandin(f):
1221 if lfutil.isstandin(f):
1209 orphans.discard(f)
1222 orphans.discard(f)
1210 if repo.dirstate[f] == 'r':
1223 if repo.dirstate[f] == 'r':
1211 repo.wvfs.unlinkpath(f, ignoremissing=True)
1224 repo.wvfs.unlinkpath(f, ignoremissing=True)
1212 elif f in pctx:
1225 elif f in pctx:
1213 fctx = pctx[f]
1226 fctx = pctx[f]
1214 repo.wwrite(f, fctx.data(), fctx.flags())
1227 repo.wwrite(f, fctx.data(), fctx.flags())
1215 else:
1228 else:
1216 # content of standin is not so important in 'a',
1229 # content of standin is not so important in 'a',
1217 # 'm' or 'n' (coming from the 2nd parent) cases
1230 # 'm' or 'n' (coming from the 2nd parent) cases
1218 lfutil.writestandin(repo, f, '', False)
1231 lfutil.writestandin(repo, f, '', False)
1219 for standin in orphans:
1232 for standin in orphans:
1220 repo.wvfs.unlinkpath(standin, ignoremissing=True)
1233 repo.wvfs.unlinkpath(standin, ignoremissing=True)
1221
1234
1222 lfdirstate = lfutil.openlfdirstate(ui, repo)
1235 lfdirstate = lfutil.openlfdirstate(ui, repo)
1223 orphans = set(lfdirstate)
1236 orphans = set(lfdirstate)
1224 lfiles = lfutil.listlfiles(repo)
1237 lfiles = lfutil.listlfiles(repo)
1225 for file in lfiles:
1238 for file in lfiles:
1226 lfutil.synclfdirstate(repo, lfdirstate, file, True)
1239 lfutil.synclfdirstate(repo, lfdirstate, file, True)
1227 orphans.discard(file)
1240 orphans.discard(file)
1228 for lfile in orphans:
1241 for lfile in orphans:
1229 lfdirstate.drop(lfile)
1242 lfdirstate.drop(lfile)
1230 lfdirstate.write()
1243 lfdirstate.write()
1231 finally:
1244 finally:
1232 wlock.release()
1245 wlock.release()
1233 return result
1246 return result
1234
1247
1235 def overridetransplant(orig, ui, repo, *revs, **opts):
1248 def overridetransplant(orig, ui, repo, *revs, **opts):
1236 resuming = opts.get('continue')
1249 resuming = opts.get('continue')
1237 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
1250 repo._lfcommithooks.append(lfutil.automatedcommithook(resuming))
1238 repo._lfstatuswriters.append(lambda *msg, **opts: None)
1251 repo._lfstatuswriters.append(lambda *msg, **opts: None)
1239 try:
1252 try:
1240 result = orig(ui, repo, *revs, **opts)
1253 result = orig(ui, repo, *revs, **opts)
1241 finally:
1254 finally:
1242 repo._lfstatuswriters.pop()
1255 repo._lfstatuswriters.pop()
1243 repo._lfcommithooks.pop()
1256 repo._lfcommithooks.pop()
1244 return result
1257 return result
1245
1258
1246 def overridecat(orig, ui, repo, file1, *pats, **opts):
1259 def overridecat(orig, ui, repo, file1, *pats, **opts):
1247 ctx = scmutil.revsingle(repo, opts.get('rev'))
1260 ctx = scmutil.revsingle(repo, opts.get('rev'))
1248 err = 1
1261 err = 1
1249 notbad = set()
1262 notbad = set()
1250 m = scmutil.match(ctx, (file1,) + pats, opts)
1263 m = scmutil.match(ctx, (file1,) + pats, opts)
1251 origmatchfn = m.matchfn
1264 origmatchfn = m.matchfn
1252 def lfmatchfn(f):
1265 def lfmatchfn(f):
1253 if origmatchfn(f):
1266 if origmatchfn(f):
1254 return True
1267 return True
1255 lf = lfutil.splitstandin(f)
1268 lf = lfutil.splitstandin(f)
1256 if lf is None:
1269 if lf is None:
1257 return False
1270 return False
1258 notbad.add(lf)
1271 notbad.add(lf)
1259 return origmatchfn(lf)
1272 return origmatchfn(lf)
1260 m.matchfn = lfmatchfn
1273 m.matchfn = lfmatchfn
1261 origbadfn = m.bad
1274 origbadfn = m.bad
1262 def lfbadfn(f, msg):
1275 def lfbadfn(f, msg):
1263 if not f in notbad:
1276 if not f in notbad:
1264 origbadfn(f, msg)
1277 origbadfn(f, msg)
1265 m.bad = lfbadfn
1278 m.bad = lfbadfn
1266 for f in ctx.walk(m):
1279 for f in ctx.walk(m):
1267 fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(),
1280 fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(),
1268 pathname=f)
1281 pathname=f)
1269 lf = lfutil.splitstandin(f)
1282 lf = lfutil.splitstandin(f)
1270 if lf is None or origmatchfn(f):
1283 if lf is None or origmatchfn(f):
1271 # duplicating unreachable code from commands.cat
1284 # duplicating unreachable code from commands.cat
1272 data = ctx[f].data()
1285 data = ctx[f].data()
1273 if opts.get('decode'):
1286 if opts.get('decode'):
1274 data = repo.wwritedata(f, data)
1287 data = repo.wwritedata(f, data)
1275 fp.write(data)
1288 fp.write(data)
1276 else:
1289 else:
1277 hash = lfutil.readstandin(repo, lf, ctx.rev())
1290 hash = lfutil.readstandin(repo, lf, ctx.rev())
1278 if not lfutil.inusercache(repo.ui, hash):
1291 if not lfutil.inusercache(repo.ui, hash):
1279 store = basestore._openstore(repo)
1292 store = basestore._openstore(repo)
1280 success, missing = store.get([(lf, hash)])
1293 success, missing = store.get([(lf, hash)])
1281 if len(success) != 1:
1294 if len(success) != 1:
1282 raise util.Abort(
1295 raise util.Abort(
1283 _('largefile %s is not in cache and could not be '
1296 _('largefile %s is not in cache and could not be '
1284 'downloaded') % lf)
1297 'downloaded') % lf)
1285 path = lfutil.usercachepath(repo.ui, hash)
1298 path = lfutil.usercachepath(repo.ui, hash)
1286 fpin = open(path, "rb")
1299 fpin = open(path, "rb")
1287 for chunk in util.filechunkiter(fpin, 128 * 1024):
1300 for chunk in util.filechunkiter(fpin, 128 * 1024):
1288 fp.write(chunk)
1301 fp.write(chunk)
1289 fpin.close()
1302 fpin.close()
1290 fp.close()
1303 fp.close()
1291 err = 0
1304 err = 0
1292 return err
1305 return err
1293
1306
1294 def mergeupdate(orig, repo, node, branchmerge, force, partial,
1307 def mergeupdate(orig, repo, node, branchmerge, force, partial,
1295 *args, **kwargs):
1308 *args, **kwargs):
1296 wlock = repo.wlock()
1309 wlock = repo.wlock()
1297 try:
1310 try:
1298 # branch | | |
1311 # branch | | |
1299 # merge | force | partial | action
1312 # merge | force | partial | action
1300 # -------+-------+---------+--------------
1313 # -------+-------+---------+--------------
1301 # x | x | x | linear-merge
1314 # x | x | x | linear-merge
1302 # o | x | x | branch-merge
1315 # o | x | x | branch-merge
1303 # x | o | x | overwrite (as clean update)
1316 # x | o | x | overwrite (as clean update)
1304 # o | o | x | force-branch-merge (*1)
1317 # o | o | x | force-branch-merge (*1)
1305 # x | x | o | (*)
1318 # x | x | o | (*)
1306 # o | x | o | (*)
1319 # o | x | o | (*)
1307 # x | o | o | overwrite (as revert)
1320 # x | o | o | overwrite (as revert)
1308 # o | o | o | (*)
1321 # o | o | o | (*)
1309 #
1322 #
1310 # (*) don't care
1323 # (*) don't care
1311 # (*1) deprecated, but used internally (e.g: "rebase --collapse")
1324 # (*1) deprecated, but used internally (e.g: "rebase --collapse")
1312
1325
1313 linearmerge = not branchmerge and not force and not partial
1326 linearmerge = not branchmerge and not force and not partial
1314
1327
1315 if linearmerge or (branchmerge and force and not partial):
1328 if linearmerge or (branchmerge and force and not partial):
1316 # update standins for linear-merge or force-branch-merge,
1329 # update standins for linear-merge or force-branch-merge,
1317 # because largefiles in the working directory may be modified
1330 # because largefiles in the working directory may be modified
1318 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1331 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1319 unsure, s = lfdirstate.status(match_.always(repo.root,
1332 unsure, s = lfdirstate.status(match_.always(repo.root,
1320 repo.getcwd()),
1333 repo.getcwd()),
1321 [], False, False, False)
1334 [], False, False, False)
1322 pctx = repo['.']
1335 pctx = repo['.']
1323 for lfile in unsure + s.modified:
1336 for lfile in unsure + s.modified:
1324 lfileabs = repo.wvfs.join(lfile)
1337 lfileabs = repo.wvfs.join(lfile)
1325 if not os.path.exists(lfileabs):
1338 if not os.path.exists(lfileabs):
1326 continue
1339 continue
1327 lfhash = lfutil.hashrepofile(repo, lfile)
1340 lfhash = lfutil.hashrepofile(repo, lfile)
1328 standin = lfutil.standin(lfile)
1341 standin = lfutil.standin(lfile)
1329 lfutil.writestandin(repo, standin, lfhash,
1342 lfutil.writestandin(repo, standin, lfhash,
1330 lfutil.getexecutable(lfileabs))
1343 lfutil.getexecutable(lfileabs))
1331 if (standin in pctx and
1344 if (standin in pctx and
1332 lfhash == lfutil.readstandin(repo, lfile, '.')):
1345 lfhash == lfutil.readstandin(repo, lfile, '.')):
1333 lfdirstate.normal(lfile)
1346 lfdirstate.normal(lfile)
1334 for lfile in s.added:
1347 for lfile in s.added:
1335 lfutil.updatestandin(repo, lfutil.standin(lfile))
1348 lfutil.updatestandin(repo, lfutil.standin(lfile))
1336 lfdirstate.write()
1349 lfdirstate.write()
1337
1350
1338 if linearmerge:
1351 if linearmerge:
1339 # Only call updatelfiles on the standins that have changed
1352 # Only call updatelfiles on the standins that have changed
1340 # to save time
1353 # to save time
1341 oldstandins = lfutil.getstandinsstate(repo)
1354 oldstandins = lfutil.getstandinsstate(repo)
1342
1355
1343 result = orig(repo, node, branchmerge, force, partial, *args, **kwargs)
1356 result = orig(repo, node, branchmerge, force, partial, *args, **kwargs)
1344
1357
1345 filelist = None
1358 filelist = None
1346 if linearmerge:
1359 if linearmerge:
1347 newstandins = lfutil.getstandinsstate(repo)
1360 newstandins = lfutil.getstandinsstate(repo)
1348 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1361 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1349
1362
1350 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1363 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1351 normallookup=partial, checked=linearmerge)
1364 normallookup=partial, checked=linearmerge)
1352
1365
1353 return result
1366 return result
1354 finally:
1367 finally:
1355 wlock.release()
1368 wlock.release()
1356
1369
1357 def scmutilmarktouched(orig, repo, files, *args, **kwargs):
1370 def scmutilmarktouched(orig, repo, files, *args, **kwargs):
1358 result = orig(repo, files, *args, **kwargs)
1371 result = orig(repo, files, *args, **kwargs)
1359
1372
1360 filelist = [lfutil.splitstandin(f) for f in files if lfutil.isstandin(f)]
1373 filelist = [lfutil.splitstandin(f) for f in files if lfutil.isstandin(f)]
1361 if filelist:
1374 if filelist:
1362 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1375 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1363 printmessage=False, normallookup=True)
1376 printmessage=False, normallookup=True)
1364
1377
1365 return result
1378 return result
@@ -1,1021 +1,1053
1 This file contains testcases that tend to be related to special cases or less
1 This file contains testcases that tend to be related to special cases or less
2 common commands affecting largefile.
2 common commands affecting largefile.
3
3
4 Each sections should be independent of each others.
4 Each sections should be independent of each others.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24
24
25
25
26 Test copies and moves from a directory other than root (issue3516)
26 Test copies and moves from a directory other than root (issue3516)
27 =========================================================================
27 =========================================================================
28
28
29 $ hg init lf_cpmv
29 $ hg init lf_cpmv
30 $ cd lf_cpmv
30 $ cd lf_cpmv
31 $ mkdir dira
31 $ mkdir dira
32 $ mkdir dira/dirb
32 $ mkdir dira/dirb
33 $ touch dira/dirb/largefile
33 $ touch dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
35 $ hg commit -m "added"
35 $ hg commit -m "added"
36 Invoking status precommit hook
36 Invoking status precommit hook
37 A dira/dirb/largefile
37 A dira/dirb/largefile
38 $ cd dira
38 $ cd dira
39 $ hg cp dirb/largefile foo/largefile
39 $ hg cp dirb/largefile foo/largefile
40 $ hg ci -m "deep copy"
40 $ hg ci -m "deep copy"
41 Invoking status precommit hook
41 Invoking status precommit hook
42 A dira/foo/largefile
42 A dira/foo/largefile
43 $ find . | sort
43 $ find . | sort
44 .
44 .
45 ./dirb
45 ./dirb
46 ./dirb/largefile
46 ./dirb/largefile
47 ./foo
47 ./foo
48 ./foo/largefile
48 ./foo/largefile
49 $ hg mv foo/largefile baz/largefile
49 $ hg mv foo/largefile baz/largefile
50 $ hg ci -m "moved"
50 $ hg ci -m "moved"
51 Invoking status precommit hook
51 Invoking status precommit hook
52 A dira/baz/largefile
52 A dira/baz/largefile
53 R dira/foo/largefile
53 R dira/foo/largefile
54 $ find . | sort
54 $ find . | sort
55 .
55 .
56 ./baz
56 ./baz
57 ./baz/largefile
57 ./baz/largefile
58 ./dirb
58 ./dirb
59 ./dirb/largefile
59 ./dirb/largefile
60 $ cd ..
60 $ cd ..
61 $ hg mv dira dirc
61 $ hg mv dira dirc
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
64 $ find * | sort
64 $ find * | sort
65 dirc
65 dirc
66 dirc/baz
66 dirc/baz
67 dirc/baz/largefile
67 dirc/baz/largefile
68 dirc/dirb
68 dirc/dirb
69 dirc/dirb/largefile
69 dirc/dirb/largefile
70
70
71 $ hg clone -q . ../fetch
71 $ hg clone -q . ../fetch
72 $ hg --config extensions.fetch= fetch ../fetch
72 $ hg --config extensions.fetch= fetch ../fetch
73 abort: uncommitted changes
73 abort: uncommitted changes
74 [255]
74 [255]
75 $ hg up -qC
75 $ hg up -qC
76 $ cd ..
76 $ cd ..
77
77
78 Clone a local repository owned by another user
78 Clone a local repository owned by another user
79 ===================================================
79 ===================================================
80
80
81 #if unix-permissions
81 #if unix-permissions
82
82
83 We have to simulate that here by setting $HOME and removing write permissions
83 We have to simulate that here by setting $HOME and removing write permissions
84 $ ORIGHOME="$HOME"
84 $ ORIGHOME="$HOME"
85 $ mkdir alice
85 $ mkdir alice
86 $ HOME="`pwd`/alice"
86 $ HOME="`pwd`/alice"
87 $ cd alice
87 $ cd alice
88 $ hg init pubrepo
88 $ hg init pubrepo
89 $ cd pubrepo
89 $ cd pubrepo
90 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
90 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
91 $ hg add --large a-large-file
91 $ hg add --large a-large-file
92 $ hg commit -m "Add a large file"
92 $ hg commit -m "Add a large file"
93 Invoking status precommit hook
93 Invoking status precommit hook
94 A a-large-file
94 A a-large-file
95 $ cd ..
95 $ cd ..
96 $ chmod -R a-w pubrepo
96 $ chmod -R a-w pubrepo
97 $ cd ..
97 $ cd ..
98 $ mkdir bob
98 $ mkdir bob
99 $ HOME="`pwd`/bob"
99 $ HOME="`pwd`/bob"
100 $ cd bob
100 $ cd bob
101 $ hg clone --pull ../alice/pubrepo pubrepo
101 $ hg clone --pull ../alice/pubrepo pubrepo
102 requesting all changes
102 requesting all changes
103 adding changesets
103 adding changesets
104 adding manifests
104 adding manifests
105 adding file changes
105 adding file changes
106 added 1 changesets with 1 changes to 1 files
106 added 1 changesets with 1 changes to 1 files
107 updating to branch default
107 updating to branch default
108 getting changed largefiles
108 getting changed largefiles
109 1 largefiles updated, 0 removed
109 1 largefiles updated, 0 removed
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 $ cd ..
111 $ cd ..
112 $ chmod -R u+w alice/pubrepo
112 $ chmod -R u+w alice/pubrepo
113 $ HOME="$ORIGHOME"
113 $ HOME="$ORIGHOME"
114
114
115 #endif
115 #endif
116
116
117
117
118 Symlink to a large largefile should behave the same as a symlink to a normal file
118 Symlink to a large largefile should behave the same as a symlink to a normal file
119 =====================================================================================
119 =====================================================================================
120
120
121 #if symlink
121 #if symlink
122
122
123 $ hg init largesymlink
123 $ hg init largesymlink
124 $ cd largesymlink
124 $ cd largesymlink
125 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
125 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
126 $ hg add --large largefile
126 $ hg add --large largefile
127 $ hg commit -m "commit a large file"
127 $ hg commit -m "commit a large file"
128 Invoking status precommit hook
128 Invoking status precommit hook
129 A largefile
129 A largefile
130 $ ln -s largefile largelink
130 $ ln -s largefile largelink
131 $ hg add largelink
131 $ hg add largelink
132 $ hg commit -m "commit a large symlink"
132 $ hg commit -m "commit a large symlink"
133 Invoking status precommit hook
133 Invoking status precommit hook
134 A largelink
134 A largelink
135 $ rm -f largelink
135 $ rm -f largelink
136 $ hg up >/dev/null
136 $ hg up >/dev/null
137 $ test -f largelink
137 $ test -f largelink
138 [1]
138 [1]
139 $ test -L largelink
139 $ test -L largelink
140 [1]
140 [1]
141 $ rm -f largelink # make next part of the test independent of the previous
141 $ rm -f largelink # make next part of the test independent of the previous
142 $ hg up -C >/dev/null
142 $ hg up -C >/dev/null
143 $ test -f largelink
143 $ test -f largelink
144 $ test -L largelink
144 $ test -L largelink
145 $ cd ..
145 $ cd ..
146
146
147 #endif
147 #endif
148
148
149
149
150 test for pattern matching on 'hg status':
150 test for pattern matching on 'hg status':
151 ==============================================
151 ==============================================
152
152
153
153
154 to boost performance, largefiles checks whether specified patterns are
154 to boost performance, largefiles checks whether specified patterns are
155 related to largefiles in working directory (NOT to STANDIN) or not.
155 related to largefiles in working directory (NOT to STANDIN) or not.
156
156
157 $ hg init statusmatch
157 $ hg init statusmatch
158 $ cd statusmatch
158 $ cd statusmatch
159
159
160 $ mkdir -p a/b/c/d
160 $ mkdir -p a/b/c/d
161 $ echo normal > a/b/c/d/e.normal.txt
161 $ echo normal > a/b/c/d/e.normal.txt
162 $ hg add a/b/c/d/e.normal.txt
162 $ hg add a/b/c/d/e.normal.txt
163 $ echo large > a/b/c/d/e.large.txt
163 $ echo large > a/b/c/d/e.large.txt
164 $ hg add --large a/b/c/d/e.large.txt
164 $ hg add --large a/b/c/d/e.large.txt
165 $ mkdir -p a/b/c/x
165 $ mkdir -p a/b/c/x
166 $ echo normal > a/b/c/x/y.normal.txt
166 $ echo normal > a/b/c/x/y.normal.txt
167 $ hg add a/b/c/x/y.normal.txt
167 $ hg add a/b/c/x/y.normal.txt
168 $ hg commit -m 'add files'
168 $ hg commit -m 'add files'
169 Invoking status precommit hook
169 Invoking status precommit hook
170 A a/b/c/d/e.large.txt
170 A a/b/c/d/e.large.txt
171 A a/b/c/d/e.normal.txt
171 A a/b/c/d/e.normal.txt
172 A a/b/c/x/y.normal.txt
172 A a/b/c/x/y.normal.txt
173
173
174 (1) no pattern: no performance boost
174 (1) no pattern: no performance boost
175 $ hg status -A
175 $ hg status -A
176 C a/b/c/d/e.large.txt
176 C a/b/c/d/e.large.txt
177 C a/b/c/d/e.normal.txt
177 C a/b/c/d/e.normal.txt
178 C a/b/c/x/y.normal.txt
178 C a/b/c/x/y.normal.txt
179
179
180 (2) pattern not related to largefiles: performance boost
180 (2) pattern not related to largefiles: performance boost
181 $ hg status -A a/b/c/x
181 $ hg status -A a/b/c/x
182 C a/b/c/x/y.normal.txt
182 C a/b/c/x/y.normal.txt
183
183
184 (3) pattern related to largefiles: no performance boost
184 (3) pattern related to largefiles: no performance boost
185 $ hg status -A a/b/c/d
185 $ hg status -A a/b/c/d
186 C a/b/c/d/e.large.txt
186 C a/b/c/d/e.large.txt
187 C a/b/c/d/e.normal.txt
187 C a/b/c/d/e.normal.txt
188
188
189 (4) pattern related to STANDIN (not to largefiles): performance boost
189 (4) pattern related to STANDIN (not to largefiles): performance boost
190 $ hg status -A .hglf/a
190 $ hg status -A .hglf/a
191 C .hglf/a/b/c/d/e.large.txt
191 C .hglf/a/b/c/d/e.large.txt
192
192
193 (5) mixed case: no performance boost
193 (5) mixed case: no performance boost
194 $ hg status -A a/b/c/x a/b/c/d
194 $ hg status -A a/b/c/x a/b/c/d
195 C a/b/c/d/e.large.txt
195 C a/b/c/d/e.large.txt
196 C a/b/c/d/e.normal.txt
196 C a/b/c/d/e.normal.txt
197 C a/b/c/x/y.normal.txt
197 C a/b/c/x/y.normal.txt
198
198
199 verify that largefiles doesn't break filesets
199 verify that largefiles doesn't break filesets
200
200
201 $ hg log --rev . --exclude "set:binary()"
201 $ hg log --rev . --exclude "set:binary()"
202 changeset: 0:41bd42f10efa
202 changeset: 0:41bd42f10efa
203 tag: tip
203 tag: tip
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: add files
206 summary: add files
207
207
208 verify that large files in subrepos handled properly
208 verify that large files in subrepos handled properly
209 $ hg init subrepo
209 $ hg init subrepo
210 $ echo "subrepo = subrepo" > .hgsub
210 $ echo "subrepo = subrepo" > .hgsub
211 $ hg add .hgsub
211 $ hg add .hgsub
212 $ hg ci -m "add subrepo"
212 $ hg ci -m "add subrepo"
213 Invoking status precommit hook
213 Invoking status precommit hook
214 A .hgsub
214 A .hgsub
215 ? .hgsubstate
215 ? .hgsubstate
216 $ echo "rev 1" > subrepo/large.txt
216 $ echo "rev 1" > subrepo/large.txt
217 $ hg add --large subrepo/large.txt
217 $ hg add --large subrepo/large.txt
218 $ hg sum
218 $ hg sum
219 parent: 1:8ee150ea2e9c tip
219 parent: 1:8ee150ea2e9c tip
220 add subrepo
220 add subrepo
221 branch: default
221 branch: default
222 commit: 1 subrepos
222 commit: 1 subrepos
223 update: (current)
223 update: (current)
224 $ hg st
224 $ hg st
225 $ hg st -S
225 $ hg st -S
226 A subrepo/large.txt
226 A subrepo/large.txt
227 $ hg ci -S -m "commit top repo"
227 $ hg ci -S -m "commit top repo"
228 committing subrepository subrepo
228 committing subrepository subrepo
229 Invoking status precommit hook
229 Invoking status precommit hook
230 A large.txt
230 A large.txt
231 Invoking status precommit hook
231 Invoking status precommit hook
232 M .hgsubstate
232 M .hgsubstate
233 # No differences
233 # No differences
234 $ hg st -S
234 $ hg st -S
235 $ hg sum
235 $ hg sum
236 parent: 2:ce4cd0c527a6 tip
236 parent: 2:ce4cd0c527a6 tip
237 commit top repo
237 commit top repo
238 branch: default
238 branch: default
239 commit: (clean)
239 commit: (clean)
240 update: (current)
240 update: (current)
241 $ echo "rev 2" > subrepo/large.txt
241 $ echo "rev 2" > subrepo/large.txt
242 $ hg st -S
242 $ hg st -S
243 M subrepo/large.txt
243 M subrepo/large.txt
244 $ hg sum
244 $ hg sum
245 parent: 2:ce4cd0c527a6 tip
245 parent: 2:ce4cd0c527a6 tip
246 commit top repo
246 commit top repo
247 branch: default
247 branch: default
248 commit: 1 subrepos
248 commit: 1 subrepos
249 update: (current)
249 update: (current)
250 $ hg ci -m "this commit should fail without -S"
250 $ hg ci -m "this commit should fail without -S"
251 abort: uncommitted changes in subrepo subrepo
251 abort: uncommitted changes in subrepo subrepo
252 (use --subrepos for recursive commit)
252 (use --subrepos for recursive commit)
253 [255]
253 [255]
254
254
255 Add a normal file to the subrepo, then test archiving
255 Add a normal file to the subrepo, then test archiving
256
256
257 $ echo 'normal file' > subrepo/normal.txt
257 $ echo 'normal file' > subrepo/normal.txt
258 $ touch large.dat
258 $ touch large.dat
259 $ mv subrepo/large.txt subrepo/renamed-large.txt
259 $ mv subrepo/large.txt subrepo/renamed-large.txt
260 $ hg addremove -S --dry-run
260 $ hg addremove -S --dry-run
261 adding large.dat as a largefile
261 adding large.dat as a largefile
262 removing subrepo/large.txt
262 removing subrepo/large.txt
263 adding subrepo/normal.txt
263 adding subrepo/normal.txt
264 adding subrepo/renamed-large.txt
264 adding subrepo/renamed-large.txt
265 $ hg status -S
265 $ hg status -S
266 ! subrepo/large.txt
266 ! subrepo/large.txt
267 ? large.dat
267 ? large.dat
268 ? subrepo/normal.txt
268 ? subrepo/normal.txt
269 ? subrepo/renamed-large.txt
269 ? subrepo/renamed-large.txt
270
270
271 $ hg addremove --dry-run subrepo
271 $ hg addremove --dry-run subrepo
272 removing subrepo/large.txt (glob)
272 removing subrepo/large.txt (glob)
273 adding subrepo/normal.txt (glob)
273 adding subrepo/normal.txt (glob)
274 adding subrepo/renamed-large.txt (glob)
274 adding subrepo/renamed-large.txt (glob)
275 $ hg status -S
275 $ hg status -S
276 ! subrepo/large.txt
276 ! subrepo/large.txt
277 ? large.dat
277 ? large.dat
278 ? subrepo/normal.txt
278 ? subrepo/normal.txt
279 ? subrepo/renamed-large.txt
279 ? subrepo/renamed-large.txt
280 $ cd ..
280 $ cd ..
281
281
282 $ hg -R statusmatch addremove --dry-run statusmatch/subrepo
282 $ hg -R statusmatch addremove --dry-run statusmatch/subrepo
283 removing statusmatch/subrepo/large.txt (glob)
283 removing statusmatch/subrepo/large.txt (glob)
284 adding statusmatch/subrepo/normal.txt (glob)
284 adding statusmatch/subrepo/normal.txt (glob)
285 adding statusmatch/subrepo/renamed-large.txt (glob)
285 adding statusmatch/subrepo/renamed-large.txt (glob)
286 $ hg -R statusmatch status -S
286 $ hg -R statusmatch status -S
287 ! subrepo/large.txt
287 ! subrepo/large.txt
288 ? large.dat
288 ? large.dat
289 ? subrepo/normal.txt
289 ? subrepo/normal.txt
290 ? subrepo/renamed-large.txt
290 ? subrepo/renamed-large.txt
291
291
292 $ hg -R statusmatch addremove --dry-run -S
292 $ hg -R statusmatch addremove --dry-run -S
293 adding large.dat as a largefile
293 adding large.dat as a largefile
294 removing subrepo/large.txt
294 removing subrepo/large.txt
295 adding subrepo/normal.txt
295 adding subrepo/normal.txt
296 adding subrepo/renamed-large.txt
296 adding subrepo/renamed-large.txt
297 $ cd statusmatch
297 $ cd statusmatch
298
298
299 $ mv subrepo/renamed-large.txt subrepo/large.txt
299 $ mv subrepo/renamed-large.txt subrepo/large.txt
300 $ hg addremove subrepo
300 $ hg addremove subrepo
301 adding subrepo/normal.txt (glob)
301 adding subrepo/normal.txt (glob)
302 $ hg forget subrepo/normal.txt
302 $ hg forget subrepo/normal.txt
303
303
304 $ hg addremove -S
304 $ hg addremove -S
305 adding large.dat as a largefile
305 adding large.dat as a largefile
306 adding subrepo/normal.txt
306 adding subrepo/normal.txt
307 $ rm large.dat
307 $ rm large.dat
308
308
309 $ hg addremove subrepo
309 $ hg addremove subrepo
310 $ hg addremove -S
310 $ hg addremove -S
311 removing large.dat
311 removing large.dat
312
312
313 Lock in subrepo, otherwise the change isn't archived
313 Lock in subrepo, otherwise the change isn't archived
314
314
315 $ hg ci -S -m "add normal file to top level"
315 $ hg ci -S -m "add normal file to top level"
316 committing subrepository subrepo
316 committing subrepository subrepo
317 Invoking status precommit hook
317 Invoking status precommit hook
318 M large.txt
318 M large.txt
319 A normal.txt
319 A normal.txt
320 Invoking status precommit hook
320 Invoking status precommit hook
321 M .hgsubstate
321 M .hgsubstate
322 $ hg archive -S ../lf_subrepo_archive
322 $ hg archive -S ../lf_subrepo_archive
323 $ find ../lf_subrepo_archive | sort
323 $ find ../lf_subrepo_archive | sort
324 ../lf_subrepo_archive
324 ../lf_subrepo_archive
325 ../lf_subrepo_archive/.hg_archival.txt
325 ../lf_subrepo_archive/.hg_archival.txt
326 ../lf_subrepo_archive/.hgsub
326 ../lf_subrepo_archive/.hgsub
327 ../lf_subrepo_archive/.hgsubstate
327 ../lf_subrepo_archive/.hgsubstate
328 ../lf_subrepo_archive/a
328 ../lf_subrepo_archive/a
329 ../lf_subrepo_archive/a/b
329 ../lf_subrepo_archive/a/b
330 ../lf_subrepo_archive/a/b/c
330 ../lf_subrepo_archive/a/b/c
331 ../lf_subrepo_archive/a/b/c/d
331 ../lf_subrepo_archive/a/b/c/d
332 ../lf_subrepo_archive/a/b/c/d/e.large.txt
332 ../lf_subrepo_archive/a/b/c/d/e.large.txt
333 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
333 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
334 ../lf_subrepo_archive/a/b/c/x
334 ../lf_subrepo_archive/a/b/c/x
335 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
335 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
336 ../lf_subrepo_archive/subrepo
336 ../lf_subrepo_archive/subrepo
337 ../lf_subrepo_archive/subrepo/large.txt
337 ../lf_subrepo_archive/subrepo/large.txt
338 ../lf_subrepo_archive/subrepo/normal.txt
338 ../lf_subrepo_archive/subrepo/normal.txt
339
339
340 Test update with subrepos.
340 Test update with subrepos.
341
341
342 $ hg update 0
342 $ hg update 0
343 getting changed largefiles
343 getting changed largefiles
344 0 largefiles updated, 1 removed
344 0 largefiles updated, 1 removed
345 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
345 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
346 $ hg status -S
346 $ hg status -S
347 $ hg update tip
347 $ hg update tip
348 getting changed largefiles
348 getting changed largefiles
349 1 largefiles updated, 0 removed
349 1 largefiles updated, 0 removed
350 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
350 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 $ hg status -S
351 $ hg status -S
352 # modify a large file
352 # modify a large file
353 $ echo "modified" > subrepo/large.txt
353 $ echo "modified" > subrepo/large.txt
354 $ hg st -S
354 $ hg st -S
355 M subrepo/large.txt
355 M subrepo/large.txt
356 # update -C should revert the change.
356 # update -C should revert the change.
357 $ hg update -C
357 $ hg update -C
358 getting changed largefiles
358 getting changed largefiles
359 1 largefiles updated, 0 removed
359 1 largefiles updated, 0 removed
360 getting changed largefiles
360 getting changed largefiles
361 0 largefiles updated, 0 removed
361 0 largefiles updated, 0 removed
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
362 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 $ hg status -S
363 $ hg status -S
364
364
365 $ hg forget -v subrepo/large.txt
365 $ hg forget -v subrepo/large.txt
366 removing subrepo/large.txt (glob)
366 removing subrepo/large.txt (glob)
367
367
368 Test reverting a forgotten file
368 Test reverting a forgotten file
369 $ hg revert -R subrepo subrepo/large.txt
369 $ hg revert -R subrepo subrepo/large.txt
370 $ hg status -SA subrepo/large.txt
370 $ hg status -SA subrepo/large.txt
371 C subrepo/large.txt
371 C subrepo/large.txt
372
372
373 $ hg rm -v subrepo/large.txt
373 $ hg rm -v subrepo/large.txt
374 removing subrepo/large.txt (glob)
374 removing subrepo/large.txt (glob)
375 $ hg revert -R subrepo subrepo/large.txt
375 $ hg revert -R subrepo subrepo/large.txt
376 $ rm subrepo/large.txt
376 $ rm subrepo/large.txt
377 $ hg addremove -S
377 $ hg addremove -S
378 removing subrepo/large.txt
378 removing subrepo/large.txt
379 $ hg st -S
379 $ hg st -S
380 R subrepo/large.txt
380 R subrepo/large.txt
381
381
382 Test archiving a revision that references a subrepo that is not yet
382 Test archiving a revision that references a subrepo that is not yet
383 cloned (see test-subrepo-recursion.t):
383 cloned (see test-subrepo-recursion.t):
384
384
385 $ hg clone -U . ../empty
385 $ hg clone -U . ../empty
386 $ cd ../empty
386 $ cd ../empty
387 $ hg archive --subrepos -r tip ../archive.tar.gz
387 $ hg archive --subrepos -r tip ../archive.tar.gz
388 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
388 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
389 $ cd ..
389 $ cd ..
390
390
391
391
392
392
393
393
394
394
395
395
396 Test addremove, forget and others
396 Test addremove, forget and others
397 ==============================================
397 ==============================================
398
398
399 Test that addremove picks up largefiles prior to the initial commit (issue3541)
399 Test that addremove picks up largefiles prior to the initial commit (issue3541)
400
400
401 $ hg init addrm2
401 $ hg init addrm2
402 $ cd addrm2
402 $ cd addrm2
403 $ touch large.dat
403 $ touch large.dat
404 $ touch large2.dat
404 $ touch large2.dat
405 $ touch normal
405 $ touch normal
406 $ hg add --large large.dat
406 $ hg add --large large.dat
407 $ hg addremove -v
407 $ hg addremove -v
408 adding large2.dat as a largefile
408 adding large2.dat as a largefile
409 adding normal
409 adding normal
410
410
411 Test that forgetting all largefiles reverts to islfilesrepo() == False
411 Test that forgetting all largefiles reverts to islfilesrepo() == False
412 (addremove will add *.dat as normal files now)
412 (addremove will add *.dat as normal files now)
413 $ hg forget large.dat
413 $ hg forget large.dat
414 $ hg forget large2.dat
414 $ hg forget large2.dat
415 $ hg addremove -v
415 $ hg addremove -v
416 adding large.dat
416 adding large.dat
417 adding large2.dat
417 adding large2.dat
418
418
419 Test commit's addremove option prior to the first commit
419 Test commit's addremove option prior to the first commit
420 $ hg forget large.dat
420 $ hg forget large.dat
421 $ hg forget large2.dat
421 $ hg forget large2.dat
422 $ hg add --large large.dat
422 $ hg add --large large.dat
423 $ hg ci -Am "commit"
423 $ hg ci -Am "commit"
424 adding large2.dat as a largefile
424 adding large2.dat as a largefile
425 Invoking status precommit hook
425 Invoking status precommit hook
426 A large.dat
426 A large.dat
427 A large2.dat
427 A large2.dat
428 A normal
428 A normal
429 $ find .hglf | sort
429 $ find .hglf | sort
430 .hglf
430 .hglf
431 .hglf/large.dat
431 .hglf/large.dat
432 .hglf/large2.dat
432 .hglf/large2.dat
433
433
434 Test actions on largefiles using relative paths from subdir
434 Test actions on largefiles using relative paths from subdir
435
435
436 $ mkdir sub
436 $ mkdir sub
437 $ cd sub
437 $ cd sub
438 $ echo anotherlarge > anotherlarge
438 $ echo anotherlarge > anotherlarge
439 $ hg add --large anotherlarge
439 $ hg add --large anotherlarge
440 $ hg st
440 $ hg st
441 A sub/anotherlarge
441 A sub/anotherlarge
442 $ hg st anotherlarge
442 $ hg st anotherlarge
443 A anotherlarge
443 A anotherlarge
444 $ hg commit -m anotherlarge anotherlarge
444 $ hg commit -m anotherlarge anotherlarge
445 Invoking status precommit hook
445 Invoking status precommit hook
446 A sub/anotherlarge
446 A sub/anotherlarge
447 $ hg log anotherlarge
447 $ hg log anotherlarge
448 changeset: 1:9627a577c5e9
448 changeset: 1:9627a577c5e9
449 tag: tip
449 tag: tip
450 user: test
450 user: test
451 date: Thu Jan 01 00:00:00 1970 +0000
451 date: Thu Jan 01 00:00:00 1970 +0000
452 summary: anotherlarge
452 summary: anotherlarge
453
453
454 $ hg log -G anotherlarge
454 $ hg log -G anotherlarge
455 @ changeset: 1:9627a577c5e9
455 @ changeset: 1:9627a577c5e9
456 | tag: tip
456 | tag: tip
457 | user: test
457 | user: test
458 | date: Thu Jan 01 00:00:00 1970 +0000
458 | date: Thu Jan 01 00:00:00 1970 +0000
459 | summary: anotherlarge
459 | summary: anotherlarge
460 |
460 |
461
462 $ hg log glob:another*
463 changeset: 1:9627a577c5e9
464 tag: tip
465 user: test
466 date: Thu Jan 01 00:00:00 1970 +0000
467 summary: anotherlarge
468
469 $ hg log -G glob:another*
470 @ changeset: 1:9627a577c5e9
471 | tag: tip
472 | user: test
473 | date: Thu Jan 01 00:00:00 1970 +0000
474 | summary: anotherlarge
475 |
476
461 $ echo more >> anotherlarge
477 $ echo more >> anotherlarge
462 $ hg st .
478 $ hg st .
463 M anotherlarge
479 M anotherlarge
464 $ hg cat anotherlarge
480 $ hg cat anotherlarge
465 anotherlarge
481 anotherlarge
466 $ hg revert anotherlarge
482 $ hg revert anotherlarge
467 $ hg st
483 $ hg st
468 ? sub/anotherlarge.orig
484 ? sub/anotherlarge.orig
469 $ cd ..
485 $ cd ..
470
486
487 Test glob logging from the root dir
488 $ hg log glob:**another*
489 changeset: 1:9627a577c5e9
490 tag: tip
491 user: test
492 date: Thu Jan 01 00:00:00 1970 +0000
493 summary: anotherlarge
494
495 $ hg log -G glob:**another*
496 @ changeset: 1:9627a577c5e9
497 | tag: tip
498 | user: test
499 | date: Thu Jan 01 00:00:00 1970 +0000
500 | summary: anotherlarge
501 |
502
471 $ cd ..
503 $ cd ..
472
504
473 Check error message while exchange
505 Check error message while exchange
474 =========================================================
506 =========================================================
475
507
476 issue3651: summary/outgoing with largefiles shows "no remote repo"
508 issue3651: summary/outgoing with largefiles shows "no remote repo"
477 unexpectedly
509 unexpectedly
478
510
479 $ mkdir issue3651
511 $ mkdir issue3651
480 $ cd issue3651
512 $ cd issue3651
481
513
482 $ hg init src
514 $ hg init src
483 $ echo a > src/a
515 $ echo a > src/a
484 $ hg -R src add --large src/a
516 $ hg -R src add --large src/a
485 $ hg -R src commit -m '#0'
517 $ hg -R src commit -m '#0'
486 Invoking status precommit hook
518 Invoking status precommit hook
487 A a
519 A a
488
520
489 check messages when no remote repository is specified:
521 check messages when no remote repository is specified:
490 "no remote repo" route for "hg outgoing --large" is not tested here,
522 "no remote repo" route for "hg outgoing --large" is not tested here,
491 because it can't be reproduced easily.
523 because it can't be reproduced easily.
492
524
493 $ hg init clone1
525 $ hg init clone1
494 $ hg -R clone1 -q pull src
526 $ hg -R clone1 -q pull src
495 $ hg -R clone1 -q update
527 $ hg -R clone1 -q update
496 $ hg -R clone1 paths | grep default
528 $ hg -R clone1 paths | grep default
497 [1]
529 [1]
498
530
499 $ hg -R clone1 summary --large
531 $ hg -R clone1 summary --large
500 parent: 0:fc0bd45326d3 tip
532 parent: 0:fc0bd45326d3 tip
501 #0
533 #0
502 branch: default
534 branch: default
503 commit: (clean)
535 commit: (clean)
504 update: (current)
536 update: (current)
505 largefiles: (no remote repo)
537 largefiles: (no remote repo)
506
538
507 check messages when there is no files to upload:
539 check messages when there is no files to upload:
508
540
509 $ hg -q clone src clone2
541 $ hg -q clone src clone2
510 $ hg -R clone2 paths | grep default
542 $ hg -R clone2 paths | grep default
511 default = $TESTTMP/issue3651/src (glob)
543 default = $TESTTMP/issue3651/src (glob)
512
544
513 $ hg -R clone2 summary --large
545 $ hg -R clone2 summary --large
514 parent: 0:fc0bd45326d3 tip
546 parent: 0:fc0bd45326d3 tip
515 #0
547 #0
516 branch: default
548 branch: default
517 commit: (clean)
549 commit: (clean)
518 update: (current)
550 update: (current)
519 largefiles: (no files to upload)
551 largefiles: (no files to upload)
520 $ hg -R clone2 outgoing --large
552 $ hg -R clone2 outgoing --large
521 comparing with $TESTTMP/issue3651/src (glob)
553 comparing with $TESTTMP/issue3651/src (glob)
522 searching for changes
554 searching for changes
523 no changes found
555 no changes found
524 largefiles: no files to upload
556 largefiles: no files to upload
525 [1]
557 [1]
526
558
527 $ hg -R clone2 outgoing --large --graph --template "{rev}"
559 $ hg -R clone2 outgoing --large --graph --template "{rev}"
528 comparing with $TESTTMP/issue3651/src (glob)
560 comparing with $TESTTMP/issue3651/src (glob)
529 searching for changes
561 searching for changes
530 no changes found
562 no changes found
531 largefiles: no files to upload
563 largefiles: no files to upload
532
564
533 check messages when there are files to upload:
565 check messages when there are files to upload:
534
566
535 $ echo b > clone2/b
567 $ echo b > clone2/b
536 $ hg -R clone2 add --large clone2/b
568 $ hg -R clone2 add --large clone2/b
537 $ hg -R clone2 commit -m '#1'
569 $ hg -R clone2 commit -m '#1'
538 Invoking status precommit hook
570 Invoking status precommit hook
539 A b
571 A b
540 $ hg -R clone2 summary --large
572 $ hg -R clone2 summary --large
541 parent: 1:1acbe71ce432 tip
573 parent: 1:1acbe71ce432 tip
542 #1
574 #1
543 branch: default
575 branch: default
544 commit: (clean)
576 commit: (clean)
545 update: (current)
577 update: (current)
546 largefiles: 1 entities for 1 files to upload
578 largefiles: 1 entities for 1 files to upload
547 $ hg -R clone2 outgoing --large
579 $ hg -R clone2 outgoing --large
548 comparing with $TESTTMP/issue3651/src (glob)
580 comparing with $TESTTMP/issue3651/src (glob)
549 searching for changes
581 searching for changes
550 changeset: 1:1acbe71ce432
582 changeset: 1:1acbe71ce432
551 tag: tip
583 tag: tip
552 user: test
584 user: test
553 date: Thu Jan 01 00:00:00 1970 +0000
585 date: Thu Jan 01 00:00:00 1970 +0000
554 summary: #1
586 summary: #1
555
587
556 largefiles to upload (1 entities):
588 largefiles to upload (1 entities):
557 b
589 b
558
590
559 $ hg -R clone2 outgoing --large --graph --template "{rev}"
591 $ hg -R clone2 outgoing --large --graph --template "{rev}"
560 comparing with $TESTTMP/issue3651/src (glob)
592 comparing with $TESTTMP/issue3651/src (glob)
561 searching for changes
593 searching for changes
562 @ 1
594 @ 1
563
595
564 largefiles to upload (1 entities):
596 largefiles to upload (1 entities):
565 b
597 b
566
598
567
599
568 $ cp clone2/b clone2/b1
600 $ cp clone2/b clone2/b1
569 $ cp clone2/b clone2/b2
601 $ cp clone2/b clone2/b2
570 $ hg -R clone2 add --large clone2/b1 clone2/b2
602 $ hg -R clone2 add --large clone2/b1 clone2/b2
571 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
603 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
572 Invoking status precommit hook
604 Invoking status precommit hook
573 A b1
605 A b1
574 A b2
606 A b2
575 $ hg -R clone2 summary --large
607 $ hg -R clone2 summary --large
576 parent: 2:6095d0695d70 tip
608 parent: 2:6095d0695d70 tip
577 #2: add largefiles referring same entity
609 #2: add largefiles referring same entity
578 branch: default
610 branch: default
579 commit: (clean)
611 commit: (clean)
580 update: (current)
612 update: (current)
581 largefiles: 1 entities for 3 files to upload
613 largefiles: 1 entities for 3 files to upload
582 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
614 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
583 comparing with $TESTTMP/issue3651/src (glob)
615 comparing with $TESTTMP/issue3651/src (glob)
584 searching for changes
616 searching for changes
585 1:1acbe71ce432
617 1:1acbe71ce432
586 2:6095d0695d70
618 2:6095d0695d70
587 largefiles to upload (1 entities):
619 largefiles to upload (1 entities):
588 b
620 b
589 b1
621 b1
590 b2
622 b2
591
623
592 $ hg -R clone2 cat -r 1 clone2/.hglf/b
624 $ hg -R clone2 cat -r 1 clone2/.hglf/b
593 89e6c98d92887913cadf06b2adb97f26cde4849b
625 89e6c98d92887913cadf06b2adb97f26cde4849b
594 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
626 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
595 comparing with $TESTTMP/issue3651/src (glob)
627 comparing with $TESTTMP/issue3651/src (glob)
596 query 1; heads
628 query 1; heads
597 searching for changes
629 searching for changes
598 all remote heads known locally
630 all remote heads known locally
599 1:1acbe71ce432
631 1:1acbe71ce432
600 2:6095d0695d70
632 2:6095d0695d70
601 finding outgoing largefiles: 0/2 revision (0.00%)
633 finding outgoing largefiles: 0/2 revision (0.00%)
602 finding outgoing largefiles: 1/2 revision (50.00%)
634 finding outgoing largefiles: 1/2 revision (50.00%)
603 largefiles to upload (1 entities):
635 largefiles to upload (1 entities):
604 b
636 b
605 89e6c98d92887913cadf06b2adb97f26cde4849b
637 89e6c98d92887913cadf06b2adb97f26cde4849b
606 b1
638 b1
607 89e6c98d92887913cadf06b2adb97f26cde4849b
639 89e6c98d92887913cadf06b2adb97f26cde4849b
608 b2
640 b2
609 89e6c98d92887913cadf06b2adb97f26cde4849b
641 89e6c98d92887913cadf06b2adb97f26cde4849b
610
642
611
643
612 $ echo bbb > clone2/b
644 $ echo bbb > clone2/b
613 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
645 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
614 Invoking status precommit hook
646 Invoking status precommit hook
615 M b
647 M b
616 $ echo bbbb > clone2/b
648 $ echo bbbb > clone2/b
617 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
649 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
618 Invoking status precommit hook
650 Invoking status precommit hook
619 M b
651 M b
620 $ cp clone2/b1 clone2/b
652 $ cp clone2/b1 clone2/b
621 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
653 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
622 Invoking status precommit hook
654 Invoking status precommit hook
623 M b
655 M b
624 $ hg -R clone2 summary --large
656 $ hg -R clone2 summary --large
625 parent: 5:036794ea641c tip
657 parent: 5:036794ea641c tip
626 #5: refer existing largefile entity again
658 #5: refer existing largefile entity again
627 branch: default
659 branch: default
628 commit: (clean)
660 commit: (clean)
629 update: (current)
661 update: (current)
630 largefiles: 3 entities for 3 files to upload
662 largefiles: 3 entities for 3 files to upload
631 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
663 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
632 comparing with $TESTTMP/issue3651/src (glob)
664 comparing with $TESTTMP/issue3651/src (glob)
633 searching for changes
665 searching for changes
634 1:1acbe71ce432
666 1:1acbe71ce432
635 2:6095d0695d70
667 2:6095d0695d70
636 3:7983dce246cc
668 3:7983dce246cc
637 4:233f12ada4ae
669 4:233f12ada4ae
638 5:036794ea641c
670 5:036794ea641c
639 largefiles to upload (3 entities):
671 largefiles to upload (3 entities):
640 b
672 b
641 b1
673 b1
642 b2
674 b2
643
675
644 $ hg -R clone2 cat -r 3 clone2/.hglf/b
676 $ hg -R clone2 cat -r 3 clone2/.hglf/b
645 c801c9cfe94400963fcb683246217d5db77f9a9a
677 c801c9cfe94400963fcb683246217d5db77f9a9a
646 $ hg -R clone2 cat -r 4 clone2/.hglf/b
678 $ hg -R clone2 cat -r 4 clone2/.hglf/b
647 13f9ed0898e315bf59dc2973fec52037b6f441a2
679 13f9ed0898e315bf59dc2973fec52037b6f441a2
648 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
680 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
649 comparing with $TESTTMP/issue3651/src (glob)
681 comparing with $TESTTMP/issue3651/src (glob)
650 query 1; heads
682 query 1; heads
651 searching for changes
683 searching for changes
652 all remote heads known locally
684 all remote heads known locally
653 1:1acbe71ce432
685 1:1acbe71ce432
654 2:6095d0695d70
686 2:6095d0695d70
655 3:7983dce246cc
687 3:7983dce246cc
656 4:233f12ada4ae
688 4:233f12ada4ae
657 5:036794ea641c
689 5:036794ea641c
658 finding outgoing largefiles: 0/5 revision (0.00%)
690 finding outgoing largefiles: 0/5 revision (0.00%)
659 finding outgoing largefiles: 1/5 revision (20.00%)
691 finding outgoing largefiles: 1/5 revision (20.00%)
660 finding outgoing largefiles: 2/5 revision (40.00%)
692 finding outgoing largefiles: 2/5 revision (40.00%)
661 finding outgoing largefiles: 3/5 revision (60.00%)
693 finding outgoing largefiles: 3/5 revision (60.00%)
662 finding outgoing largefiles: 4/5 revision (80.00%)
694 finding outgoing largefiles: 4/5 revision (80.00%)
663 largefiles to upload (3 entities):
695 largefiles to upload (3 entities):
664 b
696 b
665 13f9ed0898e315bf59dc2973fec52037b6f441a2
697 13f9ed0898e315bf59dc2973fec52037b6f441a2
666 89e6c98d92887913cadf06b2adb97f26cde4849b
698 89e6c98d92887913cadf06b2adb97f26cde4849b
667 c801c9cfe94400963fcb683246217d5db77f9a9a
699 c801c9cfe94400963fcb683246217d5db77f9a9a
668 b1
700 b1
669 89e6c98d92887913cadf06b2adb97f26cde4849b
701 89e6c98d92887913cadf06b2adb97f26cde4849b
670 b2
702 b2
671 89e6c98d92887913cadf06b2adb97f26cde4849b
703 89e6c98d92887913cadf06b2adb97f26cde4849b
672
704
673
705
674 Pushing revision #1 causes uploading entity 89e6c98d9288, which is
706 Pushing revision #1 causes uploading entity 89e6c98d9288, which is
675 shared also by largefiles b1, b2 in revision #2 and b in revision #5.
707 shared also by largefiles b1, b2 in revision #2 and b in revision #5.
676
708
677 Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg
709 Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg
678 summary" and "hg outgoing", even though files in outgoing revision #2
710 summary" and "hg outgoing", even though files in outgoing revision #2
679 and #5 refer it.
711 and #5 refer it.
680
712
681 $ hg -R clone2 push -r 1 -q
713 $ hg -R clone2 push -r 1 -q
682 $ hg -R clone2 summary --large
714 $ hg -R clone2 summary --large
683 parent: 5:036794ea641c tip
715 parent: 5:036794ea641c tip
684 #5: refer existing largefile entity again
716 #5: refer existing largefile entity again
685 branch: default
717 branch: default
686 commit: (clean)
718 commit: (clean)
687 update: (current)
719 update: (current)
688 largefiles: 2 entities for 1 files to upload
720 largefiles: 2 entities for 1 files to upload
689 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
721 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
690 comparing with $TESTTMP/issue3651/src (glob)
722 comparing with $TESTTMP/issue3651/src (glob)
691 searching for changes
723 searching for changes
692 2:6095d0695d70
724 2:6095d0695d70
693 3:7983dce246cc
725 3:7983dce246cc
694 4:233f12ada4ae
726 4:233f12ada4ae
695 5:036794ea641c
727 5:036794ea641c
696 largefiles to upload (2 entities):
728 largefiles to upload (2 entities):
697 b
729 b
698
730
699 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
731 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
700 comparing with $TESTTMP/issue3651/src (glob)
732 comparing with $TESTTMP/issue3651/src (glob)
701 query 1; heads
733 query 1; heads
702 searching for changes
734 searching for changes
703 all remote heads known locally
735 all remote heads known locally
704 2:6095d0695d70
736 2:6095d0695d70
705 3:7983dce246cc
737 3:7983dce246cc
706 4:233f12ada4ae
738 4:233f12ada4ae
707 5:036794ea641c
739 5:036794ea641c
708 finding outgoing largefiles: 0/4 revision (0.00%)
740 finding outgoing largefiles: 0/4 revision (0.00%)
709 finding outgoing largefiles: 1/4 revision (25.00%)
741 finding outgoing largefiles: 1/4 revision (25.00%)
710 finding outgoing largefiles: 2/4 revision (50.00%)
742 finding outgoing largefiles: 2/4 revision (50.00%)
711 finding outgoing largefiles: 3/4 revision (75.00%)
743 finding outgoing largefiles: 3/4 revision (75.00%)
712 largefiles to upload (2 entities):
744 largefiles to upload (2 entities):
713 b
745 b
714 13f9ed0898e315bf59dc2973fec52037b6f441a2
746 13f9ed0898e315bf59dc2973fec52037b6f441a2
715 c801c9cfe94400963fcb683246217d5db77f9a9a
747 c801c9cfe94400963fcb683246217d5db77f9a9a
716
748
717
749
718 $ cd ..
750 $ cd ..
719
751
720 merge action 'd' for 'local renamed directory to d2/g' which has no filename
752 merge action 'd' for 'local renamed directory to d2/g' which has no filename
721 ==================================================================================
753 ==================================================================================
722
754
723 $ hg init merge-action
755 $ hg init merge-action
724 $ cd merge-action
756 $ cd merge-action
725 $ touch l
757 $ touch l
726 $ hg add --large l
758 $ hg add --large l
727 $ mkdir d1
759 $ mkdir d1
728 $ touch d1/f
760 $ touch d1/f
729 $ hg ci -Aqm0
761 $ hg ci -Aqm0
730 Invoking status precommit hook
762 Invoking status precommit hook
731 A d1/f
763 A d1/f
732 A l
764 A l
733 $ echo > d1/f
765 $ echo > d1/f
734 $ touch d1/g
766 $ touch d1/g
735 $ hg ci -Aqm1
767 $ hg ci -Aqm1
736 Invoking status precommit hook
768 Invoking status precommit hook
737 M d1/f
769 M d1/f
738 A d1/g
770 A d1/g
739 $ hg up -qr0
771 $ hg up -qr0
740 $ hg mv d1 d2
772 $ hg mv d1 d2
741 moving d1/f to d2/f (glob)
773 moving d1/f to d2/f (glob)
742 $ hg ci -qm2
774 $ hg ci -qm2
743 Invoking status precommit hook
775 Invoking status precommit hook
744 A d2/f
776 A d2/f
745 R d1/f
777 R d1/f
746 $ hg merge
778 $ hg merge
747 merging d2/f and d1/f to d2/f
779 merging d2/f and d1/f to d2/f
748 getting changed largefiles
780 getting changed largefiles
749 0 largefiles updated, 0 removed
781 0 largefiles updated, 0 removed
750 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
782 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
751 (branch merge, don't forget to commit)
783 (branch merge, don't forget to commit)
752 $ cd ..
784 $ cd ..
753
785
754
786
755 Merge conflicts:
787 Merge conflicts:
756 =====================
788 =====================
757
789
758 $ hg init merge
790 $ hg init merge
759 $ cd merge
791 $ cd merge
760 $ echo 0 > f-different
792 $ echo 0 > f-different
761 $ echo 0 > f-same
793 $ echo 0 > f-same
762 $ echo 0 > f-unchanged-1
794 $ echo 0 > f-unchanged-1
763 $ echo 0 > f-unchanged-2
795 $ echo 0 > f-unchanged-2
764 $ hg add --large *
796 $ hg add --large *
765 $ hg ci -m0
797 $ hg ci -m0
766 Invoking status precommit hook
798 Invoking status precommit hook
767 A f-different
799 A f-different
768 A f-same
800 A f-same
769 A f-unchanged-1
801 A f-unchanged-1
770 A f-unchanged-2
802 A f-unchanged-2
771 $ echo tmp1 > f-unchanged-1
803 $ echo tmp1 > f-unchanged-1
772 $ echo tmp1 > f-unchanged-2
804 $ echo tmp1 > f-unchanged-2
773 $ echo tmp1 > f-same
805 $ echo tmp1 > f-same
774 $ hg ci -m1
806 $ hg ci -m1
775 Invoking status precommit hook
807 Invoking status precommit hook
776 M f-same
808 M f-same
777 M f-unchanged-1
809 M f-unchanged-1
778 M f-unchanged-2
810 M f-unchanged-2
779 $ echo 2 > f-different
811 $ echo 2 > f-different
780 $ echo 0 > f-unchanged-1
812 $ echo 0 > f-unchanged-1
781 $ echo 1 > f-unchanged-2
813 $ echo 1 > f-unchanged-2
782 $ echo 1 > f-same
814 $ echo 1 > f-same
783 $ hg ci -m2
815 $ hg ci -m2
784 Invoking status precommit hook
816 Invoking status precommit hook
785 M f-different
817 M f-different
786 M f-same
818 M f-same
787 M f-unchanged-1
819 M f-unchanged-1
788 M f-unchanged-2
820 M f-unchanged-2
789 $ hg up -qr0
821 $ hg up -qr0
790 $ echo tmp2 > f-unchanged-1
822 $ echo tmp2 > f-unchanged-1
791 $ echo tmp2 > f-unchanged-2
823 $ echo tmp2 > f-unchanged-2
792 $ echo tmp2 > f-same
824 $ echo tmp2 > f-same
793 $ hg ci -m3
825 $ hg ci -m3
794 Invoking status precommit hook
826 Invoking status precommit hook
795 M f-same
827 M f-same
796 M f-unchanged-1
828 M f-unchanged-1
797 M f-unchanged-2
829 M f-unchanged-2
798 created new head
830 created new head
799 $ echo 1 > f-different
831 $ echo 1 > f-different
800 $ echo 1 > f-unchanged-1
832 $ echo 1 > f-unchanged-1
801 $ echo 0 > f-unchanged-2
833 $ echo 0 > f-unchanged-2
802 $ echo 1 > f-same
834 $ echo 1 > f-same
803 $ hg ci -m4
835 $ hg ci -m4
804 Invoking status precommit hook
836 Invoking status precommit hook
805 M f-different
837 M f-different
806 M f-same
838 M f-same
807 M f-unchanged-1
839 M f-unchanged-1
808 M f-unchanged-2
840 M f-unchanged-2
809 $ hg merge
841 $ hg merge
810 largefile f-different has a merge conflict
842 largefile f-different has a merge conflict
811 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
843 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
812 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
844 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
813 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
845 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
814 getting changed largefiles
846 getting changed largefiles
815 1 largefiles updated, 0 removed
847 1 largefiles updated, 0 removed
816 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
848 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
817 (branch merge, don't forget to commit)
849 (branch merge, don't forget to commit)
818 $ cat f-different
850 $ cat f-different
819 1
851 1
820 $ cat f-same
852 $ cat f-same
821 1
853 1
822 $ cat f-unchanged-1
854 $ cat f-unchanged-1
823 1
855 1
824 $ cat f-unchanged-2
856 $ cat f-unchanged-2
825 1
857 1
826 $ cd ..
858 $ cd ..
827
859
828 Test largefile insulation (do not enabled a side effect
860 Test largefile insulation (do not enabled a side effect
829 ========================================================
861 ========================================================
830
862
831 Check whether "largefiles" feature is supported only in repositories
863 Check whether "largefiles" feature is supported only in repositories
832 enabling largefiles extension.
864 enabling largefiles extension.
833
865
834 $ mkdir individualenabling
866 $ mkdir individualenabling
835 $ cd individualenabling
867 $ cd individualenabling
836
868
837 $ hg init enabledlocally
869 $ hg init enabledlocally
838 $ echo large > enabledlocally/large
870 $ echo large > enabledlocally/large
839 $ hg -R enabledlocally add --large enabledlocally/large
871 $ hg -R enabledlocally add --large enabledlocally/large
840 $ hg -R enabledlocally commit -m '#0'
872 $ hg -R enabledlocally commit -m '#0'
841 Invoking status precommit hook
873 Invoking status precommit hook
842 A large
874 A large
843
875
844 $ hg init notenabledlocally
876 $ hg init notenabledlocally
845 $ echo large > notenabledlocally/large
877 $ echo large > notenabledlocally/large
846 $ hg -R notenabledlocally add --large notenabledlocally/large
878 $ hg -R notenabledlocally add --large notenabledlocally/large
847 $ hg -R notenabledlocally commit -m '#0'
879 $ hg -R notenabledlocally commit -m '#0'
848 Invoking status precommit hook
880 Invoking status precommit hook
849 A large
881 A large
850
882
851 $ cat >> $HGRCPATH <<EOF
883 $ cat >> $HGRCPATH <<EOF
852 > [extensions]
884 > [extensions]
853 > # disable globally
885 > # disable globally
854 > largefiles=!
886 > largefiles=!
855 > EOF
887 > EOF
856 $ cat >> enabledlocally/.hg/hgrc <<EOF
888 $ cat >> enabledlocally/.hg/hgrc <<EOF
857 > [extensions]
889 > [extensions]
858 > # enable locally
890 > # enable locally
859 > largefiles=
891 > largefiles=
860 > EOF
892 > EOF
861 $ hg -R enabledlocally root
893 $ hg -R enabledlocally root
862 $TESTTMP/individualenabling/enabledlocally (glob)
894 $TESTTMP/individualenabling/enabledlocally (glob)
863 $ hg -R notenabledlocally root
895 $ hg -R notenabledlocally root
864 abort: repository requires features unknown to this Mercurial: largefiles!
896 abort: repository requires features unknown to this Mercurial: largefiles!
865 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
897 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
866 [255]
898 [255]
867
899
868 $ hg init push-dst
900 $ hg init push-dst
869 $ hg -R enabledlocally push push-dst
901 $ hg -R enabledlocally push push-dst
870 pushing to push-dst
902 pushing to push-dst
871 abort: required features are not supported in the destination: largefiles
903 abort: required features are not supported in the destination: largefiles
872 [255]
904 [255]
873
905
874 $ hg init pull-src
906 $ hg init pull-src
875 $ hg -R pull-src pull enabledlocally
907 $ hg -R pull-src pull enabledlocally
876 pulling from enabledlocally
908 pulling from enabledlocally
877 abort: required features are not supported in the destination: largefiles
909 abort: required features are not supported in the destination: largefiles
878 [255]
910 [255]
879
911
880 $ hg clone enabledlocally clone-dst
912 $ hg clone enabledlocally clone-dst
881 abort: repository requires features unknown to this Mercurial: largefiles!
913 abort: repository requires features unknown to this Mercurial: largefiles!
882 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
914 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
883 [255]
915 [255]
884 $ test -d clone-dst
916 $ test -d clone-dst
885 [1]
917 [1]
886 $ hg clone --pull enabledlocally clone-pull-dst
918 $ hg clone --pull enabledlocally clone-pull-dst
887 abort: required features are not supported in the destination: largefiles
919 abort: required features are not supported in the destination: largefiles
888 [255]
920 [255]
889 $ test -d clone-pull-dst
921 $ test -d clone-pull-dst
890 [1]
922 [1]
891
923
892 #if serve
924 #if serve
893
925
894 Test largefiles specific peer setup, when largefiles is enabled
926 Test largefiles specific peer setup, when largefiles is enabled
895 locally (issue4109)
927 locally (issue4109)
896
928
897 $ hg showconfig extensions | grep largefiles
929 $ hg showconfig extensions | grep largefiles
898 extensions.largefiles=!
930 extensions.largefiles=!
899 $ mkdir -p $TESTTMP/individualenabling/usercache
931 $ mkdir -p $TESTTMP/individualenabling/usercache
900
932
901 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
933 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
902 $ cat hg.pid >> $DAEMON_PIDS
934 $ cat hg.pid >> $DAEMON_PIDS
903
935
904 $ hg init pull-dst
936 $ hg init pull-dst
905 $ cat > pull-dst/.hg/hgrc <<EOF
937 $ cat > pull-dst/.hg/hgrc <<EOF
906 > [extensions]
938 > [extensions]
907 > # enable locally
939 > # enable locally
908 > largefiles=
940 > largefiles=
909 > [largefiles]
941 > [largefiles]
910 > # ignore system cache to force largefiles specific wire proto access
942 > # ignore system cache to force largefiles specific wire proto access
911 > usercache=$TESTTMP/individualenabling/usercache
943 > usercache=$TESTTMP/individualenabling/usercache
912 > EOF
944 > EOF
913 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
945 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
914
946
915 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
947 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
916 #endif
948 #endif
917
949
918 Test overridden functions work correctly even for repos disabling
950 Test overridden functions work correctly even for repos disabling
919 largefiles (issue4547)
951 largefiles (issue4547)
920
952
921 $ hg showconfig extensions | grep largefiles
953 $ hg showconfig extensions | grep largefiles
922 extensions.largefiles=!
954 extensions.largefiles=!
923
955
924 (test updating implied by clone)
956 (test updating implied by clone)
925
957
926 $ hg init enabled-but-no-largefiles
958 $ hg init enabled-but-no-largefiles
927 $ echo normal1 > enabled-but-no-largefiles/normal1
959 $ echo normal1 > enabled-but-no-largefiles/normal1
928 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1
960 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1
929 $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles'
961 $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles'
930 Invoking status precommit hook
962 Invoking status precommit hook
931 A normal1
963 A normal1
932 $ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF
964 $ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF
933 > [extensions]
965 > [extensions]
934 > # enable locally
966 > # enable locally
935 > largefiles=
967 > largefiles=
936 > EOF
968 > EOF
937 $ hg clone -q enabled-but-no-largefiles no-largefiles
969 $ hg clone -q enabled-but-no-largefiles no-largefiles
938
970
939 (test rebasing implied by pull: precommit while rebasing unexpectedly
971 (test rebasing implied by pull: precommit while rebasing unexpectedly
940 shows "normal3" as "?", because lfdirstate isn't yet written out at
972 shows "normal3" as "?", because lfdirstate isn't yet written out at
941 that time)
973 that time)
942
974
943 $ echo normal2 > enabled-but-no-largefiles/normal2
975 $ echo normal2 > enabled-but-no-largefiles/normal2
944 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2
976 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2
945 $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles'
977 $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles'
946 Invoking status precommit hook
978 Invoking status precommit hook
947 A normal2
979 A normal2
948
980
949 $ echo normal3 > no-largefiles/normal3
981 $ echo normal3 > no-largefiles/normal3
950 $ hg -R no-largefiles add no-largefiles/normal3
982 $ hg -R no-largefiles add no-largefiles/normal3
951 $ hg -R no-largefiles commit -m '#1@no-largefiles'
983 $ hg -R no-largefiles commit -m '#1@no-largefiles'
952 Invoking status precommit hook
984 Invoking status precommit hook
953 A normal3
985 A normal3
954
986
955 $ hg -R no-largefiles -q pull --rebase
987 $ hg -R no-largefiles -q pull --rebase
956 Invoking status precommit hook
988 Invoking status precommit hook
957 ? normal3
989 ? normal3
958
990
959 (test reverting)
991 (test reverting)
960
992
961 $ hg init subrepo-root
993 $ hg init subrepo-root
962 $ cat >> subrepo-root/.hg/hgrc <<EOF
994 $ cat >> subrepo-root/.hg/hgrc <<EOF
963 > [extensions]
995 > [extensions]
964 > # enable locally
996 > # enable locally
965 > largefiles=
997 > largefiles=
966 > EOF
998 > EOF
967 $ echo large > subrepo-root/large
999 $ echo large > subrepo-root/large
968 $ hg -R subrepo-root add --large subrepo-root/large
1000 $ hg -R subrepo-root add --large subrepo-root/large
969 $ hg clone -q no-largefiles subrepo-root/no-largefiles
1001 $ hg clone -q no-largefiles subrepo-root/no-largefiles
970 $ cat > subrepo-root/.hgsub <<EOF
1002 $ cat > subrepo-root/.hgsub <<EOF
971 > no-largefiles = no-largefiles
1003 > no-largefiles = no-largefiles
972 > EOF
1004 > EOF
973 $ hg -R subrepo-root add subrepo-root/.hgsub
1005 $ hg -R subrepo-root add subrepo-root/.hgsub
974 $ hg -R subrepo-root commit -m '#0'
1006 $ hg -R subrepo-root commit -m '#0'
975 Invoking status precommit hook
1007 Invoking status precommit hook
976 A .hgsub
1008 A .hgsub
977 A large
1009 A large
978 ? .hgsubstate
1010 ? .hgsubstate
979 $ echo dirty >> subrepo-root/large
1011 $ echo dirty >> subrepo-root/large
980 $ echo dirty >> subrepo-root/no-largefiles/normal1
1012 $ echo dirty >> subrepo-root/no-largefiles/normal1
981 $ hg -R subrepo-root status -S
1013 $ hg -R subrepo-root status -S
982 M large
1014 M large
983 M no-largefiles/normal1
1015 M no-largefiles/normal1
984 $ hg -R subrepo-root revert --all
1016 $ hg -R subrepo-root revert --all
985 reverting subrepo-root/.hglf/large (glob)
1017 reverting subrepo-root/.hglf/large (glob)
986 reverting subrepo no-largefiles
1018 reverting subrepo no-largefiles
987 reverting subrepo-root/no-largefiles/normal1 (glob)
1019 reverting subrepo-root/no-largefiles/normal1 (glob)
988
1020
989 $ cd ..
1021 $ cd ..
990
1022
991
1023
992 Test "pull --rebase" when rebase is enabled before largefiles (issue3861)
1024 Test "pull --rebase" when rebase is enabled before largefiles (issue3861)
993 =========================================================================
1025 =========================================================================
994
1026
995 $ hg showconfig extensions | grep largefiles
1027 $ hg showconfig extensions | grep largefiles
996 extensions.largefiles=!
1028 extensions.largefiles=!
997
1029
998 $ mkdir issue3861
1030 $ mkdir issue3861
999 $ cd issue3861
1031 $ cd issue3861
1000 $ hg init src
1032 $ hg init src
1001 $ hg clone -q src dst
1033 $ hg clone -q src dst
1002 $ echo a > src/a
1034 $ echo a > src/a
1003 $ hg -R src commit -Aqm "#0"
1035 $ hg -R src commit -Aqm "#0"
1004 Invoking status precommit hook
1036 Invoking status precommit hook
1005 A a
1037 A a
1006
1038
1007 $ cat >> dst/.hg/hgrc <<EOF
1039 $ cat >> dst/.hg/hgrc <<EOF
1008 > [extensions]
1040 > [extensions]
1009 > largefiles=
1041 > largefiles=
1010 > EOF
1042 > EOF
1011 $ hg -R dst pull --rebase
1043 $ hg -R dst pull --rebase
1012 pulling from $TESTTMP/issue3861/src (glob)
1044 pulling from $TESTTMP/issue3861/src (glob)
1013 requesting all changes
1045 requesting all changes
1014 adding changesets
1046 adding changesets
1015 adding manifests
1047 adding manifests
1016 adding file changes
1048 adding file changes
1017 added 1 changesets with 1 changes to 1 files
1049 added 1 changesets with 1 changes to 1 files
1018 nothing to rebase - working directory parent is already an ancestor of destination bf5e395ced2c
1050 nothing to rebase - working directory parent is already an ancestor of destination bf5e395ced2c
1019 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1051 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1020
1052
1021 $ cd ..
1053 $ cd ..
@@ -1,1972 +1,1994
1 Log on empty repository: checking consistency
1 Log on empty repository: checking consistency
2
2
3 $ hg init empty
3 $ hg init empty
4 $ cd empty
4 $ cd empty
5 $ hg log
5 $ hg log
6 $ hg log -r 1
6 $ hg log -r 1
7 abort: unknown revision '1'!
7 abort: unknown revision '1'!
8 [255]
8 [255]
9 $ hg log -r -1:0
9 $ hg log -r -1:0
10 abort: unknown revision '-1'!
10 abort: unknown revision '-1'!
11 [255]
11 [255]
12 $ hg log -r 'branch(name)'
12 $ hg log -r 'branch(name)'
13 abort: unknown revision 'name'!
13 abort: unknown revision 'name'!
14 [255]
14 [255]
15 $ hg log -r null -q
15 $ hg log -r null -q
16 -1:000000000000
16 -1:000000000000
17
17
18 The g is crafted to have 2 filelog topological heads in a linear
18 The g is crafted to have 2 filelog topological heads in a linear
19 changeset graph
19 changeset graph
20
20
21 $ hg init a
21 $ hg init a
22 $ cd a
22 $ cd a
23 $ echo a > a
23 $ echo a > a
24 $ echo f > f
24 $ echo f > f
25 $ hg ci -Ama -d '1 0'
25 $ hg ci -Ama -d '1 0'
26 adding a
26 adding a
27 adding f
27 adding f
28
28
29 $ hg cp a b
29 $ hg cp a b
30 $ hg cp f g
30 $ hg cp f g
31 $ hg ci -mb -d '2 0'
31 $ hg ci -mb -d '2 0'
32
32
33 $ mkdir dir
33 $ mkdir dir
34 $ hg mv b dir
34 $ hg mv b dir
35 $ echo g >> g
35 $ echo g >> g
36 $ echo f >> f
36 $ echo f >> f
37 $ hg ci -mc -d '3 0'
37 $ hg ci -mc -d '3 0'
38
38
39 $ hg mv a b
39 $ hg mv a b
40 $ hg cp -f f g
40 $ hg cp -f f g
41 $ echo a > d
41 $ echo a > d
42 $ hg add d
42 $ hg add d
43 $ hg ci -md -d '4 0'
43 $ hg ci -md -d '4 0'
44
44
45 $ hg mv dir/b e
45 $ hg mv dir/b e
46 $ hg ci -me -d '5 0'
46 $ hg ci -me -d '5 0'
47
47
48 Make sure largefiles doesn't interfere with logging a regular file
48 Make sure largefiles doesn't interfere with logging a regular file
49 $ hg log a --config extensions.largefiles=
49 $ hg log a --config extensions.largefiles=
50 changeset: 0:9161b9aeaf16
50 changeset: 0:9161b9aeaf16
51 user: test
51 user: test
52 date: Thu Jan 01 00:00:01 1970 +0000
52 date: Thu Jan 01 00:00:01 1970 +0000
53 summary: a
53 summary: a
54
54
55 $ hg log a
55 $ hg log a
56 changeset: 0:9161b9aeaf16
56 changeset: 0:9161b9aeaf16
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:01 1970 +0000
58 date: Thu Jan 01 00:00:01 1970 +0000
59 summary: a
59 summary: a
60
60
61 $ hg log glob:a*
62 changeset: 3:2ca5ba701980
63 user: test
64 date: Thu Jan 01 00:00:04 1970 +0000
65 summary: d
66
67 changeset: 0:9161b9aeaf16
68 user: test
69 date: Thu Jan 01 00:00:01 1970 +0000
70 summary: a
71
72 $ hg log glob:a* --config extensions.largefiles=
73 changeset: 3:2ca5ba701980
74 user: test
75 date: Thu Jan 01 00:00:04 1970 +0000
76 summary: d
77
78 changeset: 0:9161b9aeaf16
79 user: test
80 date: Thu Jan 01 00:00:01 1970 +0000
81 summary: a
82
61 log on directory
83 log on directory
62
84
63 $ hg log dir
85 $ hg log dir
64 changeset: 4:7e4639b4691b
86 changeset: 4:7e4639b4691b
65 tag: tip
87 tag: tip
66 user: test
88 user: test
67 date: Thu Jan 01 00:00:05 1970 +0000
89 date: Thu Jan 01 00:00:05 1970 +0000
68 summary: e
90 summary: e
69
91
70 changeset: 2:f8954cd4dc1f
92 changeset: 2:f8954cd4dc1f
71 user: test
93 user: test
72 date: Thu Jan 01 00:00:03 1970 +0000
94 date: Thu Jan 01 00:00:03 1970 +0000
73 summary: c
95 summary: c
74
96
75 $ hg log somethingthatdoesntexist dir
97 $ hg log somethingthatdoesntexist dir
76 changeset: 4:7e4639b4691b
98 changeset: 4:7e4639b4691b
77 tag: tip
99 tag: tip
78 user: test
100 user: test
79 date: Thu Jan 01 00:00:05 1970 +0000
101 date: Thu Jan 01 00:00:05 1970 +0000
80 summary: e
102 summary: e
81
103
82 changeset: 2:f8954cd4dc1f
104 changeset: 2:f8954cd4dc1f
83 user: test
105 user: test
84 date: Thu Jan 01 00:00:03 1970 +0000
106 date: Thu Jan 01 00:00:03 1970 +0000
85 summary: c
107 summary: c
86
108
87
109
88 -f, non-existent directory
110 -f, non-existent directory
89
111
90 $ hg log -f dir
112 $ hg log -f dir
91 abort: cannot follow file not in parent revision: "dir"
113 abort: cannot follow file not in parent revision: "dir"
92 [255]
114 [255]
93
115
94 -f, directory
116 -f, directory
95
117
96 $ hg up -q 3
118 $ hg up -q 3
97 $ hg log -f dir
119 $ hg log -f dir
98 changeset: 2:f8954cd4dc1f
120 changeset: 2:f8954cd4dc1f
99 user: test
121 user: test
100 date: Thu Jan 01 00:00:03 1970 +0000
122 date: Thu Jan 01 00:00:03 1970 +0000
101 summary: c
123 summary: c
102
124
103 -f, directory with --patch
125 -f, directory with --patch
104
126
105 $ hg log -f dir -p
127 $ hg log -f dir -p
106 changeset: 2:f8954cd4dc1f
128 changeset: 2:f8954cd4dc1f
107 user: test
129 user: test
108 date: Thu Jan 01 00:00:03 1970 +0000
130 date: Thu Jan 01 00:00:03 1970 +0000
109 summary: c
131 summary: c
110
132
111 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
133 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
112 --- /dev/null* (glob)
134 --- /dev/null* (glob)
113 +++ b/dir/b* (glob)
135 +++ b/dir/b* (glob)
114 @@ -0,0 +1,1 @@
136 @@ -0,0 +1,1 @@
115 +a
137 +a
116
138
117
139
118 -f, pattern
140 -f, pattern
119
141
120 $ hg log -f -I 'dir**' -p
142 $ hg log -f -I 'dir**' -p
121 changeset: 2:f8954cd4dc1f
143 changeset: 2:f8954cd4dc1f
122 user: test
144 user: test
123 date: Thu Jan 01 00:00:03 1970 +0000
145 date: Thu Jan 01 00:00:03 1970 +0000
124 summary: c
146 summary: c
125
147
126 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
148 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
127 --- /dev/null* (glob)
149 --- /dev/null* (glob)
128 +++ b/dir/b* (glob)
150 +++ b/dir/b* (glob)
129 @@ -0,0 +1,1 @@
151 @@ -0,0 +1,1 @@
130 +a
152 +a
131
153
132 $ hg up -q 4
154 $ hg up -q 4
133
155
134 -f, a wrong style
156 -f, a wrong style
135
157
136 $ hg log -f -l1 --style something
158 $ hg log -f -l1 --style something
137 abort: style 'something' not found
159 abort: style 'something' not found
138 (available styles: bisect, changelog, compact, default, phases, xml)
160 (available styles: bisect, changelog, compact, default, phases, xml)
139 [255]
161 [255]
140
162
141 -f, phases style
163 -f, phases style
142
164
143
165
144 $ hg log -f -l1 --style phases
166 $ hg log -f -l1 --style phases
145 changeset: 4:7e4639b4691b
167 changeset: 4:7e4639b4691b
146 tag: tip
168 tag: tip
147 phase: draft
169 phase: draft
148 user: test
170 user: test
149 date: Thu Jan 01 00:00:05 1970 +0000
171 date: Thu Jan 01 00:00:05 1970 +0000
150 summary: e
172 summary: e
151
173
152
174
153 -f, but no args
175 -f, but no args
154
176
155 $ hg log -f
177 $ hg log -f
156 changeset: 4:7e4639b4691b
178 changeset: 4:7e4639b4691b
157 tag: tip
179 tag: tip
158 user: test
180 user: test
159 date: Thu Jan 01 00:00:05 1970 +0000
181 date: Thu Jan 01 00:00:05 1970 +0000
160 summary: e
182 summary: e
161
183
162 changeset: 3:2ca5ba701980
184 changeset: 3:2ca5ba701980
163 user: test
185 user: test
164 date: Thu Jan 01 00:00:04 1970 +0000
186 date: Thu Jan 01 00:00:04 1970 +0000
165 summary: d
187 summary: d
166
188
167 changeset: 2:f8954cd4dc1f
189 changeset: 2:f8954cd4dc1f
168 user: test
190 user: test
169 date: Thu Jan 01 00:00:03 1970 +0000
191 date: Thu Jan 01 00:00:03 1970 +0000
170 summary: c
192 summary: c
171
193
172 changeset: 1:d89b0a12d229
194 changeset: 1:d89b0a12d229
173 user: test
195 user: test
174 date: Thu Jan 01 00:00:02 1970 +0000
196 date: Thu Jan 01 00:00:02 1970 +0000
175 summary: b
197 summary: b
176
198
177 changeset: 0:9161b9aeaf16
199 changeset: 0:9161b9aeaf16
178 user: test
200 user: test
179 date: Thu Jan 01 00:00:01 1970 +0000
201 date: Thu Jan 01 00:00:01 1970 +0000
180 summary: a
202 summary: a
181
203
182
204
183 one rename
205 one rename
184
206
185 $ hg up -q 2
207 $ hg up -q 2
186 $ hg log -vf a
208 $ hg log -vf a
187 changeset: 0:9161b9aeaf16
209 changeset: 0:9161b9aeaf16
188 user: test
210 user: test
189 date: Thu Jan 01 00:00:01 1970 +0000
211 date: Thu Jan 01 00:00:01 1970 +0000
190 files: a f
212 files: a f
191 description:
213 description:
192 a
214 a
193
215
194
216
195
217
196 many renames
218 many renames
197
219
198 $ hg up -q tip
220 $ hg up -q tip
199 $ hg log -vf e
221 $ hg log -vf e
200 changeset: 4:7e4639b4691b
222 changeset: 4:7e4639b4691b
201 tag: tip
223 tag: tip
202 user: test
224 user: test
203 date: Thu Jan 01 00:00:05 1970 +0000
225 date: Thu Jan 01 00:00:05 1970 +0000
204 files: dir/b e
226 files: dir/b e
205 description:
227 description:
206 e
228 e
207
229
208
230
209 changeset: 2:f8954cd4dc1f
231 changeset: 2:f8954cd4dc1f
210 user: test
232 user: test
211 date: Thu Jan 01 00:00:03 1970 +0000
233 date: Thu Jan 01 00:00:03 1970 +0000
212 files: b dir/b f g
234 files: b dir/b f g
213 description:
235 description:
214 c
236 c
215
237
216
238
217 changeset: 1:d89b0a12d229
239 changeset: 1:d89b0a12d229
218 user: test
240 user: test
219 date: Thu Jan 01 00:00:02 1970 +0000
241 date: Thu Jan 01 00:00:02 1970 +0000
220 files: b g
242 files: b g
221 description:
243 description:
222 b
244 b
223
245
224
246
225 changeset: 0:9161b9aeaf16
247 changeset: 0:9161b9aeaf16
226 user: test
248 user: test
227 date: Thu Jan 01 00:00:01 1970 +0000
249 date: Thu Jan 01 00:00:01 1970 +0000
228 files: a f
250 files: a f
229 description:
251 description:
230 a
252 a
231
253
232
254
233
255
234
256
235 log -pf dir/b
257 log -pf dir/b
236
258
237 $ hg up -q 3
259 $ hg up -q 3
238 $ hg log -pf dir/b
260 $ hg log -pf dir/b
239 changeset: 2:f8954cd4dc1f
261 changeset: 2:f8954cd4dc1f
240 user: test
262 user: test
241 date: Thu Jan 01 00:00:03 1970 +0000
263 date: Thu Jan 01 00:00:03 1970 +0000
242 summary: c
264 summary: c
243
265
244 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
266 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
245 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
267 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
246 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
268 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
247 @@ -0,0 +1,1 @@
269 @@ -0,0 +1,1 @@
248 +a
270 +a
249
271
250 changeset: 1:d89b0a12d229
272 changeset: 1:d89b0a12d229
251 user: test
273 user: test
252 date: Thu Jan 01 00:00:02 1970 +0000
274 date: Thu Jan 01 00:00:02 1970 +0000
253 summary: b
275 summary: b
254
276
255 diff -r 9161b9aeaf16 -r d89b0a12d229 b
277 diff -r 9161b9aeaf16 -r d89b0a12d229 b
256 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
278 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
257 +++ b/b Thu Jan 01 00:00:02 1970 +0000
279 +++ b/b Thu Jan 01 00:00:02 1970 +0000
258 @@ -0,0 +1,1 @@
280 @@ -0,0 +1,1 @@
259 +a
281 +a
260
282
261 changeset: 0:9161b9aeaf16
283 changeset: 0:9161b9aeaf16
262 user: test
284 user: test
263 date: Thu Jan 01 00:00:01 1970 +0000
285 date: Thu Jan 01 00:00:01 1970 +0000
264 summary: a
286 summary: a
265
287
266 diff -r 000000000000 -r 9161b9aeaf16 a
288 diff -r 000000000000 -r 9161b9aeaf16 a
267 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
289 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
268 +++ b/a Thu Jan 01 00:00:01 1970 +0000
290 +++ b/a Thu Jan 01 00:00:01 1970 +0000
269 @@ -0,0 +1,1 @@
291 @@ -0,0 +1,1 @@
270 +a
292 +a
271
293
272
294
273 log -pf b inside dir
295 log -pf b inside dir
274
296
275 $ hg --cwd=dir log -pf b
297 $ hg --cwd=dir log -pf b
276 changeset: 2:f8954cd4dc1f
298 changeset: 2:f8954cd4dc1f
277 user: test
299 user: test
278 date: Thu Jan 01 00:00:03 1970 +0000
300 date: Thu Jan 01 00:00:03 1970 +0000
279 summary: c
301 summary: c
280
302
281 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
303 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
282 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
304 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
283 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
305 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
284 @@ -0,0 +1,1 @@
306 @@ -0,0 +1,1 @@
285 +a
307 +a
286
308
287 changeset: 1:d89b0a12d229
309 changeset: 1:d89b0a12d229
288 user: test
310 user: test
289 date: Thu Jan 01 00:00:02 1970 +0000
311 date: Thu Jan 01 00:00:02 1970 +0000
290 summary: b
312 summary: b
291
313
292 diff -r 9161b9aeaf16 -r d89b0a12d229 b
314 diff -r 9161b9aeaf16 -r d89b0a12d229 b
293 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
315 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
294 +++ b/b Thu Jan 01 00:00:02 1970 +0000
316 +++ b/b Thu Jan 01 00:00:02 1970 +0000
295 @@ -0,0 +1,1 @@
317 @@ -0,0 +1,1 @@
296 +a
318 +a
297
319
298 changeset: 0:9161b9aeaf16
320 changeset: 0:9161b9aeaf16
299 user: test
321 user: test
300 date: Thu Jan 01 00:00:01 1970 +0000
322 date: Thu Jan 01 00:00:01 1970 +0000
301 summary: a
323 summary: a
302
324
303 diff -r 000000000000 -r 9161b9aeaf16 a
325 diff -r 000000000000 -r 9161b9aeaf16 a
304 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
326 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
305 +++ b/a Thu Jan 01 00:00:01 1970 +0000
327 +++ b/a Thu Jan 01 00:00:01 1970 +0000
306 @@ -0,0 +1,1 @@
328 @@ -0,0 +1,1 @@
307 +a
329 +a
308
330
309
331
310 log -pf, but no args
332 log -pf, but no args
311
333
312 $ hg log -pf
334 $ hg log -pf
313 changeset: 3:2ca5ba701980
335 changeset: 3:2ca5ba701980
314 user: test
336 user: test
315 date: Thu Jan 01 00:00:04 1970 +0000
337 date: Thu Jan 01 00:00:04 1970 +0000
316 summary: d
338 summary: d
317
339
318 diff -r f8954cd4dc1f -r 2ca5ba701980 a
340 diff -r f8954cd4dc1f -r 2ca5ba701980 a
319 --- a/a Thu Jan 01 00:00:03 1970 +0000
341 --- a/a Thu Jan 01 00:00:03 1970 +0000
320 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
342 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
321 @@ -1,1 +0,0 @@
343 @@ -1,1 +0,0 @@
322 -a
344 -a
323 diff -r f8954cd4dc1f -r 2ca5ba701980 b
345 diff -r f8954cd4dc1f -r 2ca5ba701980 b
324 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
346 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
325 +++ b/b Thu Jan 01 00:00:04 1970 +0000
347 +++ b/b Thu Jan 01 00:00:04 1970 +0000
326 @@ -0,0 +1,1 @@
348 @@ -0,0 +1,1 @@
327 +a
349 +a
328 diff -r f8954cd4dc1f -r 2ca5ba701980 d
350 diff -r f8954cd4dc1f -r 2ca5ba701980 d
329 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
351 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
330 +++ b/d Thu Jan 01 00:00:04 1970 +0000
352 +++ b/d Thu Jan 01 00:00:04 1970 +0000
331 @@ -0,0 +1,1 @@
353 @@ -0,0 +1,1 @@
332 +a
354 +a
333 diff -r f8954cd4dc1f -r 2ca5ba701980 g
355 diff -r f8954cd4dc1f -r 2ca5ba701980 g
334 --- a/g Thu Jan 01 00:00:03 1970 +0000
356 --- a/g Thu Jan 01 00:00:03 1970 +0000
335 +++ b/g Thu Jan 01 00:00:04 1970 +0000
357 +++ b/g Thu Jan 01 00:00:04 1970 +0000
336 @@ -1,2 +1,2 @@
358 @@ -1,2 +1,2 @@
337 f
359 f
338 -g
360 -g
339 +f
361 +f
340
362
341 changeset: 2:f8954cd4dc1f
363 changeset: 2:f8954cd4dc1f
342 user: test
364 user: test
343 date: Thu Jan 01 00:00:03 1970 +0000
365 date: Thu Jan 01 00:00:03 1970 +0000
344 summary: c
366 summary: c
345
367
346 diff -r d89b0a12d229 -r f8954cd4dc1f b
368 diff -r d89b0a12d229 -r f8954cd4dc1f b
347 --- a/b Thu Jan 01 00:00:02 1970 +0000
369 --- a/b Thu Jan 01 00:00:02 1970 +0000
348 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
370 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
349 @@ -1,1 +0,0 @@
371 @@ -1,1 +0,0 @@
350 -a
372 -a
351 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
373 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
352 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
374 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
353 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
375 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
354 @@ -0,0 +1,1 @@
376 @@ -0,0 +1,1 @@
355 +a
377 +a
356 diff -r d89b0a12d229 -r f8954cd4dc1f f
378 diff -r d89b0a12d229 -r f8954cd4dc1f f
357 --- a/f Thu Jan 01 00:00:02 1970 +0000
379 --- a/f Thu Jan 01 00:00:02 1970 +0000
358 +++ b/f Thu Jan 01 00:00:03 1970 +0000
380 +++ b/f Thu Jan 01 00:00:03 1970 +0000
359 @@ -1,1 +1,2 @@
381 @@ -1,1 +1,2 @@
360 f
382 f
361 +f
383 +f
362 diff -r d89b0a12d229 -r f8954cd4dc1f g
384 diff -r d89b0a12d229 -r f8954cd4dc1f g
363 --- a/g Thu Jan 01 00:00:02 1970 +0000
385 --- a/g Thu Jan 01 00:00:02 1970 +0000
364 +++ b/g Thu Jan 01 00:00:03 1970 +0000
386 +++ b/g Thu Jan 01 00:00:03 1970 +0000
365 @@ -1,1 +1,2 @@
387 @@ -1,1 +1,2 @@
366 f
388 f
367 +g
389 +g
368
390
369 changeset: 1:d89b0a12d229
391 changeset: 1:d89b0a12d229
370 user: test
392 user: test
371 date: Thu Jan 01 00:00:02 1970 +0000
393 date: Thu Jan 01 00:00:02 1970 +0000
372 summary: b
394 summary: b
373
395
374 diff -r 9161b9aeaf16 -r d89b0a12d229 b
396 diff -r 9161b9aeaf16 -r d89b0a12d229 b
375 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
397 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
376 +++ b/b Thu Jan 01 00:00:02 1970 +0000
398 +++ b/b Thu Jan 01 00:00:02 1970 +0000
377 @@ -0,0 +1,1 @@
399 @@ -0,0 +1,1 @@
378 +a
400 +a
379 diff -r 9161b9aeaf16 -r d89b0a12d229 g
401 diff -r 9161b9aeaf16 -r d89b0a12d229 g
380 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
402 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
381 +++ b/g Thu Jan 01 00:00:02 1970 +0000
403 +++ b/g Thu Jan 01 00:00:02 1970 +0000
382 @@ -0,0 +1,1 @@
404 @@ -0,0 +1,1 @@
383 +f
405 +f
384
406
385 changeset: 0:9161b9aeaf16
407 changeset: 0:9161b9aeaf16
386 user: test
408 user: test
387 date: Thu Jan 01 00:00:01 1970 +0000
409 date: Thu Jan 01 00:00:01 1970 +0000
388 summary: a
410 summary: a
389
411
390 diff -r 000000000000 -r 9161b9aeaf16 a
412 diff -r 000000000000 -r 9161b9aeaf16 a
391 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
413 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
392 +++ b/a Thu Jan 01 00:00:01 1970 +0000
414 +++ b/a Thu Jan 01 00:00:01 1970 +0000
393 @@ -0,0 +1,1 @@
415 @@ -0,0 +1,1 @@
394 +a
416 +a
395 diff -r 000000000000 -r 9161b9aeaf16 f
417 diff -r 000000000000 -r 9161b9aeaf16 f
396 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
418 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
397 +++ b/f Thu Jan 01 00:00:01 1970 +0000
419 +++ b/f Thu Jan 01 00:00:01 1970 +0000
398 @@ -0,0 +1,1 @@
420 @@ -0,0 +1,1 @@
399 +f
421 +f
400
422
401
423
402 log -vf dir/b
424 log -vf dir/b
403
425
404 $ hg log -vf dir/b
426 $ hg log -vf dir/b
405 changeset: 2:f8954cd4dc1f
427 changeset: 2:f8954cd4dc1f
406 user: test
428 user: test
407 date: Thu Jan 01 00:00:03 1970 +0000
429 date: Thu Jan 01 00:00:03 1970 +0000
408 files: b dir/b f g
430 files: b dir/b f g
409 description:
431 description:
410 c
432 c
411
433
412
434
413 changeset: 1:d89b0a12d229
435 changeset: 1:d89b0a12d229
414 user: test
436 user: test
415 date: Thu Jan 01 00:00:02 1970 +0000
437 date: Thu Jan 01 00:00:02 1970 +0000
416 files: b g
438 files: b g
417 description:
439 description:
418 b
440 b
419
441
420
442
421 changeset: 0:9161b9aeaf16
443 changeset: 0:9161b9aeaf16
422 user: test
444 user: test
423 date: Thu Jan 01 00:00:01 1970 +0000
445 date: Thu Jan 01 00:00:01 1970 +0000
424 files: a f
446 files: a f
425 description:
447 description:
426 a
448 a
427
449
428
450
429
451
430
452
431 -f and multiple filelog heads
453 -f and multiple filelog heads
432
454
433 $ hg up -q 2
455 $ hg up -q 2
434 $ hg log -f g --template '{rev}\n'
456 $ hg log -f g --template '{rev}\n'
435 2
457 2
436 1
458 1
437 0
459 0
438 $ hg up -q tip
460 $ hg up -q tip
439 $ hg log -f g --template '{rev}\n'
461 $ hg log -f g --template '{rev}\n'
440 3
462 3
441 2
463 2
442 0
464 0
443
465
444
466
445 log copies with --copies
467 log copies with --copies
446
468
447 $ hg log -vC --template '{rev} {file_copies}\n'
469 $ hg log -vC --template '{rev} {file_copies}\n'
448 4 e (dir/b)
470 4 e (dir/b)
449 3 b (a)g (f)
471 3 b (a)g (f)
450 2 dir/b (b)
472 2 dir/b (b)
451 1 b (a)g (f)
473 1 b (a)g (f)
452 0
474 0
453
475
454 log copies switch without --copies, with old filecopy template
476 log copies switch without --copies, with old filecopy template
455
477
456 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
478 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
457 4
479 4
458 3
480 3
459 2
481 2
460 1
482 1
461 0
483 0
462
484
463 log copies switch with --copies
485 log copies switch with --copies
464
486
465 $ hg log -vC --template '{rev} {file_copies_switch}\n'
487 $ hg log -vC --template '{rev} {file_copies_switch}\n'
466 4 e (dir/b)
488 4 e (dir/b)
467 3 b (a)g (f)
489 3 b (a)g (f)
468 2 dir/b (b)
490 2 dir/b (b)
469 1 b (a)g (f)
491 1 b (a)g (f)
470 0
492 0
471
493
472
494
473 log copies with hardcoded style and with --style=default
495 log copies with hardcoded style and with --style=default
474
496
475 $ hg log -vC -r4
497 $ hg log -vC -r4
476 changeset: 4:7e4639b4691b
498 changeset: 4:7e4639b4691b
477 tag: tip
499 tag: tip
478 user: test
500 user: test
479 date: Thu Jan 01 00:00:05 1970 +0000
501 date: Thu Jan 01 00:00:05 1970 +0000
480 files: dir/b e
502 files: dir/b e
481 copies: e (dir/b)
503 copies: e (dir/b)
482 description:
504 description:
483 e
505 e
484
506
485
507
486 $ hg log -vC -r4 --style=default
508 $ hg log -vC -r4 --style=default
487 changeset: 4:7e4639b4691b
509 changeset: 4:7e4639b4691b
488 tag: tip
510 tag: tip
489 user: test
511 user: test
490 date: Thu Jan 01 00:00:05 1970 +0000
512 date: Thu Jan 01 00:00:05 1970 +0000
491 files: dir/b e
513 files: dir/b e
492 copies: e (dir/b)
514 copies: e (dir/b)
493 description:
515 description:
494 e
516 e
495
517
496
518
497 $ hg log -vC -r4 -Tjson
519 $ hg log -vC -r4 -Tjson
498 [
520 [
499 {
521 {
500 "rev": 4,
522 "rev": 4,
501 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
523 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
502 "branch": "default",
524 "branch": "default",
503 "phase": "draft",
525 "phase": "draft",
504 "user": "test",
526 "user": "test",
505 "date": [5, 0],
527 "date": [5, 0],
506 "desc": "e",
528 "desc": "e",
507 "bookmarks": [],
529 "bookmarks": [],
508 "tags": ["tip"],
530 "tags": ["tip"],
509 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
531 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
510 "files": ["dir/b", "e"],
532 "files": ["dir/b", "e"],
511 "copies": {"e": "dir/b"}
533 "copies": {"e": "dir/b"}
512 }
534 }
513 ]
535 ]
514
536
515 log copies, non-linear manifest
537 log copies, non-linear manifest
516
538
517 $ hg up -C 3
539 $ hg up -C 3
518 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
540 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
519 $ hg mv dir/b e
541 $ hg mv dir/b e
520 $ echo foo > foo
542 $ echo foo > foo
521 $ hg ci -Ame2 -d '6 0'
543 $ hg ci -Ame2 -d '6 0'
522 adding foo
544 adding foo
523 created new head
545 created new head
524 $ hg log -v --template '{rev} {file_copies}\n' -r 5
546 $ hg log -v --template '{rev} {file_copies}\n' -r 5
525 5 e (dir/b)
547 5 e (dir/b)
526
548
527
549
528 log copies, execute bit set
550 log copies, execute bit set
529
551
530 #if execbit
552 #if execbit
531 $ chmod +x e
553 $ chmod +x e
532 $ hg ci -me3 -d '7 0'
554 $ hg ci -me3 -d '7 0'
533 $ hg log -v --template '{rev} {file_copies}\n' -r 6
555 $ hg log -v --template '{rev} {file_copies}\n' -r 6
534 6
556 6
535 #endif
557 #endif
536
558
537
559
538 log -p d
560 log -p d
539
561
540 $ hg log -pv d
562 $ hg log -pv d
541 changeset: 3:2ca5ba701980
563 changeset: 3:2ca5ba701980
542 user: test
564 user: test
543 date: Thu Jan 01 00:00:04 1970 +0000
565 date: Thu Jan 01 00:00:04 1970 +0000
544 files: a b d g
566 files: a b d g
545 description:
567 description:
546 d
568 d
547
569
548
570
549 diff -r f8954cd4dc1f -r 2ca5ba701980 d
571 diff -r f8954cd4dc1f -r 2ca5ba701980 d
550 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
572 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
551 +++ b/d Thu Jan 01 00:00:04 1970 +0000
573 +++ b/d Thu Jan 01 00:00:04 1970 +0000
552 @@ -0,0 +1,1 @@
574 @@ -0,0 +1,1 @@
553 +a
575 +a
554
576
555
577
556
578
557 log --removed file
579 log --removed file
558
580
559 $ hg log --removed -v a
581 $ hg log --removed -v a
560 changeset: 3:2ca5ba701980
582 changeset: 3:2ca5ba701980
561 user: test
583 user: test
562 date: Thu Jan 01 00:00:04 1970 +0000
584 date: Thu Jan 01 00:00:04 1970 +0000
563 files: a b d g
585 files: a b d g
564 description:
586 description:
565 d
587 d
566
588
567
589
568 changeset: 0:9161b9aeaf16
590 changeset: 0:9161b9aeaf16
569 user: test
591 user: test
570 date: Thu Jan 01 00:00:01 1970 +0000
592 date: Thu Jan 01 00:00:01 1970 +0000
571 files: a f
593 files: a f
572 description:
594 description:
573 a
595 a
574
596
575
597
576
598
577 log --removed revrange file
599 log --removed revrange file
578
600
579 $ hg log --removed -v -r0:2 a
601 $ hg log --removed -v -r0:2 a
580 changeset: 0:9161b9aeaf16
602 changeset: 0:9161b9aeaf16
581 user: test
603 user: test
582 date: Thu Jan 01 00:00:01 1970 +0000
604 date: Thu Jan 01 00:00:01 1970 +0000
583 files: a f
605 files: a f
584 description:
606 description:
585 a
607 a
586
608
587
609
588 $ cd ..
610 $ cd ..
589
611
590 log --follow tests
612 log --follow tests
591
613
592 $ hg init follow
614 $ hg init follow
593 $ cd follow
615 $ cd follow
594
616
595 $ echo base > base
617 $ echo base > base
596 $ hg ci -Ambase -d '1 0'
618 $ hg ci -Ambase -d '1 0'
597 adding base
619 adding base
598
620
599 $ echo r1 >> base
621 $ echo r1 >> base
600 $ hg ci -Amr1 -d '1 0'
622 $ hg ci -Amr1 -d '1 0'
601 $ echo r2 >> base
623 $ echo r2 >> base
602 $ hg ci -Amr2 -d '1 0'
624 $ hg ci -Amr2 -d '1 0'
603
625
604 $ hg up -C 1
626 $ hg up -C 1
605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
606 $ echo b1 > b1
628 $ echo b1 > b1
607 $ hg ci -Amb1 -d '1 0'
629 $ hg ci -Amb1 -d '1 0'
608 adding b1
630 adding b1
609 created new head
631 created new head
610
632
611
633
612 log -f
634 log -f
613
635
614 $ hg log -f
636 $ hg log -f
615 changeset: 3:e62f78d544b4
637 changeset: 3:e62f78d544b4
616 tag: tip
638 tag: tip
617 parent: 1:3d5bf5654eda
639 parent: 1:3d5bf5654eda
618 user: test
640 user: test
619 date: Thu Jan 01 00:00:01 1970 +0000
641 date: Thu Jan 01 00:00:01 1970 +0000
620 summary: b1
642 summary: b1
621
643
622 changeset: 1:3d5bf5654eda
644 changeset: 1:3d5bf5654eda
623 user: test
645 user: test
624 date: Thu Jan 01 00:00:01 1970 +0000
646 date: Thu Jan 01 00:00:01 1970 +0000
625 summary: r1
647 summary: r1
626
648
627 changeset: 0:67e992f2c4f3
649 changeset: 0:67e992f2c4f3
628 user: test
650 user: test
629 date: Thu Jan 01 00:00:01 1970 +0000
651 date: Thu Jan 01 00:00:01 1970 +0000
630 summary: base
652 summary: base
631
653
632
654
633
655
634 log -f -r '1 + 4'
656 log -f -r '1 + 4'
635
657
636 $ hg up -C 0
658 $ hg up -C 0
637 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
659 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
638 $ echo b2 > b2
660 $ echo b2 > b2
639 $ hg ci -Amb2 -d '1 0'
661 $ hg ci -Amb2 -d '1 0'
640 adding b2
662 adding b2
641 created new head
663 created new head
642 $ hg log -f -r '1 + 4'
664 $ hg log -f -r '1 + 4'
643 changeset: 4:ddb82e70d1a1
665 changeset: 4:ddb82e70d1a1
644 tag: tip
666 tag: tip
645 parent: 0:67e992f2c4f3
667 parent: 0:67e992f2c4f3
646 user: test
668 user: test
647 date: Thu Jan 01 00:00:01 1970 +0000
669 date: Thu Jan 01 00:00:01 1970 +0000
648 summary: b2
670 summary: b2
649
671
650 changeset: 1:3d5bf5654eda
672 changeset: 1:3d5bf5654eda
651 user: test
673 user: test
652 date: Thu Jan 01 00:00:01 1970 +0000
674 date: Thu Jan 01 00:00:01 1970 +0000
653 summary: r1
675 summary: r1
654
676
655 changeset: 0:67e992f2c4f3
677 changeset: 0:67e992f2c4f3
656 user: test
678 user: test
657 date: Thu Jan 01 00:00:01 1970 +0000
679 date: Thu Jan 01 00:00:01 1970 +0000
658 summary: base
680 summary: base
659
681
660 log -f -r null
682 log -f -r null
661
683
662 $ hg log -f -r null
684 $ hg log -f -r null
663 changeset: -1:000000000000
685 changeset: -1:000000000000
664 user:
686 user:
665 date: Thu Jan 01 00:00:00 1970 +0000
687 date: Thu Jan 01 00:00:00 1970 +0000
666
688
667 $ hg log -f -r null -G
689 $ hg log -f -r null -G
668 o changeset: -1:000000000000
690 o changeset: -1:000000000000
669 user:
691 user:
670 date: Thu Jan 01 00:00:00 1970 +0000
692 date: Thu Jan 01 00:00:00 1970 +0000
671
693
672
694
673
695
674 log -f with null parent
696 log -f with null parent
675
697
676 $ hg up -C null
698 $ hg up -C null
677 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
699 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
678 $ hg log -f
700 $ hg log -f
679
701
680
702
681 log -r . with two parents
703 log -r . with two parents
682
704
683 $ hg up -C 3
705 $ hg up -C 3
684 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
706 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
685 $ hg merge tip
707 $ hg merge tip
686 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
708 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
687 (branch merge, don't forget to commit)
709 (branch merge, don't forget to commit)
688 $ hg log -r .
710 $ hg log -r .
689 changeset: 3:e62f78d544b4
711 changeset: 3:e62f78d544b4
690 parent: 1:3d5bf5654eda
712 parent: 1:3d5bf5654eda
691 user: test
713 user: test
692 date: Thu Jan 01 00:00:01 1970 +0000
714 date: Thu Jan 01 00:00:01 1970 +0000
693 summary: b1
715 summary: b1
694
716
695
717
696
718
697 log -r . with one parent
719 log -r . with one parent
698
720
699 $ hg ci -mm12 -d '1 0'
721 $ hg ci -mm12 -d '1 0'
700 $ hg log -r .
722 $ hg log -r .
701 changeset: 5:302e9dd6890d
723 changeset: 5:302e9dd6890d
702 tag: tip
724 tag: tip
703 parent: 3:e62f78d544b4
725 parent: 3:e62f78d544b4
704 parent: 4:ddb82e70d1a1
726 parent: 4:ddb82e70d1a1
705 user: test
727 user: test
706 date: Thu Jan 01 00:00:01 1970 +0000
728 date: Thu Jan 01 00:00:01 1970 +0000
707 summary: m12
729 summary: m12
708
730
709
731
710 $ echo postm >> b1
732 $ echo postm >> b1
711 $ hg ci -Amb1.1 -d'1 0'
733 $ hg ci -Amb1.1 -d'1 0'
712
734
713
735
714 log --follow-first
736 log --follow-first
715
737
716 $ hg log --follow-first
738 $ hg log --follow-first
717 changeset: 6:2404bbcab562
739 changeset: 6:2404bbcab562
718 tag: tip
740 tag: tip
719 user: test
741 user: test
720 date: Thu Jan 01 00:00:01 1970 +0000
742 date: Thu Jan 01 00:00:01 1970 +0000
721 summary: b1.1
743 summary: b1.1
722
744
723 changeset: 5:302e9dd6890d
745 changeset: 5:302e9dd6890d
724 parent: 3:e62f78d544b4
746 parent: 3:e62f78d544b4
725 parent: 4:ddb82e70d1a1
747 parent: 4:ddb82e70d1a1
726 user: test
748 user: test
727 date: Thu Jan 01 00:00:01 1970 +0000
749 date: Thu Jan 01 00:00:01 1970 +0000
728 summary: m12
750 summary: m12
729
751
730 changeset: 3:e62f78d544b4
752 changeset: 3:e62f78d544b4
731 parent: 1:3d5bf5654eda
753 parent: 1:3d5bf5654eda
732 user: test
754 user: test
733 date: Thu Jan 01 00:00:01 1970 +0000
755 date: Thu Jan 01 00:00:01 1970 +0000
734 summary: b1
756 summary: b1
735
757
736 changeset: 1:3d5bf5654eda
758 changeset: 1:3d5bf5654eda
737 user: test
759 user: test
738 date: Thu Jan 01 00:00:01 1970 +0000
760 date: Thu Jan 01 00:00:01 1970 +0000
739 summary: r1
761 summary: r1
740
762
741 changeset: 0:67e992f2c4f3
763 changeset: 0:67e992f2c4f3
742 user: test
764 user: test
743 date: Thu Jan 01 00:00:01 1970 +0000
765 date: Thu Jan 01 00:00:01 1970 +0000
744 summary: base
766 summary: base
745
767
746
768
747
769
748 log -P 2
770 log -P 2
749
771
750 $ hg log -P 2
772 $ hg log -P 2
751 changeset: 6:2404bbcab562
773 changeset: 6:2404bbcab562
752 tag: tip
774 tag: tip
753 user: test
775 user: test
754 date: Thu Jan 01 00:00:01 1970 +0000
776 date: Thu Jan 01 00:00:01 1970 +0000
755 summary: b1.1
777 summary: b1.1
756
778
757 changeset: 5:302e9dd6890d
779 changeset: 5:302e9dd6890d
758 parent: 3:e62f78d544b4
780 parent: 3:e62f78d544b4
759 parent: 4:ddb82e70d1a1
781 parent: 4:ddb82e70d1a1
760 user: test
782 user: test
761 date: Thu Jan 01 00:00:01 1970 +0000
783 date: Thu Jan 01 00:00:01 1970 +0000
762 summary: m12
784 summary: m12
763
785
764 changeset: 4:ddb82e70d1a1
786 changeset: 4:ddb82e70d1a1
765 parent: 0:67e992f2c4f3
787 parent: 0:67e992f2c4f3
766 user: test
788 user: test
767 date: Thu Jan 01 00:00:01 1970 +0000
789 date: Thu Jan 01 00:00:01 1970 +0000
768 summary: b2
790 summary: b2
769
791
770 changeset: 3:e62f78d544b4
792 changeset: 3:e62f78d544b4
771 parent: 1:3d5bf5654eda
793 parent: 1:3d5bf5654eda
772 user: test
794 user: test
773 date: Thu Jan 01 00:00:01 1970 +0000
795 date: Thu Jan 01 00:00:01 1970 +0000
774 summary: b1
796 summary: b1
775
797
776
798
777
799
778 log -r tip -p --git
800 log -r tip -p --git
779
801
780 $ hg log -r tip -p --git
802 $ hg log -r tip -p --git
781 changeset: 6:2404bbcab562
803 changeset: 6:2404bbcab562
782 tag: tip
804 tag: tip
783 user: test
805 user: test
784 date: Thu Jan 01 00:00:01 1970 +0000
806 date: Thu Jan 01 00:00:01 1970 +0000
785 summary: b1.1
807 summary: b1.1
786
808
787 diff --git a/b1 b/b1
809 diff --git a/b1 b/b1
788 --- a/b1
810 --- a/b1
789 +++ b/b1
811 +++ b/b1
790 @@ -1,1 +1,2 @@
812 @@ -1,1 +1,2 @@
791 b1
813 b1
792 +postm
814 +postm
793
815
794
816
795
817
796 log -r ""
818 log -r ""
797
819
798 $ hg log -r ''
820 $ hg log -r ''
799 hg: parse error: empty query
821 hg: parse error: empty query
800 [255]
822 [255]
801
823
802 log -r <some unknown node id>
824 log -r <some unknown node id>
803
825
804 $ hg log -r 1000000000000000000000000000000000000000
826 $ hg log -r 1000000000000000000000000000000000000000
805 abort: unknown revision '1000000000000000000000000000000000000000'!
827 abort: unknown revision '1000000000000000000000000000000000000000'!
806 [255]
828 [255]
807
829
808 log -k r1
830 log -k r1
809
831
810 $ hg log -k r1
832 $ hg log -k r1
811 changeset: 1:3d5bf5654eda
833 changeset: 1:3d5bf5654eda
812 user: test
834 user: test
813 date: Thu Jan 01 00:00:01 1970 +0000
835 date: Thu Jan 01 00:00:01 1970 +0000
814 summary: r1
836 summary: r1
815
837
816 log -p -l2 --color=always
838 log -p -l2 --color=always
817
839
818 $ hg --config extensions.color= --config color.mode=ansi \
840 $ hg --config extensions.color= --config color.mode=ansi \
819 > log -p -l2 --color=always
841 > log -p -l2 --color=always
820 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
842 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
821 tag: tip
843 tag: tip
822 user: test
844 user: test
823 date: Thu Jan 01 00:00:01 1970 +0000
845 date: Thu Jan 01 00:00:01 1970 +0000
824 summary: b1.1
846 summary: b1.1
825
847
826 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
848 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
827 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
849 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
828 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
850 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
829 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
851 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
830 b1
852 b1
831 \x1b[0;32m+postm\x1b[0m (esc)
853 \x1b[0;32m+postm\x1b[0m (esc)
832
854
833 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
855 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
834 parent: 3:e62f78d544b4
856 parent: 3:e62f78d544b4
835 parent: 4:ddb82e70d1a1
857 parent: 4:ddb82e70d1a1
836 user: test
858 user: test
837 date: Thu Jan 01 00:00:01 1970 +0000
859 date: Thu Jan 01 00:00:01 1970 +0000
838 summary: m12
860 summary: m12
839
861
840 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
862 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
841 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
863 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
842 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
864 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
843 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
865 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
844 \x1b[0;32m+b2\x1b[0m (esc)
866 \x1b[0;32m+b2\x1b[0m (esc)
845
867
846
868
847
869
848 log -r tip --stat
870 log -r tip --stat
849
871
850 $ hg log -r tip --stat
872 $ hg log -r tip --stat
851 changeset: 6:2404bbcab562
873 changeset: 6:2404bbcab562
852 tag: tip
874 tag: tip
853 user: test
875 user: test
854 date: Thu Jan 01 00:00:01 1970 +0000
876 date: Thu Jan 01 00:00:01 1970 +0000
855 summary: b1.1
877 summary: b1.1
856
878
857 b1 | 1 +
879 b1 | 1 +
858 1 files changed, 1 insertions(+), 0 deletions(-)
880 1 files changed, 1 insertions(+), 0 deletions(-)
859
881
860
882
861 $ cd ..
883 $ cd ..
862
884
863
885
864 User
886 User
865
887
866 $ hg init usertest
888 $ hg init usertest
867 $ cd usertest
889 $ cd usertest
868
890
869 $ echo a > a
891 $ echo a > a
870 $ hg ci -A -m "a" -u "User One <user1@example.org>"
892 $ hg ci -A -m "a" -u "User One <user1@example.org>"
871 adding a
893 adding a
872 $ echo b > b
894 $ echo b > b
873 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
895 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
874 adding b
896 adding b
875
897
876 $ hg log -u "User One <user1@example.org>"
898 $ hg log -u "User One <user1@example.org>"
877 changeset: 0:29a4c94f1924
899 changeset: 0:29a4c94f1924
878 user: User One <user1@example.org>
900 user: User One <user1@example.org>
879 date: Thu Jan 01 00:00:00 1970 +0000
901 date: Thu Jan 01 00:00:00 1970 +0000
880 summary: a
902 summary: a
881
903
882 $ hg log -u "user1" -u "user2"
904 $ hg log -u "user1" -u "user2"
883 changeset: 1:e834b5e69c0e
905 changeset: 1:e834b5e69c0e
884 tag: tip
906 tag: tip
885 user: User Two <user2@example.org>
907 user: User Two <user2@example.org>
886 date: Thu Jan 01 00:00:00 1970 +0000
908 date: Thu Jan 01 00:00:00 1970 +0000
887 summary: b
909 summary: b
888
910
889 changeset: 0:29a4c94f1924
911 changeset: 0:29a4c94f1924
890 user: User One <user1@example.org>
912 user: User One <user1@example.org>
891 date: Thu Jan 01 00:00:00 1970 +0000
913 date: Thu Jan 01 00:00:00 1970 +0000
892 summary: a
914 summary: a
893
915
894 $ hg log -u "user3"
916 $ hg log -u "user3"
895
917
896 $ cd ..
918 $ cd ..
897
919
898 $ hg init branches
920 $ hg init branches
899 $ cd branches
921 $ cd branches
900
922
901 $ echo a > a
923 $ echo a > a
902 $ hg ci -A -m "commit on default"
924 $ hg ci -A -m "commit on default"
903 adding a
925 adding a
904 $ hg branch test
926 $ hg branch test
905 marked working directory as branch test
927 marked working directory as branch test
906 (branches are permanent and global, did you want a bookmark?)
928 (branches are permanent and global, did you want a bookmark?)
907 $ echo b > b
929 $ echo b > b
908 $ hg ci -A -m "commit on test"
930 $ hg ci -A -m "commit on test"
909 adding b
931 adding b
910
932
911 $ hg up default
933 $ hg up default
912 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
934 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
913 $ echo c > c
935 $ echo c > c
914 $ hg ci -A -m "commit on default"
936 $ hg ci -A -m "commit on default"
915 adding c
937 adding c
916 $ hg up test
938 $ hg up test
917 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
939 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
918 $ echo c > c
940 $ echo c > c
919 $ hg ci -A -m "commit on test"
941 $ hg ci -A -m "commit on test"
920 adding c
942 adding c
921
943
922
944
923 log -b default
945 log -b default
924
946
925 $ hg log -b default
947 $ hg log -b default
926 changeset: 2:c3a4f03cc9a7
948 changeset: 2:c3a4f03cc9a7
927 parent: 0:24427303d56f
949 parent: 0:24427303d56f
928 user: test
950 user: test
929 date: Thu Jan 01 00:00:00 1970 +0000
951 date: Thu Jan 01 00:00:00 1970 +0000
930 summary: commit on default
952 summary: commit on default
931
953
932 changeset: 0:24427303d56f
954 changeset: 0:24427303d56f
933 user: test
955 user: test
934 date: Thu Jan 01 00:00:00 1970 +0000
956 date: Thu Jan 01 00:00:00 1970 +0000
935 summary: commit on default
957 summary: commit on default
936
958
937
959
938
960
939 log -b test
961 log -b test
940
962
941 $ hg log -b test
963 $ hg log -b test
942 changeset: 3:f5d8de11c2e2
964 changeset: 3:f5d8de11c2e2
943 branch: test
965 branch: test
944 tag: tip
966 tag: tip
945 parent: 1:d32277701ccb
967 parent: 1:d32277701ccb
946 user: test
968 user: test
947 date: Thu Jan 01 00:00:00 1970 +0000
969 date: Thu Jan 01 00:00:00 1970 +0000
948 summary: commit on test
970 summary: commit on test
949
971
950 changeset: 1:d32277701ccb
972 changeset: 1:d32277701ccb
951 branch: test
973 branch: test
952 user: test
974 user: test
953 date: Thu Jan 01 00:00:00 1970 +0000
975 date: Thu Jan 01 00:00:00 1970 +0000
954 summary: commit on test
976 summary: commit on test
955
977
956
978
957
979
958 log -b dummy
980 log -b dummy
959
981
960 $ hg log -b dummy
982 $ hg log -b dummy
961 abort: unknown revision 'dummy'!
983 abort: unknown revision 'dummy'!
962 [255]
984 [255]
963
985
964
986
965 log -b .
987 log -b .
966
988
967 $ hg log -b .
989 $ hg log -b .
968 changeset: 3:f5d8de11c2e2
990 changeset: 3:f5d8de11c2e2
969 branch: test
991 branch: test
970 tag: tip
992 tag: tip
971 parent: 1:d32277701ccb
993 parent: 1:d32277701ccb
972 user: test
994 user: test
973 date: Thu Jan 01 00:00:00 1970 +0000
995 date: Thu Jan 01 00:00:00 1970 +0000
974 summary: commit on test
996 summary: commit on test
975
997
976 changeset: 1:d32277701ccb
998 changeset: 1:d32277701ccb
977 branch: test
999 branch: test
978 user: test
1000 user: test
979 date: Thu Jan 01 00:00:00 1970 +0000
1001 date: Thu Jan 01 00:00:00 1970 +0000
980 summary: commit on test
1002 summary: commit on test
981
1003
982
1004
983
1005
984 log -b default -b test
1006 log -b default -b test
985
1007
986 $ hg log -b default -b test
1008 $ hg log -b default -b test
987 changeset: 3:f5d8de11c2e2
1009 changeset: 3:f5d8de11c2e2
988 branch: test
1010 branch: test
989 tag: tip
1011 tag: tip
990 parent: 1:d32277701ccb
1012 parent: 1:d32277701ccb
991 user: test
1013 user: test
992 date: Thu Jan 01 00:00:00 1970 +0000
1014 date: Thu Jan 01 00:00:00 1970 +0000
993 summary: commit on test
1015 summary: commit on test
994
1016
995 changeset: 2:c3a4f03cc9a7
1017 changeset: 2:c3a4f03cc9a7
996 parent: 0:24427303d56f
1018 parent: 0:24427303d56f
997 user: test
1019 user: test
998 date: Thu Jan 01 00:00:00 1970 +0000
1020 date: Thu Jan 01 00:00:00 1970 +0000
999 summary: commit on default
1021 summary: commit on default
1000
1022
1001 changeset: 1:d32277701ccb
1023 changeset: 1:d32277701ccb
1002 branch: test
1024 branch: test
1003 user: test
1025 user: test
1004 date: Thu Jan 01 00:00:00 1970 +0000
1026 date: Thu Jan 01 00:00:00 1970 +0000
1005 summary: commit on test
1027 summary: commit on test
1006
1028
1007 changeset: 0:24427303d56f
1029 changeset: 0:24427303d56f
1008 user: test
1030 user: test
1009 date: Thu Jan 01 00:00:00 1970 +0000
1031 date: Thu Jan 01 00:00:00 1970 +0000
1010 summary: commit on default
1032 summary: commit on default
1011
1033
1012
1034
1013
1035
1014 log -b default -b .
1036 log -b default -b .
1015
1037
1016 $ hg log -b default -b .
1038 $ hg log -b default -b .
1017 changeset: 3:f5d8de11c2e2
1039 changeset: 3:f5d8de11c2e2
1018 branch: test
1040 branch: test
1019 tag: tip
1041 tag: tip
1020 parent: 1:d32277701ccb
1042 parent: 1:d32277701ccb
1021 user: test
1043 user: test
1022 date: Thu Jan 01 00:00:00 1970 +0000
1044 date: Thu Jan 01 00:00:00 1970 +0000
1023 summary: commit on test
1045 summary: commit on test
1024
1046
1025 changeset: 2:c3a4f03cc9a7
1047 changeset: 2:c3a4f03cc9a7
1026 parent: 0:24427303d56f
1048 parent: 0:24427303d56f
1027 user: test
1049 user: test
1028 date: Thu Jan 01 00:00:00 1970 +0000
1050 date: Thu Jan 01 00:00:00 1970 +0000
1029 summary: commit on default
1051 summary: commit on default
1030
1052
1031 changeset: 1:d32277701ccb
1053 changeset: 1:d32277701ccb
1032 branch: test
1054 branch: test
1033 user: test
1055 user: test
1034 date: Thu Jan 01 00:00:00 1970 +0000
1056 date: Thu Jan 01 00:00:00 1970 +0000
1035 summary: commit on test
1057 summary: commit on test
1036
1058
1037 changeset: 0:24427303d56f
1059 changeset: 0:24427303d56f
1038 user: test
1060 user: test
1039 date: Thu Jan 01 00:00:00 1970 +0000
1061 date: Thu Jan 01 00:00:00 1970 +0000
1040 summary: commit on default
1062 summary: commit on default
1041
1063
1042
1064
1043
1065
1044 log -b . -b test
1066 log -b . -b test
1045
1067
1046 $ hg log -b . -b test
1068 $ hg log -b . -b test
1047 changeset: 3:f5d8de11c2e2
1069 changeset: 3:f5d8de11c2e2
1048 branch: test
1070 branch: test
1049 tag: tip
1071 tag: tip
1050 parent: 1:d32277701ccb
1072 parent: 1:d32277701ccb
1051 user: test
1073 user: test
1052 date: Thu Jan 01 00:00:00 1970 +0000
1074 date: Thu Jan 01 00:00:00 1970 +0000
1053 summary: commit on test
1075 summary: commit on test
1054
1076
1055 changeset: 1:d32277701ccb
1077 changeset: 1:d32277701ccb
1056 branch: test
1078 branch: test
1057 user: test
1079 user: test
1058 date: Thu Jan 01 00:00:00 1970 +0000
1080 date: Thu Jan 01 00:00:00 1970 +0000
1059 summary: commit on test
1081 summary: commit on test
1060
1082
1061
1083
1062
1084
1063 log -b 2
1085 log -b 2
1064
1086
1065 $ hg log -b 2
1087 $ hg log -b 2
1066 changeset: 2:c3a4f03cc9a7
1088 changeset: 2:c3a4f03cc9a7
1067 parent: 0:24427303d56f
1089 parent: 0:24427303d56f
1068 user: test
1090 user: test
1069 date: Thu Jan 01 00:00:00 1970 +0000
1091 date: Thu Jan 01 00:00:00 1970 +0000
1070 summary: commit on default
1092 summary: commit on default
1071
1093
1072 changeset: 0:24427303d56f
1094 changeset: 0:24427303d56f
1073 user: test
1095 user: test
1074 date: Thu Jan 01 00:00:00 1970 +0000
1096 date: Thu Jan 01 00:00:00 1970 +0000
1075 summary: commit on default
1097 summary: commit on default
1076
1098
1077 #if gettext
1099 #if gettext
1078
1100
1079 Test that all log names are translated (e.g. branches, bookmarks, tags):
1101 Test that all log names are translated (e.g. branches, bookmarks, tags):
1080
1102
1081 $ hg bookmark babar -r tip
1103 $ hg bookmark babar -r tip
1082
1104
1083 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1105 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1084 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1106 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1085 Zweig: test
1107 Zweig: test
1086 Lesezeichen: babar
1108 Lesezeichen: babar
1087 Marke: tip
1109 Marke: tip
1088 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1110 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1089 Nutzer: test
1111 Nutzer: test
1090 Datum: Thu Jan 01 00:00:00 1970 +0000
1112 Datum: Thu Jan 01 00:00:00 1970 +0000
1091 Zusammenfassung: commit on test
1113 Zusammenfassung: commit on test
1092
1114
1093 $ hg bookmark -d babar
1115 $ hg bookmark -d babar
1094
1116
1095 #endif
1117 #endif
1096
1118
1097 log -p --cwd dir (in subdir)
1119 log -p --cwd dir (in subdir)
1098
1120
1099 $ mkdir dir
1121 $ mkdir dir
1100 $ hg log -p --cwd dir
1122 $ hg log -p --cwd dir
1101 changeset: 3:f5d8de11c2e2
1123 changeset: 3:f5d8de11c2e2
1102 branch: test
1124 branch: test
1103 tag: tip
1125 tag: tip
1104 parent: 1:d32277701ccb
1126 parent: 1:d32277701ccb
1105 user: test
1127 user: test
1106 date: Thu Jan 01 00:00:00 1970 +0000
1128 date: Thu Jan 01 00:00:00 1970 +0000
1107 summary: commit on test
1129 summary: commit on test
1108
1130
1109 diff -r d32277701ccb -r f5d8de11c2e2 c
1131 diff -r d32277701ccb -r f5d8de11c2e2 c
1110 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1132 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1111 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1133 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1112 @@ -0,0 +1,1 @@
1134 @@ -0,0 +1,1 @@
1113 +c
1135 +c
1114
1136
1115 changeset: 2:c3a4f03cc9a7
1137 changeset: 2:c3a4f03cc9a7
1116 parent: 0:24427303d56f
1138 parent: 0:24427303d56f
1117 user: test
1139 user: test
1118 date: Thu Jan 01 00:00:00 1970 +0000
1140 date: Thu Jan 01 00:00:00 1970 +0000
1119 summary: commit on default
1141 summary: commit on default
1120
1142
1121 diff -r 24427303d56f -r c3a4f03cc9a7 c
1143 diff -r 24427303d56f -r c3a4f03cc9a7 c
1122 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1144 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1123 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1145 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1124 @@ -0,0 +1,1 @@
1146 @@ -0,0 +1,1 @@
1125 +c
1147 +c
1126
1148
1127 changeset: 1:d32277701ccb
1149 changeset: 1:d32277701ccb
1128 branch: test
1150 branch: test
1129 user: test
1151 user: test
1130 date: Thu Jan 01 00:00:00 1970 +0000
1152 date: Thu Jan 01 00:00:00 1970 +0000
1131 summary: commit on test
1153 summary: commit on test
1132
1154
1133 diff -r 24427303d56f -r d32277701ccb b
1155 diff -r 24427303d56f -r d32277701ccb b
1134 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1156 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1135 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1157 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1136 @@ -0,0 +1,1 @@
1158 @@ -0,0 +1,1 @@
1137 +b
1159 +b
1138
1160
1139 changeset: 0:24427303d56f
1161 changeset: 0:24427303d56f
1140 user: test
1162 user: test
1141 date: Thu Jan 01 00:00:00 1970 +0000
1163 date: Thu Jan 01 00:00:00 1970 +0000
1142 summary: commit on default
1164 summary: commit on default
1143
1165
1144 diff -r 000000000000 -r 24427303d56f a
1166 diff -r 000000000000 -r 24427303d56f a
1145 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1167 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1146 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1168 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1147 @@ -0,0 +1,1 @@
1169 @@ -0,0 +1,1 @@
1148 +a
1170 +a
1149
1171
1150
1172
1151
1173
1152 log -p -R repo
1174 log -p -R repo
1153
1175
1154 $ cd dir
1176 $ cd dir
1155 $ hg log -p -R .. ../a
1177 $ hg log -p -R .. ../a
1156 changeset: 0:24427303d56f
1178 changeset: 0:24427303d56f
1157 user: test
1179 user: test
1158 date: Thu Jan 01 00:00:00 1970 +0000
1180 date: Thu Jan 01 00:00:00 1970 +0000
1159 summary: commit on default
1181 summary: commit on default
1160
1182
1161 diff -r 000000000000 -r 24427303d56f a
1183 diff -r 000000000000 -r 24427303d56f a
1162 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1184 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1163 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1185 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1164 @@ -0,0 +1,1 @@
1186 @@ -0,0 +1,1 @@
1165 +a
1187 +a
1166
1188
1167
1189
1168 $ cd ../..
1190 $ cd ../..
1169
1191
1170 $ hg init follow2
1192 $ hg init follow2
1171 $ cd follow2
1193 $ cd follow2
1172
1194
1173 # Build the following history:
1195 # Build the following history:
1174 # tip - o - x - o - x - x
1196 # tip - o - x - o - x - x
1175 # \ /
1197 # \ /
1176 # o - o - o - x
1198 # o - o - o - x
1177 # \ /
1199 # \ /
1178 # o
1200 # o
1179 #
1201 #
1180 # Where "o" is a revision containing "foo" and
1202 # Where "o" is a revision containing "foo" and
1181 # "x" is a revision without "foo"
1203 # "x" is a revision without "foo"
1182
1204
1183 $ touch init
1205 $ touch init
1184 $ hg ci -A -m "init, unrelated"
1206 $ hg ci -A -m "init, unrelated"
1185 adding init
1207 adding init
1186 $ echo 'foo' > init
1208 $ echo 'foo' > init
1187 $ hg ci -m "change, unrelated"
1209 $ hg ci -m "change, unrelated"
1188 $ echo 'foo' > foo
1210 $ echo 'foo' > foo
1189 $ hg ci -A -m "add unrelated old foo"
1211 $ hg ci -A -m "add unrelated old foo"
1190 adding foo
1212 adding foo
1191 $ hg rm foo
1213 $ hg rm foo
1192 $ hg ci -m "delete foo, unrelated"
1214 $ hg ci -m "delete foo, unrelated"
1193 $ echo 'related' > foo
1215 $ echo 'related' > foo
1194 $ hg ci -A -m "add foo, related"
1216 $ hg ci -A -m "add foo, related"
1195 adding foo
1217 adding foo
1196
1218
1197 $ hg up 0
1219 $ hg up 0
1198 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1220 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1199 $ touch branch
1221 $ touch branch
1200 $ hg ci -A -m "first branch, unrelated"
1222 $ hg ci -A -m "first branch, unrelated"
1201 adding branch
1223 adding branch
1202 created new head
1224 created new head
1203 $ touch foo
1225 $ touch foo
1204 $ hg ci -A -m "create foo, related"
1226 $ hg ci -A -m "create foo, related"
1205 adding foo
1227 adding foo
1206 $ echo 'change' > foo
1228 $ echo 'change' > foo
1207 $ hg ci -m "change foo, related"
1229 $ hg ci -m "change foo, related"
1208
1230
1209 $ hg up 6
1231 $ hg up 6
1210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1211 $ echo 'change foo in branch' > foo
1233 $ echo 'change foo in branch' > foo
1212 $ hg ci -m "change foo in branch, related"
1234 $ hg ci -m "change foo in branch, related"
1213 created new head
1235 created new head
1214 $ hg merge 7
1236 $ hg merge 7
1215 merging foo
1237 merging foo
1216 warning: conflicts during merge.
1238 warning: conflicts during merge.
1217 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1239 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1218 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1240 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1219 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1241 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1220 [1]
1242 [1]
1221 $ echo 'merge 1' > foo
1243 $ echo 'merge 1' > foo
1222 $ hg resolve -m foo
1244 $ hg resolve -m foo
1223 (no more unresolved files)
1245 (no more unresolved files)
1224 $ hg ci -m "First merge, related"
1246 $ hg ci -m "First merge, related"
1225
1247
1226 $ hg merge 4
1248 $ hg merge 4
1227 merging foo
1249 merging foo
1228 warning: conflicts during merge.
1250 warning: conflicts during merge.
1229 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1251 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
1230 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1252 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1231 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1253 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1232 [1]
1254 [1]
1233 $ echo 'merge 2' > foo
1255 $ echo 'merge 2' > foo
1234 $ hg resolve -m foo
1256 $ hg resolve -m foo
1235 (no more unresolved files)
1257 (no more unresolved files)
1236 $ hg ci -m "Last merge, related"
1258 $ hg ci -m "Last merge, related"
1237
1259
1238 $ hg log --graph
1260 $ hg log --graph
1239 @ changeset: 10:4dae8563d2c5
1261 @ changeset: 10:4dae8563d2c5
1240 |\ tag: tip
1262 |\ tag: tip
1241 | | parent: 9:7b35701b003e
1263 | | parent: 9:7b35701b003e
1242 | | parent: 4:88176d361b69
1264 | | parent: 4:88176d361b69
1243 | | user: test
1265 | | user: test
1244 | | date: Thu Jan 01 00:00:00 1970 +0000
1266 | | date: Thu Jan 01 00:00:00 1970 +0000
1245 | | summary: Last merge, related
1267 | | summary: Last merge, related
1246 | |
1268 | |
1247 | o changeset: 9:7b35701b003e
1269 | o changeset: 9:7b35701b003e
1248 | |\ parent: 8:e5416ad8a855
1270 | |\ parent: 8:e5416ad8a855
1249 | | | parent: 7:87fe3144dcfa
1271 | | | parent: 7:87fe3144dcfa
1250 | | | user: test
1272 | | | user: test
1251 | | | date: Thu Jan 01 00:00:00 1970 +0000
1273 | | | date: Thu Jan 01 00:00:00 1970 +0000
1252 | | | summary: First merge, related
1274 | | | summary: First merge, related
1253 | | |
1275 | | |
1254 | | o changeset: 8:e5416ad8a855
1276 | | o changeset: 8:e5416ad8a855
1255 | | | parent: 6:dc6c325fe5ee
1277 | | | parent: 6:dc6c325fe5ee
1256 | | | user: test
1278 | | | user: test
1257 | | | date: Thu Jan 01 00:00:00 1970 +0000
1279 | | | date: Thu Jan 01 00:00:00 1970 +0000
1258 | | | summary: change foo in branch, related
1280 | | | summary: change foo in branch, related
1259 | | |
1281 | | |
1260 | o | changeset: 7:87fe3144dcfa
1282 | o | changeset: 7:87fe3144dcfa
1261 | |/ user: test
1283 | |/ user: test
1262 | | date: Thu Jan 01 00:00:00 1970 +0000
1284 | | date: Thu Jan 01 00:00:00 1970 +0000
1263 | | summary: change foo, related
1285 | | summary: change foo, related
1264 | |
1286 | |
1265 | o changeset: 6:dc6c325fe5ee
1287 | o changeset: 6:dc6c325fe5ee
1266 | | user: test
1288 | | user: test
1267 | | date: Thu Jan 01 00:00:00 1970 +0000
1289 | | date: Thu Jan 01 00:00:00 1970 +0000
1268 | | summary: create foo, related
1290 | | summary: create foo, related
1269 | |
1291 | |
1270 | o changeset: 5:73db34516eb9
1292 | o changeset: 5:73db34516eb9
1271 | | parent: 0:e87515fd044a
1293 | | parent: 0:e87515fd044a
1272 | | user: test
1294 | | user: test
1273 | | date: Thu Jan 01 00:00:00 1970 +0000
1295 | | date: Thu Jan 01 00:00:00 1970 +0000
1274 | | summary: first branch, unrelated
1296 | | summary: first branch, unrelated
1275 | |
1297 | |
1276 o | changeset: 4:88176d361b69
1298 o | changeset: 4:88176d361b69
1277 | | user: test
1299 | | user: test
1278 | | date: Thu Jan 01 00:00:00 1970 +0000
1300 | | date: Thu Jan 01 00:00:00 1970 +0000
1279 | | summary: add foo, related
1301 | | summary: add foo, related
1280 | |
1302 | |
1281 o | changeset: 3:dd78ae4afb56
1303 o | changeset: 3:dd78ae4afb56
1282 | | user: test
1304 | | user: test
1283 | | date: Thu Jan 01 00:00:00 1970 +0000
1305 | | date: Thu Jan 01 00:00:00 1970 +0000
1284 | | summary: delete foo, unrelated
1306 | | summary: delete foo, unrelated
1285 | |
1307 | |
1286 o | changeset: 2:c4c64aedf0f7
1308 o | changeset: 2:c4c64aedf0f7
1287 | | user: test
1309 | | user: test
1288 | | date: Thu Jan 01 00:00:00 1970 +0000
1310 | | date: Thu Jan 01 00:00:00 1970 +0000
1289 | | summary: add unrelated old foo
1311 | | summary: add unrelated old foo
1290 | |
1312 | |
1291 o | changeset: 1:e5faa7440653
1313 o | changeset: 1:e5faa7440653
1292 |/ user: test
1314 |/ user: test
1293 | date: Thu Jan 01 00:00:00 1970 +0000
1315 | date: Thu Jan 01 00:00:00 1970 +0000
1294 | summary: change, unrelated
1316 | summary: change, unrelated
1295 |
1317 |
1296 o changeset: 0:e87515fd044a
1318 o changeset: 0:e87515fd044a
1297 user: test
1319 user: test
1298 date: Thu Jan 01 00:00:00 1970 +0000
1320 date: Thu Jan 01 00:00:00 1970 +0000
1299 summary: init, unrelated
1321 summary: init, unrelated
1300
1322
1301
1323
1302 $ hg --traceback log -f foo
1324 $ hg --traceback log -f foo
1303 changeset: 10:4dae8563d2c5
1325 changeset: 10:4dae8563d2c5
1304 tag: tip
1326 tag: tip
1305 parent: 9:7b35701b003e
1327 parent: 9:7b35701b003e
1306 parent: 4:88176d361b69
1328 parent: 4:88176d361b69
1307 user: test
1329 user: test
1308 date: Thu Jan 01 00:00:00 1970 +0000
1330 date: Thu Jan 01 00:00:00 1970 +0000
1309 summary: Last merge, related
1331 summary: Last merge, related
1310
1332
1311 changeset: 9:7b35701b003e
1333 changeset: 9:7b35701b003e
1312 parent: 8:e5416ad8a855
1334 parent: 8:e5416ad8a855
1313 parent: 7:87fe3144dcfa
1335 parent: 7:87fe3144dcfa
1314 user: test
1336 user: test
1315 date: Thu Jan 01 00:00:00 1970 +0000
1337 date: Thu Jan 01 00:00:00 1970 +0000
1316 summary: First merge, related
1338 summary: First merge, related
1317
1339
1318 changeset: 8:e5416ad8a855
1340 changeset: 8:e5416ad8a855
1319 parent: 6:dc6c325fe5ee
1341 parent: 6:dc6c325fe5ee
1320 user: test
1342 user: test
1321 date: Thu Jan 01 00:00:00 1970 +0000
1343 date: Thu Jan 01 00:00:00 1970 +0000
1322 summary: change foo in branch, related
1344 summary: change foo in branch, related
1323
1345
1324 changeset: 7:87fe3144dcfa
1346 changeset: 7:87fe3144dcfa
1325 user: test
1347 user: test
1326 date: Thu Jan 01 00:00:00 1970 +0000
1348 date: Thu Jan 01 00:00:00 1970 +0000
1327 summary: change foo, related
1349 summary: change foo, related
1328
1350
1329 changeset: 6:dc6c325fe5ee
1351 changeset: 6:dc6c325fe5ee
1330 user: test
1352 user: test
1331 date: Thu Jan 01 00:00:00 1970 +0000
1353 date: Thu Jan 01 00:00:00 1970 +0000
1332 summary: create foo, related
1354 summary: create foo, related
1333
1355
1334 changeset: 4:88176d361b69
1356 changeset: 4:88176d361b69
1335 user: test
1357 user: test
1336 date: Thu Jan 01 00:00:00 1970 +0000
1358 date: Thu Jan 01 00:00:00 1970 +0000
1337 summary: add foo, related
1359 summary: add foo, related
1338
1360
1339
1361
1340 Also check when maxrev < lastrevfilelog
1362 Also check when maxrev < lastrevfilelog
1341
1363
1342 $ hg --traceback log -f -r4 foo
1364 $ hg --traceback log -f -r4 foo
1343 changeset: 4:88176d361b69
1365 changeset: 4:88176d361b69
1344 user: test
1366 user: test
1345 date: Thu Jan 01 00:00:00 1970 +0000
1367 date: Thu Jan 01 00:00:00 1970 +0000
1346 summary: add foo, related
1368 summary: add foo, related
1347
1369
1348 changeset: 2:c4c64aedf0f7
1370 changeset: 2:c4c64aedf0f7
1349 user: test
1371 user: test
1350 date: Thu Jan 01 00:00:00 1970 +0000
1372 date: Thu Jan 01 00:00:00 1970 +0000
1351 summary: add unrelated old foo
1373 summary: add unrelated old foo
1352
1374
1353 $ cd ..
1375 $ cd ..
1354
1376
1355 Issue2383: hg log showing _less_ differences than hg diff
1377 Issue2383: hg log showing _less_ differences than hg diff
1356
1378
1357 $ hg init issue2383
1379 $ hg init issue2383
1358 $ cd issue2383
1380 $ cd issue2383
1359
1381
1360 Create a test repo:
1382 Create a test repo:
1361
1383
1362 $ echo a > a
1384 $ echo a > a
1363 $ hg ci -Am0
1385 $ hg ci -Am0
1364 adding a
1386 adding a
1365 $ echo b > b
1387 $ echo b > b
1366 $ hg ci -Am1
1388 $ hg ci -Am1
1367 adding b
1389 adding b
1368 $ hg co 0
1390 $ hg co 0
1369 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1391 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1370 $ echo b > a
1392 $ echo b > a
1371 $ hg ci -m2
1393 $ hg ci -m2
1372 created new head
1394 created new head
1373
1395
1374 Merge:
1396 Merge:
1375
1397
1376 $ hg merge
1398 $ hg merge
1377 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1399 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1378 (branch merge, don't forget to commit)
1400 (branch merge, don't forget to commit)
1379
1401
1380 Make sure there's a file listed in the merge to trigger the bug:
1402 Make sure there's a file listed in the merge to trigger the bug:
1381
1403
1382 $ echo c > a
1404 $ echo c > a
1383 $ hg ci -m3
1405 $ hg ci -m3
1384
1406
1385 Two files shown here in diff:
1407 Two files shown here in diff:
1386
1408
1387 $ hg diff --rev 2:3
1409 $ hg diff --rev 2:3
1388 diff -r b09be438c43a -r 8e07aafe1edc a
1410 diff -r b09be438c43a -r 8e07aafe1edc a
1389 --- a/a Thu Jan 01 00:00:00 1970 +0000
1411 --- a/a Thu Jan 01 00:00:00 1970 +0000
1390 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1412 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1391 @@ -1,1 +1,1 @@
1413 @@ -1,1 +1,1 @@
1392 -b
1414 -b
1393 +c
1415 +c
1394 diff -r b09be438c43a -r 8e07aafe1edc b
1416 diff -r b09be438c43a -r 8e07aafe1edc b
1395 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1417 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1396 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1418 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1397 @@ -0,0 +1,1 @@
1419 @@ -0,0 +1,1 @@
1398 +b
1420 +b
1399
1421
1400 Diff here should be the same:
1422 Diff here should be the same:
1401
1423
1402 $ hg log -vpr 3
1424 $ hg log -vpr 3
1403 changeset: 3:8e07aafe1edc
1425 changeset: 3:8e07aafe1edc
1404 tag: tip
1426 tag: tip
1405 parent: 2:b09be438c43a
1427 parent: 2:b09be438c43a
1406 parent: 1:925d80f479bb
1428 parent: 1:925d80f479bb
1407 user: test
1429 user: test
1408 date: Thu Jan 01 00:00:00 1970 +0000
1430 date: Thu Jan 01 00:00:00 1970 +0000
1409 files: a
1431 files: a
1410 description:
1432 description:
1411 3
1433 3
1412
1434
1413
1435
1414 diff -r b09be438c43a -r 8e07aafe1edc a
1436 diff -r b09be438c43a -r 8e07aafe1edc a
1415 --- a/a Thu Jan 01 00:00:00 1970 +0000
1437 --- a/a Thu Jan 01 00:00:00 1970 +0000
1416 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1438 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1417 @@ -1,1 +1,1 @@
1439 @@ -1,1 +1,1 @@
1418 -b
1440 -b
1419 +c
1441 +c
1420 diff -r b09be438c43a -r 8e07aafe1edc b
1442 diff -r b09be438c43a -r 8e07aafe1edc b
1421 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1443 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1422 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1444 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1423 @@ -0,0 +1,1 @@
1445 @@ -0,0 +1,1 @@
1424 +b
1446 +b
1425
1447
1426 $ cd ..
1448 $ cd ..
1427
1449
1428 'hg log -r rev fn' when last(filelog(fn)) != rev
1450 'hg log -r rev fn' when last(filelog(fn)) != rev
1429
1451
1430 $ hg init simplelog
1452 $ hg init simplelog
1431 $ cd simplelog
1453 $ cd simplelog
1432 $ echo f > a
1454 $ echo f > a
1433 $ hg ci -Am'a' -d '0 0'
1455 $ hg ci -Am'a' -d '0 0'
1434 adding a
1456 adding a
1435 $ echo f >> a
1457 $ echo f >> a
1436 $ hg ci -Am'a bis' -d '1 0'
1458 $ hg ci -Am'a bis' -d '1 0'
1437
1459
1438 $ hg log -r0 a
1460 $ hg log -r0 a
1439 changeset: 0:9f758d63dcde
1461 changeset: 0:9f758d63dcde
1440 user: test
1462 user: test
1441 date: Thu Jan 01 00:00:00 1970 +0000
1463 date: Thu Jan 01 00:00:00 1970 +0000
1442 summary: a
1464 summary: a
1443
1465
1444 enable obsolete to test hidden feature
1466 enable obsolete to test hidden feature
1445
1467
1446 $ cat >> $HGRCPATH << EOF
1468 $ cat >> $HGRCPATH << EOF
1447 > [experimental]
1469 > [experimental]
1448 > evolution=createmarkers
1470 > evolution=createmarkers
1449 > EOF
1471 > EOF
1450
1472
1451 $ hg log --template='{rev}:{node}\n'
1473 $ hg log --template='{rev}:{node}\n'
1452 1:a765632148dc55d38c35c4f247c618701886cb2f
1474 1:a765632148dc55d38c35c4f247c618701886cb2f
1453 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1475 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1454 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1476 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1455 $ hg up null -q
1477 $ hg up null -q
1456 $ hg log --template='{rev}:{node}\n'
1478 $ hg log --template='{rev}:{node}\n'
1457 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1479 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1458 $ hg log --template='{rev}:{node}\n' --hidden
1480 $ hg log --template='{rev}:{node}\n' --hidden
1459 1:a765632148dc55d38c35c4f247c618701886cb2f
1481 1:a765632148dc55d38c35c4f247c618701886cb2f
1460 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1482 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1461 $ hg log -r a
1483 $ hg log -r a
1462 abort: hidden revision 'a'!
1484 abort: hidden revision 'a'!
1463 (use --hidden to access hidden revisions)
1485 (use --hidden to access hidden revisions)
1464 [255]
1486 [255]
1465
1487
1466 test that parent prevent a changeset to be hidden
1488 test that parent prevent a changeset to be hidden
1467
1489
1468 $ hg up 1 -q --hidden
1490 $ hg up 1 -q --hidden
1469 $ hg log --template='{rev}:{node}\n'
1491 $ hg log --template='{rev}:{node}\n'
1470 1:a765632148dc55d38c35c4f247c618701886cb2f
1492 1:a765632148dc55d38c35c4f247c618701886cb2f
1471 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1493 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1472
1494
1473 test that second parent prevent a changeset to be hidden too
1495 test that second parent prevent a changeset to be hidden too
1474
1496
1475 $ hg debugsetparents 0 1 # nothing suitable to merge here
1497 $ hg debugsetparents 0 1 # nothing suitable to merge here
1476 $ hg log --template='{rev}:{node}\n'
1498 $ hg log --template='{rev}:{node}\n'
1477 1:a765632148dc55d38c35c4f247c618701886cb2f
1499 1:a765632148dc55d38c35c4f247c618701886cb2f
1478 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1500 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1479 $ hg debugsetparents 1
1501 $ hg debugsetparents 1
1480 $ hg up -q null
1502 $ hg up -q null
1481
1503
1482 bookmarks prevent a changeset being hidden
1504 bookmarks prevent a changeset being hidden
1483
1505
1484 $ hg bookmark --hidden -r 1 X
1506 $ hg bookmark --hidden -r 1 X
1485 $ hg log --template '{rev}:{node}\n'
1507 $ hg log --template '{rev}:{node}\n'
1486 1:a765632148dc55d38c35c4f247c618701886cb2f
1508 1:a765632148dc55d38c35c4f247c618701886cb2f
1487 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1509 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1488 $ hg bookmark -d X
1510 $ hg bookmark -d X
1489
1511
1490 divergent bookmarks are not hidden
1512 divergent bookmarks are not hidden
1491
1513
1492 $ hg bookmark --hidden -r 1 X@foo
1514 $ hg bookmark --hidden -r 1 X@foo
1493 $ hg log --template '{rev}:{node}\n'
1515 $ hg log --template '{rev}:{node}\n'
1494 1:a765632148dc55d38c35c4f247c618701886cb2f
1516 1:a765632148dc55d38c35c4f247c618701886cb2f
1495 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1517 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1496
1518
1497 clear extensions configuration
1519 clear extensions configuration
1498 $ echo '[extensions]' >> $HGRCPATH
1520 $ echo '[extensions]' >> $HGRCPATH
1499 $ echo "obs=!" >> $HGRCPATH
1521 $ echo "obs=!" >> $HGRCPATH
1500 $ cd ..
1522 $ cd ..
1501
1523
1502 test -u/-k for problematic encoding
1524 test -u/-k for problematic encoding
1503 # unicode: cp932:
1525 # unicode: cp932:
1504 # u30A2 0x83 0x41(= 'A')
1526 # u30A2 0x83 0x41(= 'A')
1505 # u30C2 0x83 0x61(= 'a')
1527 # u30C2 0x83 0x61(= 'a')
1506
1528
1507 $ hg init problematicencoding
1529 $ hg init problematicencoding
1508 $ cd problematicencoding
1530 $ cd problematicencoding
1509
1531
1510 $ python > setup.sh <<EOF
1532 $ python > setup.sh <<EOF
1511 > print u'''
1533 > print u'''
1512 > echo a > text
1534 > echo a > text
1513 > hg add text
1535 > hg add text
1514 > hg --encoding utf-8 commit -u '\u30A2' -m none
1536 > hg --encoding utf-8 commit -u '\u30A2' -m none
1515 > echo b > text
1537 > echo b > text
1516 > hg --encoding utf-8 commit -u '\u30C2' -m none
1538 > hg --encoding utf-8 commit -u '\u30C2' -m none
1517 > echo c > text
1539 > echo c > text
1518 > hg --encoding utf-8 commit -u none -m '\u30A2'
1540 > hg --encoding utf-8 commit -u none -m '\u30A2'
1519 > echo d > text
1541 > echo d > text
1520 > hg --encoding utf-8 commit -u none -m '\u30C2'
1542 > hg --encoding utf-8 commit -u none -m '\u30C2'
1521 > '''.encode('utf-8')
1543 > '''.encode('utf-8')
1522 > EOF
1544 > EOF
1523 $ sh < setup.sh
1545 $ sh < setup.sh
1524
1546
1525 test in problematic encoding
1547 test in problematic encoding
1526 $ python > test.sh <<EOF
1548 $ python > test.sh <<EOF
1527 > print u'''
1549 > print u'''
1528 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1550 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1529 > echo ====
1551 > echo ====
1530 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1552 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1531 > echo ====
1553 > echo ====
1532 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1554 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1533 > echo ====
1555 > echo ====
1534 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1556 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1535 > '''.encode('cp932')
1557 > '''.encode('cp932')
1536 > EOF
1558 > EOF
1537 $ sh < test.sh
1559 $ sh < test.sh
1538 0
1560 0
1539 ====
1561 ====
1540 1
1562 1
1541 ====
1563 ====
1542 2
1564 2
1543 0
1565 0
1544 ====
1566 ====
1545 3
1567 3
1546 1
1568 1
1547
1569
1548 $ cd ..
1570 $ cd ..
1549
1571
1550 test hg log on non-existent files and on directories
1572 test hg log on non-existent files and on directories
1551 $ hg init issue1340
1573 $ hg init issue1340
1552 $ cd issue1340
1574 $ cd issue1340
1553 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1575 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1554 $ echo 1 > d1/f1
1576 $ echo 1 > d1/f1
1555 $ echo 1 > D2/f1
1577 $ echo 1 > D2/f1
1556 $ echo 1 > D3.i/f1
1578 $ echo 1 > D3.i/f1
1557 $ echo 1 > d4.hg/f1
1579 $ echo 1 > d4.hg/f1
1558 $ echo 1 > d5.d/f1
1580 $ echo 1 > d5.d/f1
1559 $ echo 1 > .d6/f1
1581 $ echo 1 > .d6/f1
1560 $ hg -q add .
1582 $ hg -q add .
1561 $ hg commit -m "a bunch of weird directories"
1583 $ hg commit -m "a bunch of weird directories"
1562 $ hg log -l1 d1/f1 | grep changeset
1584 $ hg log -l1 d1/f1 | grep changeset
1563 changeset: 0:65624cd9070a
1585 changeset: 0:65624cd9070a
1564 $ hg log -l1 f1
1586 $ hg log -l1 f1
1565 $ hg log -l1 . | grep changeset
1587 $ hg log -l1 . | grep changeset
1566 changeset: 0:65624cd9070a
1588 changeset: 0:65624cd9070a
1567 $ hg log -l1 ./ | grep changeset
1589 $ hg log -l1 ./ | grep changeset
1568 changeset: 0:65624cd9070a
1590 changeset: 0:65624cd9070a
1569 $ hg log -l1 d1 | grep changeset
1591 $ hg log -l1 d1 | grep changeset
1570 changeset: 0:65624cd9070a
1592 changeset: 0:65624cd9070a
1571 $ hg log -l1 D2 | grep changeset
1593 $ hg log -l1 D2 | grep changeset
1572 changeset: 0:65624cd9070a
1594 changeset: 0:65624cd9070a
1573 $ hg log -l1 D2/f1 | grep changeset
1595 $ hg log -l1 D2/f1 | grep changeset
1574 changeset: 0:65624cd9070a
1596 changeset: 0:65624cd9070a
1575 $ hg log -l1 D3.i | grep changeset
1597 $ hg log -l1 D3.i | grep changeset
1576 changeset: 0:65624cd9070a
1598 changeset: 0:65624cd9070a
1577 $ hg log -l1 D3.i/f1 | grep changeset
1599 $ hg log -l1 D3.i/f1 | grep changeset
1578 changeset: 0:65624cd9070a
1600 changeset: 0:65624cd9070a
1579 $ hg log -l1 d4.hg | grep changeset
1601 $ hg log -l1 d4.hg | grep changeset
1580 changeset: 0:65624cd9070a
1602 changeset: 0:65624cd9070a
1581 $ hg log -l1 d4.hg/f1 | grep changeset
1603 $ hg log -l1 d4.hg/f1 | grep changeset
1582 changeset: 0:65624cd9070a
1604 changeset: 0:65624cd9070a
1583 $ hg log -l1 d5.d | grep changeset
1605 $ hg log -l1 d5.d | grep changeset
1584 changeset: 0:65624cd9070a
1606 changeset: 0:65624cd9070a
1585 $ hg log -l1 d5.d/f1 | grep changeset
1607 $ hg log -l1 d5.d/f1 | grep changeset
1586 changeset: 0:65624cd9070a
1608 changeset: 0:65624cd9070a
1587 $ hg log -l1 .d6 | grep changeset
1609 $ hg log -l1 .d6 | grep changeset
1588 changeset: 0:65624cd9070a
1610 changeset: 0:65624cd9070a
1589 $ hg log -l1 .d6/f1 | grep changeset
1611 $ hg log -l1 .d6/f1 | grep changeset
1590 changeset: 0:65624cd9070a
1612 changeset: 0:65624cd9070a
1591
1613
1592 issue3772: hg log -r :null showing revision 0 as well
1614 issue3772: hg log -r :null showing revision 0 as well
1593
1615
1594 $ hg log -r :null
1616 $ hg log -r :null
1595 changeset: 0:65624cd9070a
1617 changeset: 0:65624cd9070a
1596 tag: tip
1618 tag: tip
1597 user: test
1619 user: test
1598 date: Thu Jan 01 00:00:00 1970 +0000
1620 date: Thu Jan 01 00:00:00 1970 +0000
1599 summary: a bunch of weird directories
1621 summary: a bunch of weird directories
1600
1622
1601 changeset: -1:000000000000
1623 changeset: -1:000000000000
1602 user:
1624 user:
1603 date: Thu Jan 01 00:00:00 1970 +0000
1625 date: Thu Jan 01 00:00:00 1970 +0000
1604
1626
1605 $ hg log -r null:null
1627 $ hg log -r null:null
1606 changeset: -1:000000000000
1628 changeset: -1:000000000000
1607 user:
1629 user:
1608 date: Thu Jan 01 00:00:00 1970 +0000
1630 date: Thu Jan 01 00:00:00 1970 +0000
1609
1631
1610 Check that adding an arbitrary name shows up in log automatically
1632 Check that adding an arbitrary name shows up in log automatically
1611
1633
1612 $ cat > ../names.py <<EOF
1634 $ cat > ../names.py <<EOF
1613 > """A small extension to test adding arbitrary names to a repo"""
1635 > """A small extension to test adding arbitrary names to a repo"""
1614 > from mercurial.namespaces import namespace
1636 > from mercurial.namespaces import namespace
1615 >
1637 >
1616 > def reposetup(ui, repo):
1638 > def reposetup(ui, repo):
1617 > foo = {'foo': repo[0].node()}
1639 > foo = {'foo': repo[0].node()}
1618 > names = lambda r: foo.keys()
1640 > names = lambda r: foo.keys()
1619 > namemap = lambda r, name: foo.get(name)
1641 > namemap = lambda r, name: foo.get(name)
1620 > nodemap = lambda r, node: [name for name, n in foo.iteritems()
1642 > nodemap = lambda r, node: [name for name, n in foo.iteritems()
1621 > if n == node]
1643 > if n == node]
1622 > ns = namespace("bars", templatename="bar", logname="barlog",
1644 > ns = namespace("bars", templatename="bar", logname="barlog",
1623 > colorname="barcolor", listnames=names, namemap=namemap,
1645 > colorname="barcolor", listnames=names, namemap=namemap,
1624 > nodemap=nodemap)
1646 > nodemap=nodemap)
1625 >
1647 >
1626 > repo.names.addnamespace(ns)
1648 > repo.names.addnamespace(ns)
1627 > EOF
1649 > EOF
1628
1650
1629 $ hg --config extensions.names=../names.py log -r 0
1651 $ hg --config extensions.names=../names.py log -r 0
1630 changeset: 0:65624cd9070a
1652 changeset: 0:65624cd9070a
1631 tag: tip
1653 tag: tip
1632 barlog: foo
1654 barlog: foo
1633 user: test
1655 user: test
1634 date: Thu Jan 01 00:00:00 1970 +0000
1656 date: Thu Jan 01 00:00:00 1970 +0000
1635 summary: a bunch of weird directories
1657 summary: a bunch of weird directories
1636
1658
1637 $ hg --config extensions.names=../names.py \
1659 $ hg --config extensions.names=../names.py \
1638 > --config extensions.color= --config color.log.barcolor=red \
1660 > --config extensions.color= --config color.log.barcolor=red \
1639 > --color=always log -r 0
1661 > --color=always log -r 0
1640 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
1662 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
1641 tag: tip
1663 tag: tip
1642 \x1b[0;31mbarlog: foo\x1b[0m (esc)
1664 \x1b[0;31mbarlog: foo\x1b[0m (esc)
1643 user: test
1665 user: test
1644 date: Thu Jan 01 00:00:00 1970 +0000
1666 date: Thu Jan 01 00:00:00 1970 +0000
1645 summary: a bunch of weird directories
1667 summary: a bunch of weird directories
1646
1668
1647 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
1669 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
1648 foo
1670 foo
1649
1671
1650 $ cd ..
1672 $ cd ..
1651
1673
1652 hg log -f dir across branches
1674 hg log -f dir across branches
1653
1675
1654 $ hg init acrossbranches
1676 $ hg init acrossbranches
1655 $ cd acrossbranches
1677 $ cd acrossbranches
1656 $ mkdir d
1678 $ mkdir d
1657 $ echo a > d/a && hg ci -Aqm a
1679 $ echo a > d/a && hg ci -Aqm a
1658 $ echo b > d/a && hg ci -Aqm b
1680 $ echo b > d/a && hg ci -Aqm b
1659 $ hg up -q 0
1681 $ hg up -q 0
1660 $ echo b > d/a && hg ci -Aqm c
1682 $ echo b > d/a && hg ci -Aqm c
1661 $ hg log -f d -T '{desc}' -G
1683 $ hg log -f d -T '{desc}' -G
1662 @ c
1684 @ c
1663 |
1685 |
1664 o a
1686 o a
1665
1687
1666 Ensure that largefiles doesn't interfere with following a normal file
1688 Ensure that largefiles doesn't interfere with following a normal file
1667 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
1689 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
1668 @ c
1690 @ c
1669 |
1691 |
1670 o a
1692 o a
1671
1693
1672 $ hg log -f d/a -T '{desc}' -G
1694 $ hg log -f d/a -T '{desc}' -G
1673 @ c
1695 @ c
1674 |
1696 |
1675 o a
1697 o a
1676
1698
1677 $ cd ..
1699 $ cd ..
1678
1700
1679 hg log -f with linkrev pointing to another branch
1701 hg log -f with linkrev pointing to another branch
1680 -------------------------------------------------
1702 -------------------------------------------------
1681
1703
1682 create history with a filerev whose linkrev points to another branch
1704 create history with a filerev whose linkrev points to another branch
1683
1705
1684 $ hg init branchedlinkrev
1706 $ hg init branchedlinkrev
1685 $ cd branchedlinkrev
1707 $ cd branchedlinkrev
1686 $ echo 1 > a
1708 $ echo 1 > a
1687 $ hg commit -Am 'content1'
1709 $ hg commit -Am 'content1'
1688 adding a
1710 adding a
1689 $ echo 2 > a
1711 $ echo 2 > a
1690 $ hg commit -m 'content2'
1712 $ hg commit -m 'content2'
1691 $ hg up --rev 'desc(content1)'
1713 $ hg up --rev 'desc(content1)'
1692 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1714 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1693 $ echo unrelated > unrelated
1715 $ echo unrelated > unrelated
1694 $ hg commit -Am 'unrelated'
1716 $ hg commit -Am 'unrelated'
1695 adding unrelated
1717 adding unrelated
1696 created new head
1718 created new head
1697 $ hg graft -r 'desc(content2)'
1719 $ hg graft -r 'desc(content2)'
1698 grafting 1:2294ae80ad84 "content2"
1720 grafting 1:2294ae80ad84 "content2"
1699 $ echo 3 > a
1721 $ echo 3 > a
1700 $ hg commit -m 'content3'
1722 $ hg commit -m 'content3'
1701 $ hg log -G
1723 $ hg log -G
1702 @ changeset: 4:50b9b36e9c5d
1724 @ changeset: 4:50b9b36e9c5d
1703 | tag: tip
1725 | tag: tip
1704 | user: test
1726 | user: test
1705 | date: Thu Jan 01 00:00:00 1970 +0000
1727 | date: Thu Jan 01 00:00:00 1970 +0000
1706 | summary: content3
1728 | summary: content3
1707 |
1729 |
1708 o changeset: 3:15b2327059e5
1730 o changeset: 3:15b2327059e5
1709 | user: test
1731 | user: test
1710 | date: Thu Jan 01 00:00:00 1970 +0000
1732 | date: Thu Jan 01 00:00:00 1970 +0000
1711 | summary: content2
1733 | summary: content2
1712 |
1734 |
1713 o changeset: 2:2029acd1168c
1735 o changeset: 2:2029acd1168c
1714 | parent: 0:ae0a3c9f9e95
1736 | parent: 0:ae0a3c9f9e95
1715 | user: test
1737 | user: test
1716 | date: Thu Jan 01 00:00:00 1970 +0000
1738 | date: Thu Jan 01 00:00:00 1970 +0000
1717 | summary: unrelated
1739 | summary: unrelated
1718 |
1740 |
1719 | o changeset: 1:2294ae80ad84
1741 | o changeset: 1:2294ae80ad84
1720 |/ user: test
1742 |/ user: test
1721 | date: Thu Jan 01 00:00:00 1970 +0000
1743 | date: Thu Jan 01 00:00:00 1970 +0000
1722 | summary: content2
1744 | summary: content2
1723 |
1745 |
1724 o changeset: 0:ae0a3c9f9e95
1746 o changeset: 0:ae0a3c9f9e95
1725 user: test
1747 user: test
1726 date: Thu Jan 01 00:00:00 1970 +0000
1748 date: Thu Jan 01 00:00:00 1970 +0000
1727 summary: content1
1749 summary: content1
1728
1750
1729
1751
1730 log -f on the file should list the graft result.
1752 log -f on the file should list the graft result.
1731
1753
1732 $ hg log -Gf a
1754 $ hg log -Gf a
1733 @ changeset: 4:50b9b36e9c5d
1755 @ changeset: 4:50b9b36e9c5d
1734 | tag: tip
1756 | tag: tip
1735 | user: test
1757 | user: test
1736 | date: Thu Jan 01 00:00:00 1970 +0000
1758 | date: Thu Jan 01 00:00:00 1970 +0000
1737 | summary: content3
1759 | summary: content3
1738 |
1760 |
1739 o changeset: 3:15b2327059e5
1761 o changeset: 3:15b2327059e5
1740 | user: test
1762 | user: test
1741 | date: Thu Jan 01 00:00:00 1970 +0000
1763 | date: Thu Jan 01 00:00:00 1970 +0000
1742 | summary: content2
1764 | summary: content2
1743 |
1765 |
1744 o changeset: 0:ae0a3c9f9e95
1766 o changeset: 0:ae0a3c9f9e95
1745 user: test
1767 user: test
1746 date: Thu Jan 01 00:00:00 1970 +0000
1768 date: Thu Jan 01 00:00:00 1970 +0000
1747 summary: content1
1769 summary: content1
1748
1770
1749
1771
1750 plain log lists the original version
1772 plain log lists the original version
1751 (XXX we should probably list both)
1773 (XXX we should probably list both)
1752
1774
1753 $ hg log -G a
1775 $ hg log -G a
1754 @ changeset: 4:50b9b36e9c5d
1776 @ changeset: 4:50b9b36e9c5d
1755 | tag: tip
1777 | tag: tip
1756 | user: test
1778 | user: test
1757 | date: Thu Jan 01 00:00:00 1970 +0000
1779 | date: Thu Jan 01 00:00:00 1970 +0000
1758 | summary: content3
1780 | summary: content3
1759 |
1781 |
1760 | o changeset: 1:2294ae80ad84
1782 | o changeset: 1:2294ae80ad84
1761 |/ user: test
1783 |/ user: test
1762 | date: Thu Jan 01 00:00:00 1970 +0000
1784 | date: Thu Jan 01 00:00:00 1970 +0000
1763 | summary: content2
1785 | summary: content2
1764 |
1786 |
1765 o changeset: 0:ae0a3c9f9e95
1787 o changeset: 0:ae0a3c9f9e95
1766 user: test
1788 user: test
1767 date: Thu Jan 01 00:00:00 1970 +0000
1789 date: Thu Jan 01 00:00:00 1970 +0000
1768 summary: content1
1790 summary: content1
1769
1791
1770
1792
1771 hg log -f from the grafted changeset
1793 hg log -f from the grafted changeset
1772 (The bootstrap should properly take the topology in account)
1794 (The bootstrap should properly take the topology in account)
1773
1795
1774 $ hg up 'desc(content3)^'
1796 $ hg up 'desc(content3)^'
1775 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1797 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1776 $ hg log -Gf a
1798 $ hg log -Gf a
1777 @ changeset: 3:15b2327059e5
1799 @ changeset: 3:15b2327059e5
1778 | user: test
1800 | user: test
1779 | date: Thu Jan 01 00:00:00 1970 +0000
1801 | date: Thu Jan 01 00:00:00 1970 +0000
1780 | summary: content2
1802 | summary: content2
1781 |
1803 |
1782 o changeset: 0:ae0a3c9f9e95
1804 o changeset: 0:ae0a3c9f9e95
1783 user: test
1805 user: test
1784 date: Thu Jan 01 00:00:00 1970 +0000
1806 date: Thu Jan 01 00:00:00 1970 +0000
1785 summary: content1
1807 summary: content1
1786
1808
1787
1809
1788 Test that we use the first non-hidden changeset in that case.
1810 Test that we use the first non-hidden changeset in that case.
1789
1811
1790 (hide the changeset)
1812 (hide the changeset)
1791
1813
1792 $ hg log -T '{node}\n' -r 1
1814 $ hg log -T '{node}\n' -r 1
1793 2294ae80ad8447bc78383182eeac50cb049df623
1815 2294ae80ad8447bc78383182eeac50cb049df623
1794 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
1816 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
1795 $ hg log -G
1817 $ hg log -G
1796 o changeset: 4:50b9b36e9c5d
1818 o changeset: 4:50b9b36e9c5d
1797 | tag: tip
1819 | tag: tip
1798 | user: test
1820 | user: test
1799 | date: Thu Jan 01 00:00:00 1970 +0000
1821 | date: Thu Jan 01 00:00:00 1970 +0000
1800 | summary: content3
1822 | summary: content3
1801 |
1823 |
1802 @ changeset: 3:15b2327059e5
1824 @ changeset: 3:15b2327059e5
1803 | user: test
1825 | user: test
1804 | date: Thu Jan 01 00:00:00 1970 +0000
1826 | date: Thu Jan 01 00:00:00 1970 +0000
1805 | summary: content2
1827 | summary: content2
1806 |
1828 |
1807 o changeset: 2:2029acd1168c
1829 o changeset: 2:2029acd1168c
1808 | parent: 0:ae0a3c9f9e95
1830 | parent: 0:ae0a3c9f9e95
1809 | user: test
1831 | user: test
1810 | date: Thu Jan 01 00:00:00 1970 +0000
1832 | date: Thu Jan 01 00:00:00 1970 +0000
1811 | summary: unrelated
1833 | summary: unrelated
1812 |
1834 |
1813 o changeset: 0:ae0a3c9f9e95
1835 o changeset: 0:ae0a3c9f9e95
1814 user: test
1836 user: test
1815 date: Thu Jan 01 00:00:00 1970 +0000
1837 date: Thu Jan 01 00:00:00 1970 +0000
1816 summary: content1
1838 summary: content1
1817
1839
1818
1840
1819 Check that log on the file does not drop the file revision.
1841 Check that log on the file does not drop the file revision.
1820
1842
1821 $ hg log -G a
1843 $ hg log -G a
1822 o changeset: 4:50b9b36e9c5d
1844 o changeset: 4:50b9b36e9c5d
1823 | tag: tip
1845 | tag: tip
1824 | user: test
1846 | user: test
1825 | date: Thu Jan 01 00:00:00 1970 +0000
1847 | date: Thu Jan 01 00:00:00 1970 +0000
1826 | summary: content3
1848 | summary: content3
1827 |
1849 |
1828 @ changeset: 3:15b2327059e5
1850 @ changeset: 3:15b2327059e5
1829 | user: test
1851 | user: test
1830 | date: Thu Jan 01 00:00:00 1970 +0000
1852 | date: Thu Jan 01 00:00:00 1970 +0000
1831 | summary: content2
1853 | summary: content2
1832 |
1854 |
1833 o changeset: 0:ae0a3c9f9e95
1855 o changeset: 0:ae0a3c9f9e95
1834 user: test
1856 user: test
1835 date: Thu Jan 01 00:00:00 1970 +0000
1857 date: Thu Jan 01 00:00:00 1970 +0000
1836 summary: content1
1858 summary: content1
1837
1859
1838
1860
1839 Even when a head revision is linkrev-shadowed.
1861 Even when a head revision is linkrev-shadowed.
1840
1862
1841 $ hg log -T '{node}\n' -r 4
1863 $ hg log -T '{node}\n' -r 4
1842 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1864 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1843 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1865 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
1844 $ hg log -G a
1866 $ hg log -G a
1845 @ changeset: 3:15b2327059e5
1867 @ changeset: 3:15b2327059e5
1846 | tag: tip
1868 | tag: tip
1847 | user: test
1869 | user: test
1848 | date: Thu Jan 01 00:00:00 1970 +0000
1870 | date: Thu Jan 01 00:00:00 1970 +0000
1849 | summary: content2
1871 | summary: content2
1850 |
1872 |
1851 o changeset: 0:ae0a3c9f9e95
1873 o changeset: 0:ae0a3c9f9e95
1852 user: test
1874 user: test
1853 date: Thu Jan 01 00:00:00 1970 +0000
1875 date: Thu Jan 01 00:00:00 1970 +0000
1854 summary: content1
1876 summary: content1
1855
1877
1856
1878
1857 $ cd ..
1879 $ cd ..
1858
1880
1859 Even when the file revision is missing from some head:
1881 Even when the file revision is missing from some head:
1860
1882
1861 $ hg init issue4490
1883 $ hg init issue4490
1862 $ cd issue4490
1884 $ cd issue4490
1863 $ echo '[experimental]' >> .hg/hgrc
1885 $ echo '[experimental]' >> .hg/hgrc
1864 $ echo 'evolution=createmarkers' >> .hg/hgrc
1886 $ echo 'evolution=createmarkers' >> .hg/hgrc
1865 $ echo a > a
1887 $ echo a > a
1866 $ hg ci -Am0
1888 $ hg ci -Am0
1867 adding a
1889 adding a
1868 $ echo b > b
1890 $ echo b > b
1869 $ hg ci -Am1
1891 $ hg ci -Am1
1870 adding b
1892 adding b
1871 $ echo B > b
1893 $ echo B > b
1872 $ hg ci --amend -m 1
1894 $ hg ci --amend -m 1
1873 $ hg up 0
1895 $ hg up 0
1874 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1896 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1875 $ echo c > c
1897 $ echo c > c
1876 $ hg ci -Am2
1898 $ hg ci -Am2
1877 adding c
1899 adding c
1878 created new head
1900 created new head
1879 $ hg up 'head() and not .'
1901 $ hg up 'head() and not .'
1880 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1902 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1881 $ hg log -G
1903 $ hg log -G
1882 o changeset: 4:db815d6d32e6
1904 o changeset: 4:db815d6d32e6
1883 | tag: tip
1905 | tag: tip
1884 | parent: 0:f7b1eb17ad24
1906 | parent: 0:f7b1eb17ad24
1885 | user: test
1907 | user: test
1886 | date: Thu Jan 01 00:00:00 1970 +0000
1908 | date: Thu Jan 01 00:00:00 1970 +0000
1887 | summary: 2
1909 | summary: 2
1888 |
1910 |
1889 | @ changeset: 3:9bc8ce7f9356
1911 | @ changeset: 3:9bc8ce7f9356
1890 |/ parent: 0:f7b1eb17ad24
1912 |/ parent: 0:f7b1eb17ad24
1891 | user: test
1913 | user: test
1892 | date: Thu Jan 01 00:00:00 1970 +0000
1914 | date: Thu Jan 01 00:00:00 1970 +0000
1893 | summary: 1
1915 | summary: 1
1894 |
1916 |
1895 o changeset: 0:f7b1eb17ad24
1917 o changeset: 0:f7b1eb17ad24
1896 user: test
1918 user: test
1897 date: Thu Jan 01 00:00:00 1970 +0000
1919 date: Thu Jan 01 00:00:00 1970 +0000
1898 summary: 0
1920 summary: 0
1899
1921
1900 $ hg log -f -G b
1922 $ hg log -f -G b
1901 @ changeset: 3:9bc8ce7f9356
1923 @ changeset: 3:9bc8ce7f9356
1902 | parent: 0:f7b1eb17ad24
1924 | parent: 0:f7b1eb17ad24
1903 | user: test
1925 | user: test
1904 | date: Thu Jan 01 00:00:00 1970 +0000
1926 | date: Thu Jan 01 00:00:00 1970 +0000
1905 | summary: 1
1927 | summary: 1
1906 |
1928 |
1907 $ hg log -G b
1929 $ hg log -G b
1908 @ changeset: 3:9bc8ce7f9356
1930 @ changeset: 3:9bc8ce7f9356
1909 | parent: 0:f7b1eb17ad24
1931 | parent: 0:f7b1eb17ad24
1910 | user: test
1932 | user: test
1911 | date: Thu Jan 01 00:00:00 1970 +0000
1933 | date: Thu Jan 01 00:00:00 1970 +0000
1912 | summary: 1
1934 | summary: 1
1913 |
1935 |
1914 $ cd ..
1936 $ cd ..
1915
1937
1916 Check proper report when the manifest changes but not the file issue4499
1938 Check proper report when the manifest changes but not the file issue4499
1917 ------------------------------------------------------------------------
1939 ------------------------------------------------------------------------
1918
1940
1919 $ hg init issue4499
1941 $ hg init issue4499
1920 $ cd issue4499
1942 $ cd issue4499
1921 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
1943 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
1922 > echo 1 > $f;
1944 > echo 1 > $f;
1923 > hg add $f;
1945 > hg add $f;
1924 > done
1946 > done
1925 $ hg commit -m 'A1B1C1'
1947 $ hg commit -m 'A1B1C1'
1926 $ echo 2 > A
1948 $ echo 2 > A
1927 $ echo 2 > B
1949 $ echo 2 > B
1928 $ echo 2 > C
1950 $ echo 2 > C
1929 $ hg commit -m 'A2B2C2'
1951 $ hg commit -m 'A2B2C2'
1930 $ hg up 0
1952 $ hg up 0
1931 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1953 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1932 $ echo 3 > A
1954 $ echo 3 > A
1933 $ echo 2 > B
1955 $ echo 2 > B
1934 $ echo 2 > C
1956 $ echo 2 > C
1935 $ hg commit -m 'A3B2C2'
1957 $ hg commit -m 'A3B2C2'
1936 created new head
1958 created new head
1937
1959
1938 $ hg log -G
1960 $ hg log -G
1939 @ changeset: 2:fe5fc3d0eb17
1961 @ changeset: 2:fe5fc3d0eb17
1940 | tag: tip
1962 | tag: tip
1941 | parent: 0:abf4f0e38563
1963 | parent: 0:abf4f0e38563
1942 | user: test
1964 | user: test
1943 | date: Thu Jan 01 00:00:00 1970 +0000
1965 | date: Thu Jan 01 00:00:00 1970 +0000
1944 | summary: A3B2C2
1966 | summary: A3B2C2
1945 |
1967 |
1946 | o changeset: 1:07dcc6b312c0
1968 | o changeset: 1:07dcc6b312c0
1947 |/ user: test
1969 |/ user: test
1948 | date: Thu Jan 01 00:00:00 1970 +0000
1970 | date: Thu Jan 01 00:00:00 1970 +0000
1949 | summary: A2B2C2
1971 | summary: A2B2C2
1950 |
1972 |
1951 o changeset: 0:abf4f0e38563
1973 o changeset: 0:abf4f0e38563
1952 user: test
1974 user: test
1953 date: Thu Jan 01 00:00:00 1970 +0000
1975 date: Thu Jan 01 00:00:00 1970 +0000
1954 summary: A1B1C1
1976 summary: A1B1C1
1955
1977
1956
1978
1957 Log -f on B should reports current changesets
1979 Log -f on B should reports current changesets
1958
1980
1959 $ hg log -fG B
1981 $ hg log -fG B
1960 @ changeset: 2:fe5fc3d0eb17
1982 @ changeset: 2:fe5fc3d0eb17
1961 | tag: tip
1983 | tag: tip
1962 | parent: 0:abf4f0e38563
1984 | parent: 0:abf4f0e38563
1963 | user: test
1985 | user: test
1964 | date: Thu Jan 01 00:00:00 1970 +0000
1986 | date: Thu Jan 01 00:00:00 1970 +0000
1965 | summary: A3B2C2
1987 | summary: A3B2C2
1966 |
1988 |
1967 o changeset: 0:abf4f0e38563
1989 o changeset: 0:abf4f0e38563
1968 user: test
1990 user: test
1969 date: Thu Jan 01 00:00:00 1970 +0000
1991 date: Thu Jan 01 00:00:00 1970 +0000
1970 summary: A1B1C1
1992 summary: A1B1C1
1971
1993
1972 $ cd ..
1994 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now