##// END OF EJS Templates
blackbox: add milliseconds to blackbox logs by default...
Valentin Gatien-Baron -
r49420:011f5218 default
parent child Browse files
Show More
@@ -1,232 +1,237 b''
1 # blackbox.py - log repository events to a file for post-mortem debugging
1 # blackbox.py - log repository events to a file for post-mortem debugging
2 #
2 #
3 # Copyright 2010 Nicolas Dumazet
3 # Copyright 2010 Nicolas Dumazet
4 # Copyright 2013 Facebook, Inc.
4 # Copyright 2013 Facebook, Inc.
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 """log repository events to a blackbox for debugging
9 """log repository events to a blackbox for debugging
10
10
11 Logs event information to .hg/blackbox.log to help debug and diagnose problems.
11 Logs event information to .hg/blackbox.log to help debug and diagnose problems.
12 The events that get logged can be configured via the blackbox.track and
12 The events that get logged can be configured via the blackbox.track and
13 blackbox.ignore config keys.
13 blackbox.ignore config keys.
14
14
15 Examples::
15 Examples::
16
16
17 [blackbox]
17 [blackbox]
18 track = *
18 track = *
19 ignore = pythonhook
19 ignore = pythonhook
20 # dirty is *EXPENSIVE* (slow);
20 # dirty is *EXPENSIVE* (slow);
21 # each log entry indicates `+` if the repository is dirty, like :hg:`id`.
21 # each log entry indicates `+` if the repository is dirty, like :hg:`id`.
22 dirty = True
22 dirty = True
23 # record the source of log messages
23 # record the source of log messages
24 logsource = True
24 logsource = True
25
25
26 [blackbox]
26 [blackbox]
27 track = command, commandfinish, commandexception, exthook, pythonhook
27 track = command, commandfinish, commandexception, exthook, pythonhook
28
28
29 [blackbox]
29 [blackbox]
30 track = incoming
30 track = incoming
31
31
32 [blackbox]
32 [blackbox]
33 # limit the size of a log file
33 # limit the size of a log file
34 maxsize = 1.5 MB
34 maxsize = 1.5 MB
35 # rotate up to N log files when the current one gets too big
35 # rotate up to N log files when the current one gets too big
36 maxfiles = 3
36 maxfiles = 3
37
37
38 [blackbox]
38 [blackbox]
39 # Include microseconds in log entries with %f (see Python function
39 # Include microseconds in log entries with %f (see Python function
40 # datetime.datetime.strftime)
40 # datetime.datetime.strftime)
41 date-format = %Y-%m-%d @ %H:%M:%S.%f
41 date-format = %Y-%m-%d @ %H:%M:%S.%f
42
42
43 """
43 """
44
44
45 from __future__ import absolute_import
45 from __future__ import absolute_import
46
46
47 import re
47 import re
48
48
49 from mercurial.i18n import _
49 from mercurial.i18n import _
50 from mercurial.node import hex
50 from mercurial.node import hex
51
51
52 from mercurial import (
52 from mercurial import (
53 encoding,
53 encoding,
54 loggingutil,
54 loggingutil,
55 registrar,
55 registrar,
56 )
56 )
57 from mercurial.utils import (
57 from mercurial.utils import (
58 dateutil,
58 dateutil,
59 procutil,
59 procutil,
60 )
60 )
61
61
62 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
62 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
63 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
63 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
64 # be specifying the version(s) of Mercurial they are tested with, or
64 # be specifying the version(s) of Mercurial they are tested with, or
65 # leave the attribute unspecified.
65 # leave the attribute unspecified.
66 testedwith = b'ships-with-hg-core'
66 testedwith = b'ships-with-hg-core'
67
67
68 cmdtable = {}
68 cmdtable = {}
69 command = registrar.command(cmdtable)
69 command = registrar.command(cmdtable)
70
70
71 configtable = {}
71 configtable = {}
72 configitem = registrar.configitem(configtable)
72 configitem = registrar.configitem(configtable)
73
73
74 configitem(
74 configitem(
75 b'blackbox',
75 b'blackbox',
76 b'dirty',
76 b'dirty',
77 default=False,
77 default=False,
78 )
78 )
79 configitem(
79 configitem(
80 b'blackbox',
80 b'blackbox',
81 b'maxsize',
81 b'maxsize',
82 default=b'1 MB',
82 default=b'1 MB',
83 )
83 )
84 configitem(
84 configitem(
85 b'blackbox',
85 b'blackbox',
86 b'logsource',
86 b'logsource',
87 default=False,
87 default=False,
88 )
88 )
89 configitem(
89 configitem(
90 b'blackbox',
90 b'blackbox',
91 b'maxfiles',
91 b'maxfiles',
92 default=7,
92 default=7,
93 )
93 )
94 configitem(
94 configitem(
95 b'blackbox',
95 b'blackbox',
96 b'track',
96 b'track',
97 default=lambda: [b'*'],
97 default=lambda: [b'*'],
98 )
98 )
99 configitem(
99 configitem(
100 b'blackbox',
100 b'blackbox',
101 b'ignore',
101 b'ignore',
102 default=lambda: [b'chgserver', b'cmdserver', b'extension'],
102 default=lambda: [b'chgserver', b'cmdserver', b'extension'],
103 )
103 )
104 configitem(
104 configitem(b'blackbox', b'date-format', default=b'')
105 b'blackbox',
106 b'date-format',
107 default=b'%Y/%m/%d %H:%M:%S',
108 )
109
105
110 _lastlogger = loggingutil.proxylogger()
106 _lastlogger = loggingutil.proxylogger()
111
107
112
108
113 class blackboxlogger(object):
109 class blackboxlogger(object):
114 def __init__(self, ui, repo):
110 def __init__(self, ui, repo):
115 self._repo = repo
111 self._repo = repo
116 self._trackedevents = set(ui.configlist(b'blackbox', b'track'))
112 self._trackedevents = set(ui.configlist(b'blackbox', b'track'))
117 self._ignoredevents = set(ui.configlist(b'blackbox', b'ignore'))
113 self._ignoredevents = set(ui.configlist(b'blackbox', b'ignore'))
118 self._maxfiles = ui.configint(b'blackbox', b'maxfiles')
114 self._maxfiles = ui.configint(b'blackbox', b'maxfiles')
119 self._maxsize = ui.configbytes(b'blackbox', b'maxsize')
115 self._maxsize = ui.configbytes(b'blackbox', b'maxsize')
120 self._inlog = False
116 self._inlog = False
121
117
122 def tracked(self, event):
118 def tracked(self, event):
123 return (
119 return (
124 b'*' in self._trackedevents and event not in self._ignoredevents
120 b'*' in self._trackedevents and event not in self._ignoredevents
125 ) or event in self._trackedevents
121 ) or event in self._trackedevents
126
122
127 def log(self, ui, event, msg, opts):
123 def log(self, ui, event, msg, opts):
128 # self._log() -> ctx.dirty() may create new subrepo instance, which
124 # self._log() -> ctx.dirty() may create new subrepo instance, which
129 # ui is derived from baseui. So the recursion guard in ui.log()
125 # ui is derived from baseui. So the recursion guard in ui.log()
130 # doesn't work as it's local to the ui instance.
126 # doesn't work as it's local to the ui instance.
131 if self._inlog:
127 if self._inlog:
132 return
128 return
133 self._inlog = True
129 self._inlog = True
134 try:
130 try:
135 self._log(ui, event, msg, opts)
131 self._log(ui, event, msg, opts)
136 finally:
132 finally:
137 self._inlog = False
133 self._inlog = False
138
134
139 def _log(self, ui, event, msg, opts):
135 def _log(self, ui, event, msg, opts):
140 default = ui.configdate(b'devel', b'default-date')
136 default = ui.configdate(b'devel', b'default-date')
141 date = dateutil.datestr(default, ui.config(b'blackbox', b'date-format'))
137 dateformat = ui.config(b'blackbox', b'date-format')
138 if dateformat:
139 date = dateutil.datestr(default, dateformat)
140 else:
141 # We want to display milliseconds (more precision seems
142 # unnecessary). Since %.3f is not supported, use %f and truncate
143 # microseconds.
144 date = dateutil.datestr(default, b'%Y/%m/%d %H:%M:%S.%f')[:-3]
142 user = procutil.getuser()
145 user = procutil.getuser()
143 pid = b'%d' % procutil.getpid()
146 pid = b'%d' % procutil.getpid()
144 changed = b''
147 changed = b''
145 ctx = self._repo[None]
148 ctx = self._repo[None]
146 parents = ctx.parents()
149 parents = ctx.parents()
147 rev = b'+'.join([hex(p.node()) for p in parents])
150 rev = b'+'.join([hex(p.node()) for p in parents])
148 if ui.configbool(b'blackbox', b'dirty') and ctx.dirty(
151 if ui.configbool(b'blackbox', b'dirty') and ctx.dirty(
149 missing=True, merge=False, branch=False
152 missing=True, merge=False, branch=False
150 ):
153 ):
151 changed = b'+'
154 changed = b'+'
152 if ui.configbool(b'blackbox', b'logsource'):
155 if ui.configbool(b'blackbox', b'logsource'):
153 src = b' [%s]' % event
156 src = b' [%s]' % event
154 else:
157 else:
155 src = b''
158 src = b''
156 try:
159 try:
157 fmt = b'%s %s @%s%s (%s)%s> %s'
160 fmt = b'%s %s @%s%s (%s)%s> %s'
158 args = (date, user, rev, changed, pid, src, msg)
161 args = (date, user, rev, changed, pid, src, msg)
159 with loggingutil.openlogfile(
162 with loggingutil.openlogfile(
160 ui,
163 ui,
161 self._repo.vfs,
164 self._repo.vfs,
162 name=b'blackbox.log',
165 name=b'blackbox.log',
163 maxfiles=self._maxfiles,
166 maxfiles=self._maxfiles,
164 maxsize=self._maxsize,
167 maxsize=self._maxsize,
165 ) as fp:
168 ) as fp:
166 fp.write(fmt % args)
169 fp.write(fmt % args)
167 except (IOError, OSError) as err:
170 except (IOError, OSError) as err:
168 # deactivate this to avoid failed logging again
171 # deactivate this to avoid failed logging again
169 self._trackedevents.clear()
172 self._trackedevents.clear()
170 ui.debug(
173 ui.debug(
171 b'warning: cannot write to blackbox.log: %s\n'
174 b'warning: cannot write to blackbox.log: %s\n'
172 % encoding.strtolocal(err.strerror)
175 % encoding.strtolocal(err.strerror)
173 )
176 )
174 return
177 return
175 _lastlogger.logger = self
178 _lastlogger.logger = self
176
179
177
180
178 def uipopulate(ui):
181 def uipopulate(ui):
179 ui.setlogger(b'blackbox', _lastlogger)
182 ui.setlogger(b'blackbox', _lastlogger)
180
183
181
184
182 def reposetup(ui, repo):
185 def reposetup(ui, repo):
183 # During 'hg pull' a httppeer repo is created to represent the remote repo.
186 # During 'hg pull' a httppeer repo is created to represent the remote repo.
184 # It doesn't have a .hg directory to put a blackbox in, so we don't do
187 # It doesn't have a .hg directory to put a blackbox in, so we don't do
185 # the blackbox setup for it.
188 # the blackbox setup for it.
186 if not repo.local():
189 if not repo.local():
187 return
190 return
188
191
189 # Since blackbox.log is stored in the repo directory, the logger should be
192 # Since blackbox.log is stored in the repo directory, the logger should be
190 # instantiated per repository.
193 # instantiated per repository.
191 logger = blackboxlogger(ui, repo)
194 logger = blackboxlogger(ui, repo)
192 ui.setlogger(b'blackbox', logger)
195 ui.setlogger(b'blackbox', logger)
193
196
194 # Set _lastlogger even if ui.log is not called. This gives blackbox a
197 # Set _lastlogger even if ui.log is not called. This gives blackbox a
195 # fallback place to log
198 # fallback place to log
196 if _lastlogger.logger is None:
199 if _lastlogger.logger is None:
197 _lastlogger.logger = logger
200 _lastlogger.logger = logger
198
201
199 repo._wlockfreeprefix.add(b'blackbox.log')
202 repo._wlockfreeprefix.add(b'blackbox.log')
200
203
201
204
202 @command(
205 @command(
203 b'blackbox',
206 b'blackbox',
204 [
207 [
205 (b'l', b'limit', 10, _(b'the number of events to show')),
208 (b'l', b'limit', 10, _(b'the number of events to show')),
206 ],
209 ],
207 _(b'hg blackbox [OPTION]...'),
210 _(b'hg blackbox [OPTION]...'),
208 helpcategory=command.CATEGORY_MAINTENANCE,
211 helpcategory=command.CATEGORY_MAINTENANCE,
209 helpbasic=True,
212 helpbasic=True,
210 )
213 )
211 def blackbox(ui, repo, *revs, **opts):
214 def blackbox(ui, repo, *revs, **opts):
212 """view the recent repository events"""
215 """view the recent repository events"""
213
216
214 if not repo.vfs.exists(b'blackbox.log'):
217 if not repo.vfs.exists(b'blackbox.log'):
215 return
218 return
216
219
217 limit = opts.get('limit')
220 limit = opts.get('limit')
218 fp = repo.vfs(b'blackbox.log', b'r')
221 fp = repo.vfs(b'blackbox.log', b'r')
219 lines = fp.read().split(b'\n')
222 lines = fp.read().split(b'\n')
220
223
221 count = 0
224 count = 0
222 output = []
225 output = []
223 for line in reversed(lines):
226 for line in reversed(lines):
224 if count >= limit:
227 if count >= limit:
225 break
228 break
226
229
227 # count the commands by matching lines like: 2013/01/23 19:13:36 root>
230 # count the commands by matching lines like: 2013/01/23 19:13:36 root>
228 if re.match(br'^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2} .*> .*', line):
231 if re.match(
232 br'^\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}(.\d*)? .*> .*', line
233 ):
229 count += 1
234 count += 1
230 output.append(line)
235 output.append(line)
231
236
232 ui.status(b'\n'.join(reversed(output)))
237 ui.status(b'\n'.join(reversed(output)))
@@ -1,499 +1,499 b''
1 setup
1 setup
2
2
3 $ cat > myextension.py <<EOF
3 $ cat > myextension.py <<EOF
4 > from mercurial import error, registrar
4 > from mercurial import error, registrar
5 > cmdtable = {}
5 > cmdtable = {}
6 > command = registrar.command(cmdtable)
6 > command = registrar.command(cmdtable)
7 > @command(b'crash', [], b'hg crash')
7 > @command(b'crash', [], b'hg crash')
8 > def crash(ui, *args, **kwargs):
8 > def crash(ui, *args, **kwargs):
9 > raise Exception("oops")
9 > raise Exception("oops")
10 > @command(b'abortcmd', [], b'hg abortcmd')
10 > @command(b'abortcmd', [], b'hg abortcmd')
11 > def abort(ui, *args, **kwargs):
11 > def abort(ui, *args, **kwargs):
12 > raise error.Abort(b"oops")
12 > raise error.Abort(b"oops")
13 > EOF
13 > EOF
14 $ abspath=`pwd`/myextension.py
14 $ abspath=`pwd`/myextension.py
15
15
16 $ cat >> $HGRCPATH <<EOF
16 $ cat >> $HGRCPATH <<EOF
17 > [extensions]
17 > [extensions]
18 > blackbox=
18 > blackbox=
19 > mock=$TESTDIR/mockblackbox.py
19 > mock=$TESTDIR/mockblackbox.py
20 > mq=
20 > mq=
21 > myextension=$TESTTMP/myextension.py
21 > myextension=$TESTTMP/myextension.py
22 > [alias]
22 > [alias]
23 > confuse = log --limit 3
23 > confuse = log --limit 3
24 > so-confusing = confuse --style compact
24 > so-confusing = confuse --style compact
25 > EOF
25 > EOF
26
26
27 $ hg init blackboxtest
27 $ hg init blackboxtest
28 $ cd blackboxtest
28 $ cd blackboxtest
29
29
30 command, exit codes, and duration
30 command, exit codes, and duration
31
31
32 $ echo a > a
32 $ echo a > a
33 $ hg add a
33 $ hg add a
34 $ hg blackbox --config blackbox.dirty=True
34 $ hg blackbox --config blackbox.dirty=True
35 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob)
35 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob)
36 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
36 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> add a
37 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
37 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
38 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob)
38 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob)
39
39
40 failure exit code
40 failure exit code
41 $ rm ./.hg/blackbox.log
41 $ rm ./.hg/blackbox.log
42 $ hg add non-existent
42 $ hg add non-existent
43 non-existent: $ENOENT$
43 non-existent: $ENOENT$
44 [1]
44 [1]
45 $ hg blackbox
45 $ hg blackbox
46 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent
46 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> add non-existent
47 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add non-existent exited 1 after * seconds (glob)
47 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> add non-existent exited 1 after * seconds (glob)
48 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
48 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox
49
49
50 abort exit code
50 abort exit code
51 $ rm ./.hg/blackbox.log
51 $ rm ./.hg/blackbox.log
52 $ hg abortcmd 2> /dev/null
52 $ hg abortcmd 2> /dev/null
53 [255]
53 [255]
54 $ hg blackbox -l 2
54 $ hg blackbox -l 2
55 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> abortcmd exited 255 after * seconds (glob)
55 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> abortcmd exited 255 after * seconds (glob)
56 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2
56 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2
57
57
58 unhandled exception
58 unhandled exception
59 $ rm ./.hg/blackbox.log
59 $ rm ./.hg/blackbox.log
60 #if chg
60 #if chg
61 (chg exits 255 because it fails to receive an exit code)
61 (chg exits 255 because it fails to receive an exit code)
62 $ hg crash 2>/dev/null
62 $ hg crash 2>/dev/null
63 [255]
63 [255]
64 #else
64 #else
65 (hg exits 1 because Python default exit code for uncaught exception is 1)
65 (hg exits 1 because Python default exit code for uncaught exception is 1)
66 $ hg crash 2>/dev/null
66 $ hg crash 2>/dev/null
67 [1]
67 [1]
68 #endif
68 #endif
69 $ hg blackbox -l 2
69 $ hg blackbox -l 2
70 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> crash exited 1 after * seconds (glob)
70 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> crash exited 1 after * seconds (glob)
71 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2
71 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox -l 2
72
72
73 alias expansion is logged
73 alias expansion is logged
74 $ rm ./.hg/blackbox.log
74 $ rm ./.hg/blackbox.log
75 $ hg confuse
75 $ hg confuse
76 $ hg blackbox
76 $ hg blackbox
77 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse
77 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> confuse
78 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
78 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
79 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
79 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> confuse exited 0 after * seconds (glob)
80 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
80 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox
81
81
82 recursive aliases work correctly
82 recursive aliases work correctly
83 $ rm ./.hg/blackbox.log
83 $ rm ./.hg/blackbox.log
84 $ hg so-confusing
84 $ hg so-confusing
85 $ hg blackbox
85 $ hg blackbox
86 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing
86 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> so-confusing
87 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'so-confusing' expands to 'confuse --style compact'
87 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> alias 'so-confusing' expands to 'confuse --style compact'
88 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
88 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> alias 'confuse' expands to 'log --limit 3'
89 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob)
89 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> so-confusing exited 0 after * seconds (glob)
90 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
90 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox
91
91
92 custom date format
92 custom date format
93 $ rm ./.hg/blackbox.log
93 $ rm ./.hg/blackbox.log
94 $ hg --config blackbox.date-format='%Y-%m-%d @ %H:%M:%S' \
94 $ hg --config blackbox.date-format='%Y-%m-%d @ %H:%M:%S' \
95 > --config devel.default-date='1334347993 0' --traceback status
95 > --config devel.default-date='1334347993 0' --traceback status
96 A a
96 A a
97 $ hg blackbox
97 $ hg blackbox
98 2012-04-13 @ 20:13:13 bob @0000000000000000000000000000000000000000 (5000)> --config *blackbox.date-format=%Y-%m-%d @ %H:%M:%S* --config *devel.default-date=1334347993 0* --traceback status (glob)
98 2012-04-13 @ 20:13:13 bob @0000000000000000000000000000000000000000 (5000)> --config *blackbox.date-format=%Y-%m-%d @ %H:%M:%S* --config *devel.default-date=1334347993 0* --traceback status (glob)
99 2012-04-13 @ 20:13:13 bob @0000000000000000000000000000000000000000 (5000)> --config *blackbox.date-format=%Y-%m-%d @ %H:%M:%S* --config *devel.default-date=1334347993 0* --traceback status exited 0 after * seconds (glob)
99 2012-04-13 @ 20:13:13 bob @0000000000000000000000000000000000000000 (5000)> --config *blackbox.date-format=%Y-%m-%d @ %H:%M:%S* --config *devel.default-date=1334347993 0* --traceback status exited 0 after * seconds (glob)
100 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
100 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox
101
101
102 incoming change tracking
102 incoming change tracking
103
103
104 create two heads to verify that we only see one change in the log later
104 create two heads to verify that we only see one change in the log later
105 $ hg commit -ma
105 $ hg commit -ma
106 $ hg up null
106 $ hg up null
107 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
107 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
108 $ echo b > b
108 $ echo b > b
109 $ hg commit -Amb
109 $ hg commit -Amb
110 adding b
110 adding b
111 created new head
111 created new head
112
112
113 clone, commit, pull
113 clone, commit, pull
114 $ hg clone . ../blackboxtest2
114 $ hg clone . ../blackboxtest2
115 updating to branch default
115 updating to branch default
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 $ echo c > c
117 $ echo c > c
118 $ hg commit -Amc
118 $ hg commit -Amc
119 adding c
119 adding c
120 $ cd ../blackboxtest2
120 $ cd ../blackboxtest2
121 $ hg pull
121 $ hg pull
122 pulling from $TESTTMP/blackboxtest
122 pulling from $TESTTMP/blackboxtest
123 searching for changes
123 searching for changes
124 adding changesets
124 adding changesets
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 1 changesets with 1 changes to 1 files
127 added 1 changesets with 1 changes to 1 files
128 new changesets d02f48003e62
128 new changesets d02f48003e62
129 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
130 $ hg blackbox -l 6
130 $ hg blackbox -l 6
131 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served) with 1 labels and 2 nodes
131 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served) with 1 labels and 2 nodes
132 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (served.hidden) in * seconds (glob)
132 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (served.hidden) in * seconds (glob)
133 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served.hidden) with 1 labels and 2 nodes
133 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served.hidden) with 1 labels and 2 nodes
134 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
134 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
135 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
135 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
136 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
136 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
137
137
138 we must not cause a failure if we cannot write to the log
138 we must not cause a failure if we cannot write to the log
139
139
140 $ hg rollback
140 $ hg rollback
141 repository tip rolled back to revision 1 (undo pull)
141 repository tip rolled back to revision 1 (undo pull)
142
142
143 $ mv .hg/blackbox.log .hg/blackbox.log-
143 $ mv .hg/blackbox.log .hg/blackbox.log-
144 $ mkdir .hg/blackbox.log
144 $ mkdir .hg/blackbox.log
145 $ hg --debug incoming
145 $ hg --debug incoming
146 warning: cannot write to blackbox.log: * (glob)
146 warning: cannot write to blackbox.log: * (glob)
147 comparing with $TESTTMP/blackboxtest
147 comparing with $TESTTMP/blackboxtest
148 query 1; heads
148 query 1; heads
149 searching for changes
149 searching for changes
150 all local changesets known remotely
150 all local changesets known remotely
151 changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51
151 changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51
152 tag: tip
152 tag: tip
153 phase: draft
153 phase: draft
154 parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06
154 parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06
155 parent: -1:0000000000000000000000000000000000000000
155 parent: -1:0000000000000000000000000000000000000000
156 manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892
156 manifest: 2:ab9d46b053ebf45b7996f2922b9893ff4b63d892
157 user: test
157 user: test
158 date: Thu Jan 01 00:00:00 1970 +0000
158 date: Thu Jan 01 00:00:00 1970 +0000
159 files+: c
159 files+: c
160 extra: branch=default
160 extra: branch=default
161 description:
161 description:
162 c
162 c
163
163
164
164
165 $ hg pull
165 $ hg pull
166 pulling from $TESTTMP/blackboxtest
166 pulling from $TESTTMP/blackboxtest
167 searching for changes
167 searching for changes
168 adding changesets
168 adding changesets
169 adding manifests
169 adding manifests
170 adding file changes
170 adding file changes
171 added 1 changesets with 1 changes to 1 files
171 added 1 changesets with 1 changes to 1 files
172 new changesets d02f48003e62
172 new changesets d02f48003e62
173 (run 'hg update' to get a working copy)
173 (run 'hg update' to get a working copy)
174
174
175 a failure reading from the log is fatal
175 a failure reading from the log is fatal
176
176
177 $ hg blackbox -l 3
177 $ hg blackbox -l 3
178 abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob)
178 abort: *$TESTTMP/blackboxtest2/.hg/blackbox.log* (glob)
179 [255]
179 [255]
180
180
181 $ rmdir .hg/blackbox.log
181 $ rmdir .hg/blackbox.log
182 $ mv .hg/blackbox.log- .hg/blackbox.log
182 $ mv .hg/blackbox.log- .hg/blackbox.log
183
183
184 backup bundles get logged
184 backup bundles get logged
185
185
186 $ touch d
186 $ touch d
187 $ hg commit -Amd
187 $ hg commit -Amd
188 adding d
188 adding d
189 created new head
189 created new head
190 $ hg strip tip
190 $ hg strip tip
191 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
191 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
192 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
192 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
193 $ hg blackbox -l 6
193 $ hg blackbox -l 6
194 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
194 1970/01/01 00:00:00.000 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
195 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg
195 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg
196 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (immutable) in * seconds (glob)
196 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (immutable) in * seconds (glob)
197 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (immutable) with 1 labels and 2 nodes
197 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (immutable) with 1 labels and 2 nodes
198 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
198 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
199 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
199 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
200
200
201 extension and python hooks - use the eol extension for a pythonhook
201 extension and python hooks - use the eol extension for a pythonhook
202
202
203 $ echo '[extensions]' >> .hg/hgrc
203 $ echo '[extensions]' >> .hg/hgrc
204 $ echo 'eol=' >> .hg/hgrc
204 $ echo 'eol=' >> .hg/hgrc
205 $ echo '[hooks]' >> .hg/hgrc
205 $ echo '[hooks]' >> .hg/hgrc
206 $ echo 'update = echo hooked' >> .hg/hgrc
206 $ echo 'update = echo hooked' >> .hg/hgrc
207 $ hg update
207 $ hg update
208 The fsmonitor extension is incompatible with the eol extension and has been disabled. (fsmonitor !)
208 The fsmonitor extension is incompatible with the eol extension and has been disabled. (fsmonitor !)
209 hooked
209 hooked
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 updated to "d02f48003e62: c"
211 updated to "d02f48003e62: c"
212 1 other heads for branch "default"
212 1 other heads for branch "default"
213 $ cat >> .hg/hgrc <<EOF
213 $ cat >> .hg/hgrc <<EOF
214 > [extensions]
214 > [extensions]
215 > # disable eol, because it is not needed for subsequent tests
215 > # disable eol, because it is not needed for subsequent tests
216 > # (in addition, keeping it requires extra care for fsmonitor)
216 > # (in addition, keeping it requires extra care for fsmonitor)
217 > eol=!
217 > eol=!
218 > EOF
218 > EOF
219 $ hg blackbox -l 5
219 $ hg blackbox -l 5
220 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update (no-chg !)
220 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> update (no-chg !)
221 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
221 1970/01/01 00:00:00.000 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
222 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
222 1970/01/01 00:00:00.000 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
223 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
223 1970/01/01 00:00:00.000 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
224 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --no-profile --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !)
224 1970/01/01 00:00:00.000 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --no-profile --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !)
225 1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5
225 1970/01/01 00:00:00.000 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5
226
226
227 log rotation
227 log rotation
228
228
229 $ echo '[blackbox]' >> .hg/hgrc
229 $ echo '[blackbox]' >> .hg/hgrc
230 $ echo 'maxsize = 20 b' >> .hg/hgrc
230 $ echo 'maxsize = 20 b' >> .hg/hgrc
231 $ echo 'maxfiles = 3' >> .hg/hgrc
231 $ echo 'maxfiles = 3' >> .hg/hgrc
232 $ hg status
232 $ hg status
233 $ hg status
233 $ hg status
234 $ hg status
234 $ hg status
235 $ hg tip -q
235 $ hg tip -q
236 2:d02f48003e62
236 2:d02f48003e62
237 $ ls .hg/blackbox.log*
237 $ ls .hg/blackbox.log*
238 .hg/blackbox.log
238 .hg/blackbox.log
239 .hg/blackbox.log.1
239 .hg/blackbox.log.1
240 .hg/blackbox.log.2
240 .hg/blackbox.log.2
241 $ cd ..
241 $ cd ..
242
242
243 $ hg init blackboxtest3
243 $ hg init blackboxtest3
244 $ cd blackboxtest3
244 $ cd blackboxtest3
245 $ hg blackbox
245 $ hg blackbox
246 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest3 exited 0 after * seconds (glob)
246 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest3 exited 0 after * seconds (glob)
247 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> blackbox
247 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> blackbox
248 $ mv .hg/blackbox.log .hg/blackbox.log-
248 $ mv .hg/blackbox.log .hg/blackbox.log-
249 $ mkdir .hg/blackbox.log
249 $ mkdir .hg/blackbox.log
250 $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\
250 $ sed -e 's/\(.*test1.*\)/#\1/; s#\(.*commit2.*\)#os.rmdir(".hg/blackbox.log")\
251 > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\
251 > os.rename(".hg/blackbox.log-", ".hg/blackbox.log")\
252 > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py
252 > \1#' $TESTDIR/test-dispatch.py > ../test-dispatch.py
253 $ "$PYTHON" $TESTDIR/blackbox-readonly-dispatch.py
253 $ "$PYTHON" $TESTDIR/blackbox-readonly-dispatch.py
254 running: --debug add foo
254 running: --debug add foo
255 warning: cannot write to blackbox.log: Is a directory (no-windows !)
255 warning: cannot write to blackbox.log: Is a directory (no-windows !)
256 warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !)
256 warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !)
257 adding foo
257 adding foo
258 result: 0
258 result: 0
259 running: --debug commit -m commit1 -d 2000-01-01 foo
259 running: --debug commit -m commit1 -d 2000-01-01 foo
260 warning: cannot write to blackbox.log: Is a directory (no-windows !)
260 warning: cannot write to blackbox.log: Is a directory (no-windows !)
261 warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !)
261 warning: cannot write to blackbox.log: $TESTTMP/blackboxtest3/.hg/blackbox.log: Access is denied (windows !)
262 committing files:
262 committing files:
263 foo
263 foo
264 committing manifest
264 committing manifest
265 committing changelog
265 committing changelog
266 updating the branch cache
266 updating the branch cache
267 committed changeset 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
267 committed changeset 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
268 result: 0
268 result: 0
269 running: --debug commit -m commit2 -d 2000-01-02 foo
269 running: --debug commit -m commit2 -d 2000-01-02 foo
270 committing files:
270 committing files:
271 foo
271 foo
272 committing manifest
272 committing manifest
273 committing changelog
273 committing changelog
274 updating the branch cache
274 updating the branch cache
275 committed changeset 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7
275 committed changeset 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7
276 result: 0
276 result: 0
277 running: --debug log -r 0
277 running: --debug log -r 0
278 changeset: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
278 changeset: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
279 phase: draft
279 phase: draft
280 parent: -1:0000000000000000000000000000000000000000
280 parent: -1:0000000000000000000000000000000000000000
281 parent: -1:0000000000000000000000000000000000000000
281 parent: -1:0000000000000000000000000000000000000000
282 manifest: 0:9091aa5df980aea60860a2e39c95182e68d1ddec
282 manifest: 0:9091aa5df980aea60860a2e39c95182e68d1ddec
283 user: test
283 user: test
284 date: Sat Jan 01 00:00:00 2000 +0000
284 date: Sat Jan 01 00:00:00 2000 +0000
285 files+: foo
285 files+: foo
286 extra: branch=default
286 extra: branch=default
287 description:
287 description:
288 commit1
288 commit1
289
289
290
290
291 result: 0
291 result: 0
292 running: --debug log -r tip
292 running: --debug log -r tip
293 changeset: 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7
293 changeset: 1:45589e459b2edfbf3dbde7e01f611d2c1e7453d7
294 tag: tip
294 tag: tip
295 phase: draft
295 phase: draft
296 parent: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
296 parent: 0:0e46349438790c460c5c9f7546bfcd39b267bbd2
297 parent: -1:0000000000000000000000000000000000000000
297 parent: -1:0000000000000000000000000000000000000000
298 manifest: 1:895aa9b7886f89dd017a6d62524e1f9180b04df9
298 manifest: 1:895aa9b7886f89dd017a6d62524e1f9180b04df9
299 user: test
299 user: test
300 date: Sun Jan 02 00:00:00 2000 +0000
300 date: Sun Jan 02 00:00:00 2000 +0000
301 files: foo
301 files: foo
302 extra: branch=default
302 extra: branch=default
303 description:
303 description:
304 commit2
304 commit2
305
305
306
306
307 result: 0
307 result: 0
308 $ hg blackbox
308 $ hg blackbox
309 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache
309 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache
310 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated branch cache (served) in * seconds (glob)
310 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated branch cache (served) in * seconds (glob)
311 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote branch cache (served) with 1 labels and 1 nodes
311 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote branch cache (served) with 1 labels and 1 nodes
312 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob)
312 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob)
313 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0
313 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0
314 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
314 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
315 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 exited 0 after *.?? seconds (glob)
315 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0 exited 0 after *.?? seconds (glob)
316 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip
316 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip
317 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob)
317 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r tip exited 0 after *.?? seconds (glob)
318 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
318 1970/01/01 00:00:00.000 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> blackbox
319
319
320 Skip rotation if the .hg is read-only
320 Skip rotation if the .hg is read-only
321
321
322 #if unix-permissions
322 #if unix-permissions
323 $ chmod -w .hg
323 $ chmod -w .hg
324 $ hg log -r. -T '{rev}\n' --config blackbox.maxsize=1 --debug
324 $ hg log -r. -T '{rev}\n' --config blackbox.maxsize=1 --debug
325 warning: cannot rename '$TESTTMP/blackboxtest3/.hg/blackbox.log.1' to '$TESTTMP/blackboxtest3/.hg/blackbox.log': Permission denied
325 warning: cannot rename '$TESTTMP/blackboxtest3/.hg/blackbox.log.1' to '$TESTTMP/blackboxtest3/.hg/blackbox.log': Permission denied
326 warning: cannot write to blackbox.log: Permission denied
326 warning: cannot write to blackbox.log: Permission denied
327 1
327 1
328 $ chmod +w .hg
328 $ chmod +w .hg
329 #endif
329 #endif
330
330
331 Test log recursion from dirty status check
331 Test log recursion from dirty status check
332
332
333 $ cat > ../r.py <<EOF
333 $ cat > ../r.py <<EOF
334 > from mercurial import context, error, extensions
334 > from mercurial import context, error, extensions
335 > x=[False]
335 > x=[False]
336 > def status(orig, *args, **opts):
336 > def status(orig, *args, **opts):
337 > args[0].repo().ui.log(b"broken", b"recursion?")
337 > args[0].repo().ui.log(b"broken", b"recursion?")
338 > return orig(*args, **opts)
338 > return orig(*args, **opts)
339 > def reposetup(ui, repo):
339 > def reposetup(ui, repo):
340 > extensions.wrapfunction(context.basectx, 'status', status)
340 > extensions.wrapfunction(context.basectx, 'status', status)
341 > EOF
341 > EOF
342 $ hg id --config extensions.x=../r.py --config blackbox.dirty=True
342 $ hg id --config extensions.x=../r.py --config blackbox.dirty=True
343 45589e459b2e tip
343 45589e459b2e tip
344
344
345 cleanup
345 cleanup
346 $ cd ..
346 $ cd ..
347
347
348 Test missing log directory, which shouldn't be created automatically
348 Test missing log directory, which shouldn't be created automatically
349
349
350 $ cat <<'EOF' > closeremove.py
350 $ cat <<'EOF' > closeremove.py
351 > def reposetup(ui, repo):
351 > def reposetup(ui, repo):
352 > class rmrepo(repo.__class__):
352 > class rmrepo(repo.__class__):
353 > def close(self):
353 > def close(self):
354 > super(rmrepo, self).close()
354 > super(rmrepo, self).close()
355 > self.ui.debug(b'removing %s\n' % self.vfs.base)
355 > self.ui.debug(b'removing %s\n' % self.vfs.base)
356 > self.vfs.rmtree()
356 > self.vfs.rmtree()
357 > repo.__class__ = rmrepo
357 > repo.__class__ = rmrepo
358 > EOF
358 > EOF
359
359
360 $ hg init gone
360 $ hg init gone
361 $ cd gone
361 $ cd gone
362 $ cat <<'EOF' > .hg/hgrc
362 $ cat <<'EOF' > .hg/hgrc
363 > [extensions]
363 > [extensions]
364 > closeremove = ../closeremove.py
364 > closeremove = ../closeremove.py
365 > EOF
365 > EOF
366 $ hg log --debug
366 $ hg log --debug
367 removing $TESTTMP/gone/.hg
367 removing $TESTTMP/gone/.hg
368 warning: cannot write to blackbox.log: $ENOENT$ (no-windows !)
368 warning: cannot write to blackbox.log: $ENOENT$ (no-windows !)
369 warning: cannot write to blackbox.log: $TESTTMP/gone/.hg/blackbox.log: $ENOTDIR$ (windows !)
369 warning: cannot write to blackbox.log: $TESTTMP/gone/.hg/blackbox.log: $ENOTDIR$ (windows !)
370 $ cd ..
370 $ cd ..
371
371
372 blackbox should disable itself if track is empty
372 blackbox should disable itself if track is empty
373
373
374 $ hg --config blackbox.track= init nothing_tracked
374 $ hg --config blackbox.track= init nothing_tracked
375 $ cd nothing_tracked
375 $ cd nothing_tracked
376 $ cat >> .hg/hgrc << EOF
376 $ cat >> .hg/hgrc << EOF
377 > [blackbox]
377 > [blackbox]
378 > track =
378 > track =
379 > EOF
379 > EOF
380 $ hg blackbox
380 $ hg blackbox
381 $ cd $TESTTMP
381 $ cd $TESTTMP
382
382
383 a '*' entry in blackbox.track is interpreted as log everything
383 a '*' entry in blackbox.track is interpreted as log everything
384
384
385 $ hg --config blackbox.track='*' \
385 $ hg --config blackbox.track='*' \
386 > --config blackbox.logsource=True \
386 > --config blackbox.logsource=True \
387 > init track_star
387 > init track_star
388 $ cd track_star
388 $ cd track_star
389 $ cat >> .hg/hgrc << EOF
389 $ cat >> .hg/hgrc << EOF
390 > [blackbox]
390 > [blackbox]
391 > logsource = True
391 > logsource = True
392 > track = *
392 > track = *
393 > EOF
393 > EOF
394 (only look for entries with specific logged sources, otherwise this test is
394 (only look for entries with specific logged sources, otherwise this test is
395 pretty brittle)
395 pretty brittle)
396 $ hg blackbox | egrep '\[command(finish)?\]'
396 $ hg blackbox | egrep '\[command(finish)?\]'
397 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000) [commandfinish]> --config *blackbox.track=* --config *blackbox.logsource=True* init track_star exited 0 after * seconds (glob)
397 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000) [commandfinish]> --config *blackbox.track=* --config *blackbox.logsource=True* init track_star exited 0 after * seconds (glob)
398 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000) [command]> blackbox
398 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000) [command]> blackbox
399 $ cd $TESTTMP
399 $ cd $TESTTMP
400
400
401 #if chg
401 #if chg
402
402
403 when using chg, blackbox.log should get rotated correctly
403 when using chg, blackbox.log should get rotated correctly
404
404
405 $ cat > $TESTTMP/noop.py << EOF
405 $ cat > $TESTTMP/noop.py << EOF
406 > from __future__ import absolute_import
406 > from __future__ import absolute_import
407 > import time
407 > import time
408 > from mercurial import registrar, scmutil
408 > from mercurial import registrar, scmutil
409 > cmdtable = {}
409 > cmdtable = {}
410 > command = registrar.command(cmdtable)
410 > command = registrar.command(cmdtable)
411 > @command(b'noop')
411 > @command(b'noop')
412 > def noop(ui, repo):
412 > def noop(ui, repo):
413 > pass
413 > pass
414 > EOF
414 > EOF
415
415
416 $ hg init blackbox-chg
416 $ hg init blackbox-chg
417 $ cd blackbox-chg
417 $ cd blackbox-chg
418
418
419 $ cat > .hg/hgrc << EOF
419 $ cat > .hg/hgrc << EOF
420 > [blackbox]
420 > [blackbox]
421 > maxsize = 500B
421 > maxsize = 500B
422 > [extensions]
422 > [extensions]
423 > # extension change forces chg to restart
423 > # extension change forces chg to restart
424 > noop=$TESTTMP/noop.py
424 > noop=$TESTTMP/noop.py
425 > EOF
425 > EOF
426
426
427 $ "$PYTHON" -c 'print("a" * 400)' > .hg/blackbox.log
427 $ "$PYTHON" -c 'print("a" * 400)' > .hg/blackbox.log
428 $ chg noop
428 $ chg noop
429 $ chg noop
429 $ chg noop
430 $ chg noop
430 $ chg noop
431 $ chg noop
431 $ chg noop
432 $ chg noop
432 $ chg noop
433
433
434 $ cat > showsize.py << 'EOF'
434 $ cat > showsize.py << 'EOF'
435 > import os
435 > import os
436 > import sys
436 > import sys
437 > limit = 500
437 > limit = 500
438 > for p in sys.argv[1:]:
438 > for p in sys.argv[1:]:
439 > size = os.stat(p).st_size
439 > size = os.stat(p).st_size
440 > if size >= limit:
440 > if size >= limit:
441 > desc = '>='
441 > desc = '>='
442 > else:
442 > else:
443 > desc = '<'
443 > desc = '<'
444 > print('%s: %s %d' % (p, desc, limit))
444 > print('%s: %s %d' % (p, desc, limit))
445 > EOF
445 > EOF
446
446
447 $ "$PYTHON" showsize.py .hg/blackbox*
447 $ "$PYTHON" showsize.py .hg/blackbox*
448 .hg/blackbox.log: < 500
448 .hg/blackbox.log: < 500
449 .hg/blackbox.log.1: >= 500
449 .hg/blackbox.log.1: >= 500
450 .hg/blackbox.log.2: >= 500
450 .hg/blackbox.log.2: >= 500
451
451
452 $ cd ..
452 $ cd ..
453
453
454 With chg, blackbox should not create the log file if the repo is gone
454 With chg, blackbox should not create the log file if the repo is gone
455
455
456 $ hg init repo1
456 $ hg init repo1
457 $ hg --config extensions.a=! -R repo1 log
457 $ hg --config extensions.a=! -R repo1 log
458 $ rm -rf $TESTTMP/repo1
458 $ rm -rf $TESTTMP/repo1
459 $ hg --config extensions.a=! init repo1
459 $ hg --config extensions.a=! init repo1
460
460
461 #endif
461 #endif
462
462
463 blackbox should work if repo.ui.log is not called (issue5518)
463 blackbox should work if repo.ui.log is not called (issue5518)
464
464
465 $ cat > $TESTTMP/raise.py << EOF
465 $ cat > $TESTTMP/raise.py << EOF
466 > from __future__ import absolute_import
466 > from __future__ import absolute_import
467 > from mercurial import registrar, scmutil
467 > from mercurial import registrar, scmutil
468 > cmdtable = {}
468 > cmdtable = {}
469 > command = registrar.command(cmdtable)
469 > command = registrar.command(cmdtable)
470 > @command(b'raise')
470 > @command(b'raise')
471 > def raisecmd(*args):
471 > def raisecmd(*args):
472 > raise RuntimeError('raise')
472 > raise RuntimeError('raise')
473 > EOF
473 > EOF
474
474
475 $ cat >> $HGRCPATH << EOF
475 $ cat >> $HGRCPATH << EOF
476 > [blackbox]
476 > [blackbox]
477 > track = commandexception
477 > track = commandexception
478 > [extensions]
478 > [extensions]
479 > raise=$TESTTMP/raise.py
479 > raise=$TESTTMP/raise.py
480 > EOF
480 > EOF
481
481
482 $ hg init $TESTTMP/blackbox-exception-only
482 $ hg init $TESTTMP/blackbox-exception-only
483 $ cd $TESTTMP/blackbox-exception-only
483 $ cd $TESTTMP/blackbox-exception-only
484
484
485 #if chg
485 #if chg
486 (chg exits 255 because it fails to receive an exit code)
486 (chg exits 255 because it fails to receive an exit code)
487 $ hg raise 2>/dev/null
487 $ hg raise 2>/dev/null
488 [255]
488 [255]
489 #else
489 #else
490 (hg exits 1 because Python default exit code for uncaught exception is 1)
490 (hg exits 1 because Python default exit code for uncaught exception is 1)
491 $ hg raise 2>/dev/null
491 $ hg raise 2>/dev/null
492 [1]
492 [1]
493 #endif
493 #endif
494
494
495 $ head -1 .hg/blackbox.log
495 $ head -1 .hg/blackbox.log
496 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension "mock" (version N/A)
496 1970/01/01 00:00:00.000 bob @0000000000000000000000000000000000000000 (5000)> ** Unknown exception encountered with possibly-broken third-party extension "mock" (version N/A)
497 $ tail -2 .hg/blackbox.log
497 $ tail -2 .hg/blackbox.log
498 RuntimeError: raise
498 RuntimeError: raise
499
499
@@ -1,470 +1,470 b''
1
1
2 $ cat << EOF > buggylocking.py
2 $ cat << EOF > buggylocking.py
3 > """A small extension that tests our developer warnings
3 > """A small extension that tests our developer warnings
4 > """
4 > """
5 >
5 >
6 > from mercurial import error, registrar, repair, util
6 > from mercurial import error, registrar, repair, util
7 >
7 >
8 > cmdtable = {}
8 > cmdtable = {}
9 > command = registrar.command(cmdtable)
9 > command = registrar.command(cmdtable)
10 >
10 >
11 > @command(b'buggylocking', [], '')
11 > @command(b'buggylocking', [], '')
12 > def buggylocking(ui, repo):
12 > def buggylocking(ui, repo):
13 > lo = repo.lock()
13 > lo = repo.lock()
14 > wl = repo.wlock()
14 > wl = repo.wlock()
15 > wl.release()
15 > wl.release()
16 > lo.release()
16 > lo.release()
17 >
17 >
18 > @command(b'buggytransaction', [], '')
18 > @command(b'buggytransaction', [], '')
19 > def buggylocking(ui, repo):
19 > def buggylocking(ui, repo):
20 > tr = repo.transaction(b'buggy')
20 > tr = repo.transaction(b'buggy')
21 > # make sure we rollback the transaction as we don't want to rely on the__del__
21 > # make sure we rollback the transaction as we don't want to rely on the__del__
22 > tr.release()
22 > tr.release()
23 >
23 >
24 > @command(b'properlocking', [], '')
24 > @command(b'properlocking', [], '')
25 > def properlocking(ui, repo):
25 > def properlocking(ui, repo):
26 > """check that reentrance is fine"""
26 > """check that reentrance is fine"""
27 > wl = repo.wlock()
27 > wl = repo.wlock()
28 > lo = repo.lock()
28 > lo = repo.lock()
29 > tr = repo.transaction(b'proper')
29 > tr = repo.transaction(b'proper')
30 > tr2 = repo.transaction(b'proper')
30 > tr2 = repo.transaction(b'proper')
31 > lo2 = repo.lock()
31 > lo2 = repo.lock()
32 > wl2 = repo.wlock()
32 > wl2 = repo.wlock()
33 > wl2.release()
33 > wl2.release()
34 > lo2.release()
34 > lo2.release()
35 > tr2.close()
35 > tr2.close()
36 > tr.close()
36 > tr.close()
37 > lo.release()
37 > lo.release()
38 > wl.release()
38 > wl.release()
39 >
39 >
40 > @command(b'nowaitlocking', [], '')
40 > @command(b'nowaitlocking', [], '')
41 > def nowaitlocking(ui, repo):
41 > def nowaitlocking(ui, repo):
42 > lo = repo.lock()
42 > lo = repo.lock()
43 > wl = repo.wlock(wait=False)
43 > wl = repo.wlock(wait=False)
44 > wl.release()
44 > wl.release()
45 > lo.release()
45 > lo.release()
46 >
46 >
47 > @command(b'no-wlock-write', [], '')
47 > @command(b'no-wlock-write', [], '')
48 > def nowlockwrite(ui, repo):
48 > def nowlockwrite(ui, repo):
49 > with repo.vfs(b'branch', b'a'):
49 > with repo.vfs(b'branch', b'a'):
50 > pass
50 > pass
51 >
51 >
52 > @command(b'no-lock-write', [], '')
52 > @command(b'no-lock-write', [], '')
53 > def nolockwrite(ui, repo):
53 > def nolockwrite(ui, repo):
54 > with repo.svfs(b'fncache', b'a'):
54 > with repo.svfs(b'fncache', b'a'):
55 > pass
55 > pass
56 >
56 >
57 > @command(b'stripintr', [], '')
57 > @command(b'stripintr', [], '')
58 > def stripintr(ui, repo):
58 > def stripintr(ui, repo):
59 > lo = repo.lock()
59 > lo = repo.lock()
60 > tr = repo.transaction(b'foobar')
60 > tr = repo.transaction(b'foobar')
61 > try:
61 > try:
62 > repair.strip(repo.ui, repo, [repo[b'.'].node()])
62 > repair.strip(repo.ui, repo, [repo[b'.'].node()])
63 > finally:
63 > finally:
64 > lo.release()
64 > lo.release()
65 > @command(b'oldanddeprecated', [], '')
65 > @command(b'oldanddeprecated', [], '')
66 > def oldanddeprecated(ui, repo):
66 > def oldanddeprecated(ui, repo):
67 > """test deprecation warning API"""
67 > """test deprecation warning API"""
68 > def foobar(ui):
68 > def foobar(ui):
69 > ui.deprecwarn(b'foorbar is deprecated, go shopping', b'42.1337')
69 > ui.deprecwarn(b'foorbar is deprecated, go shopping', b'42.1337')
70 > foobar(ui)
70 > foobar(ui)
71 > @command(b'nouiwarning', [], '')
71 > @command(b'nouiwarning', [], '')
72 > def nouiwarning(ui, repo):
72 > def nouiwarning(ui, repo):
73 > util.nouideprecwarn(b'this is a test', b'13.37')
73 > util.nouideprecwarn(b'this is a test', b'13.37')
74 > @command(b'programmingerror', [], '')
74 > @command(b'programmingerror', [], '')
75 > def programmingerror(ui, repo):
75 > def programmingerror(ui, repo):
76 > raise error.ProgrammingError(b'something went wrong', hint=b'try again')
76 > raise error.ProgrammingError(b'something went wrong', hint=b'try again')
77 > EOF
77 > EOF
78
78
79 $ cat << EOF >> $HGRCPATH
79 $ cat << EOF >> $HGRCPATH
80 > [extensions]
80 > [extensions]
81 > buggylocking=$TESTTMP/buggylocking.py
81 > buggylocking=$TESTTMP/buggylocking.py
82 > mock=$TESTDIR/mockblackbox.py
82 > mock=$TESTDIR/mockblackbox.py
83 > blackbox=
83 > blackbox=
84 > [devel]
84 > [devel]
85 > all-warnings=1
85 > all-warnings=1
86 > [blackbox]
86 > [blackbox]
87 > track = command, commandexception, commandfinish, develwarn
87 > track = command, commandexception, commandfinish, develwarn
88 > EOF
88 > EOF
89
89
90 $ hg init lock-checker
90 $ hg init lock-checker
91 $ cd lock-checker
91 $ cd lock-checker
92 $ hg buggylocking
92 $ hg buggylocking
93 devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
93 devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
94 $ cat << EOF >> $HGRCPATH
94 $ cat << EOF >> $HGRCPATH
95 > [devel]
95 > [devel]
96 > all=0
96 > all=0
97 > check-locks=1
97 > check-locks=1
98 > EOF
98 > EOF
99 $ hg buggylocking
99 $ hg buggylocking
100 devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
100 devel-warn: "wlock" acquired after "lock" at: $TESTTMP/buggylocking.py:* (buggylocking) (glob)
101 #if no-chg no-pyoxidizer
101 #if no-chg no-pyoxidizer
102 $ hg buggylocking --traceback
102 $ hg buggylocking --traceback
103 devel-warn: "wlock" acquired after "lock" at:
103 devel-warn: "wlock" acquired after "lock" at:
104 */hg:* in <module> (glob) (?)
104 */hg:* in <module> (glob) (?)
105 */mercurial/dispatch.py:* in run (glob)
105 */mercurial/dispatch.py:* in run (glob)
106 */mercurial/dispatch.py:* in dispatch (glob)
106 */mercurial/dispatch.py:* in dispatch (glob)
107 */mercurial/dispatch.py:* in _rundispatch (glob)
107 */mercurial/dispatch.py:* in _rundispatch (glob)
108 */mercurial/dispatch.py:* in _runcatch (glob)
108 */mercurial/dispatch.py:* in _runcatch (glob)
109 */mercurial/dispatch.py:* in _callcatch (glob)
109 */mercurial/dispatch.py:* in _callcatch (glob)
110 */mercurial/scmutil.py* in callcatch (glob)
110 */mercurial/scmutil.py* in callcatch (glob)
111 */mercurial/dispatch.py:* in _runcatchfunc (glob)
111 */mercurial/dispatch.py:* in _runcatchfunc (glob)
112 */mercurial/dispatch.py:* in _dispatch (glob)
112 */mercurial/dispatch.py:* in _dispatch (glob)
113 */mercurial/dispatch.py:* in runcommand (glob)
113 */mercurial/dispatch.py:* in runcommand (glob)
114 */mercurial/dispatch.py:* in _runcommand (glob)
114 */mercurial/dispatch.py:* in _runcommand (glob)
115 */mercurial/dispatch.py:* in <lambda> (glob)
115 */mercurial/dispatch.py:* in <lambda> (glob)
116 */mercurial/util.py:* in check (glob)
116 */mercurial/util.py:* in check (glob)
117 $TESTTMP/buggylocking.py:* in buggylocking (glob)
117 $TESTTMP/buggylocking.py:* in buggylocking (glob)
118 #endif
118 #endif
119 #if chg no-pyoxidizer
119 #if chg no-pyoxidizer
120 $ hg buggylocking --traceback
120 $ hg buggylocking --traceback
121 devel-warn: "wlock" acquired after "lock" at:
121 devel-warn: "wlock" acquired after "lock" at:
122 */hg:* in <module> (glob) (?)
122 */hg:* in <module> (glob) (?)
123 */mercurial/dispatch.py:* in run (glob)
123 */mercurial/dispatch.py:* in run (glob)
124 */mercurial/dispatch.py:* in dispatch (glob)
124 */mercurial/dispatch.py:* in dispatch (glob)
125 */mercurial/dispatch.py:* in _rundispatch (glob)
125 */mercurial/dispatch.py:* in _rundispatch (glob)
126 */mercurial/dispatch.py:* in _runcatch (glob)
126 */mercurial/dispatch.py:* in _runcatch (glob)
127 */mercurial/dispatch.py:* in _callcatch (glob)
127 */mercurial/dispatch.py:* in _callcatch (glob)
128 */mercurial/scmutil.py:* in callcatch (glob)
128 */mercurial/scmutil.py:* in callcatch (glob)
129 */mercurial/dispatch.py:* in _runcatchfunc (glob)
129 */mercurial/dispatch.py:* in _runcatchfunc (glob)
130 */mercurial/dispatch.py:* in _dispatch (glob)
130 */mercurial/dispatch.py:* in _dispatch (glob)
131 */mercurial/dispatch.py:* in runcommand (glob)
131 */mercurial/dispatch.py:* in runcommand (glob)
132 */mercurial/dispatch.py:* in _runcommand (glob)
132 */mercurial/dispatch.py:* in _runcommand (glob)
133 */mercurial/dispatch.py:* in <lambda> (glob)
133 */mercurial/dispatch.py:* in <lambda> (glob)
134 */mercurial/util.py:* in check (glob)
134 */mercurial/util.py:* in check (glob)
135 */mercurial/commands.py:* in serve (glob)
135 */mercurial/commands.py:* in serve (glob)
136 */mercurial/server.py:* in runservice (glob)
136 */mercurial/server.py:* in runservice (glob)
137 */mercurial/commandserver.py:* in run (glob)
137 */mercurial/commandserver.py:* in run (glob)
138 */mercurial/commandserver.py:* in _mainloop (glob)
138 */mercurial/commandserver.py:* in _mainloop (glob)
139 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
139 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
140 */mercurial/commandserver.py:* in _runworker (glob)
140 */mercurial/commandserver.py:* in _runworker (glob)
141 */mercurial/commandserver.py:* in _serverequest (glob)
141 */mercurial/commandserver.py:* in _serverequest (glob)
142 */mercurial/commandserver.py:* in serve (glob)
142 */mercurial/commandserver.py:* in serve (glob)
143 */mercurial/commandserver.py:* in serveone (glob)
143 */mercurial/commandserver.py:* in serveone (glob)
144 */mercurial/chgserver.py:* in runcommand (glob)
144 */mercurial/chgserver.py:* in runcommand (glob)
145 */mercurial/commandserver.py:* in runcommand (glob)
145 */mercurial/commandserver.py:* in runcommand (glob)
146 */mercurial/commandserver.py:* in _dispatchcommand (glob)
146 */mercurial/commandserver.py:* in _dispatchcommand (glob)
147 */mercurial/dispatch.py:* in dispatch (glob)
147 */mercurial/dispatch.py:* in dispatch (glob)
148 */mercurial/dispatch.py:* in _rundispatch (glob)
148 */mercurial/dispatch.py:* in _rundispatch (glob)
149 */mercurial/dispatch.py:* in _runcatch (glob)
149 */mercurial/dispatch.py:* in _runcatch (glob)
150 */mercurial/dispatch.py:* in _callcatch (glob)
150 */mercurial/dispatch.py:* in _callcatch (glob)
151 */mercurial/scmutil.py:* in callcatch (glob)
151 */mercurial/scmutil.py:* in callcatch (glob)
152 */mercurial/dispatch.py:* in _runcatchfunc (glob)
152 */mercurial/dispatch.py:* in _runcatchfunc (glob)
153 */mercurial/dispatch.py:* in _dispatch (glob)
153 */mercurial/dispatch.py:* in _dispatch (glob)
154 */mercurial/dispatch.py:* in runcommand (glob)
154 */mercurial/dispatch.py:* in runcommand (glob)
155 */mercurial/dispatch.py:* in _runcommand (glob)
155 */mercurial/dispatch.py:* in _runcommand (glob)
156 */mercurial/dispatch.py:* in <lambda> (glob)
156 */mercurial/dispatch.py:* in <lambda> (glob)
157 */mercurial/util.py:* in check (glob)
157 */mercurial/util.py:* in check (glob)
158 $TESTTMP/buggylocking.py:* in buggylocking (glob)
158 $TESTTMP/buggylocking.py:* in buggylocking (glob)
159 #endif
159 #endif
160 #if pyoxidizer
160 #if pyoxidizer
161 $ hg buggylocking --traceback
161 $ hg buggylocking --traceback
162 devel-warn: "wlock" acquired after "lock" at:
162 devel-warn: "wlock" acquired after "lock" at:
163 <string>:* (glob)
163 <string>:* (glob)
164 mercurial.dispatch:* in run (glob)
164 mercurial.dispatch:* in run (glob)
165 mercurial.dispatch:* in dispatch (glob)
165 mercurial.dispatch:* in dispatch (glob)
166 mercurial.dispatch:* in _rundispatch (glob)
166 mercurial.dispatch:* in _rundispatch (glob)
167 mercurial.dispatch:* in _runcatch (glob)
167 mercurial.dispatch:* in _runcatch (glob)
168 mercurial.dispatch:* in _callcatch (glob)
168 mercurial.dispatch:* in _callcatch (glob)
169 mercurial.scmutil:* in callcatch (glob)
169 mercurial.scmutil:* in callcatch (glob)
170 mercurial.dispatch:* in _runcatchfunc (glob)
170 mercurial.dispatch:* in _runcatchfunc (glob)
171 mercurial.dispatch:* in _dispatch (glob)
171 mercurial.dispatch:* in _dispatch (glob)
172 mercurial.dispatch:* in runcommand (glob)
172 mercurial.dispatch:* in runcommand (glob)
173 mercurial.dispatch:* in _runcommand (glob)
173 mercurial.dispatch:* in _runcommand (glob)
174 mercurial.dispatch:* in <lambda> (glob)
174 mercurial.dispatch:* in <lambda> (glob)
175 mercurial.util:* in check (glob)
175 mercurial.util:* in check (glob)
176 $TESTTMP/buggylocking.py:* in buggylocking (glob)
176 $TESTTMP/buggylocking.py:* in buggylocking (glob)
177 #endif
177 #endif
178 $ hg properlocking
178 $ hg properlocking
179 $ hg nowaitlocking
179 $ hg nowaitlocking
180
180
181 Writing without lock
181 Writing without lock
182
182
183 $ hg no-wlock-write
183 $ hg no-wlock-write
184 devel-warn: write with no wlock: "branch" at: $TESTTMP/buggylocking.py:* (nowlockwrite) (glob)
184 devel-warn: write with no wlock: "branch" at: $TESTTMP/buggylocking.py:* (nowlockwrite) (glob)
185
185
186 $ hg no-lock-write
186 $ hg no-lock-write
187 devel-warn: write with no lock: "fncache" at: $TESTTMP/buggylocking.py:* (nolockwrite) (glob)
187 devel-warn: write with no lock: "fncache" at: $TESTTMP/buggylocking.py:* (nolockwrite) (glob)
188
188
189 Stripping from a transaction
189 Stripping from a transaction
190
190
191 $ echo a > a
191 $ echo a > a
192 $ hg add a
192 $ hg add a
193 $ hg commit -m a
193 $ hg commit -m a
194 $ hg stripintr 2>&1 | egrep -v '^(\*\*| )'
194 $ hg stripintr 2>&1 | egrep -v '^(\*\*| )'
195 Traceback (most recent call last):
195 Traceback (most recent call last):
196 *ProgrammingError: cannot strip from inside a transaction (glob)
196 *ProgrammingError: cannot strip from inside a transaction (glob)
197
197
198 $ hg oldanddeprecated
198 $ hg oldanddeprecated
199 devel-warn: foorbar is deprecated, go shopping
199 devel-warn: foorbar is deprecated, go shopping
200 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
200 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
201
201
202 #if no-chg no-pyoxidizer
202 #if no-chg no-pyoxidizer
203 $ hg oldanddeprecated --traceback
203 $ hg oldanddeprecated --traceback
204 devel-warn: foorbar is deprecated, go shopping
204 devel-warn: foorbar is deprecated, go shopping
205 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
205 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
206 */hg:* in <module> (glob) (?)
206 */hg:* in <module> (glob) (?)
207 */mercurial/dispatch.py:* in run (glob)
207 */mercurial/dispatch.py:* in run (glob)
208 */mercurial/dispatch.py:* in dispatch (glob)
208 */mercurial/dispatch.py:* in dispatch (glob)
209 */mercurial/dispatch.py:* in _rundispatch (glob)
209 */mercurial/dispatch.py:* in _rundispatch (glob)
210 */mercurial/dispatch.py:* in _runcatch (glob)
210 */mercurial/dispatch.py:* in _runcatch (glob)
211 */mercurial/dispatch.py:* in _callcatch (glob)
211 */mercurial/dispatch.py:* in _callcatch (glob)
212 */mercurial/scmutil.py* in callcatch (glob)
212 */mercurial/scmutil.py* in callcatch (glob)
213 */mercurial/dispatch.py:* in _runcatchfunc (glob)
213 */mercurial/dispatch.py:* in _runcatchfunc (glob)
214 */mercurial/dispatch.py:* in _dispatch (glob)
214 */mercurial/dispatch.py:* in _dispatch (glob)
215 */mercurial/dispatch.py:* in runcommand (glob)
215 */mercurial/dispatch.py:* in runcommand (glob)
216 */mercurial/dispatch.py:* in _runcommand (glob)
216 */mercurial/dispatch.py:* in _runcommand (glob)
217 */mercurial/dispatch.py:* in <lambda> (glob)
217 */mercurial/dispatch.py:* in <lambda> (glob)
218 */mercurial/util.py:* in check (glob)
218 */mercurial/util.py:* in check (glob)
219 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
219 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
220 #endif
220 #endif
221 #if chg no-pyoxidizer
221 #if chg no-pyoxidizer
222 $ hg oldanddeprecated --traceback
222 $ hg oldanddeprecated --traceback
223 devel-warn: foorbar is deprecated, go shopping
223 devel-warn: foorbar is deprecated, go shopping
224 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
224 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
225 */hg:* in <module> (glob)
225 */hg:* in <module> (glob)
226 */mercurial/dispatch.py:* in run (glob)
226 */mercurial/dispatch.py:* in run (glob)
227 */mercurial/dispatch.py:* in dispatch (glob)
227 */mercurial/dispatch.py:* in dispatch (glob)
228 */mercurial/dispatch.py:* in _rundispatch (glob)
228 */mercurial/dispatch.py:* in _rundispatch (glob)
229 */mercurial/dispatch.py:* in _runcatch (glob)
229 */mercurial/dispatch.py:* in _runcatch (glob)
230 */mercurial/dispatch.py:* in _callcatch (glob)
230 */mercurial/dispatch.py:* in _callcatch (glob)
231 */mercurial/scmutil.py:* in callcatch (glob)
231 */mercurial/scmutil.py:* in callcatch (glob)
232 */mercurial/dispatch.py:* in _runcatchfunc (glob)
232 */mercurial/dispatch.py:* in _runcatchfunc (glob)
233 */mercurial/dispatch.py:* in _dispatch (glob)
233 */mercurial/dispatch.py:* in _dispatch (glob)
234 */mercurial/dispatch.py:* in runcommand (glob)
234 */mercurial/dispatch.py:* in runcommand (glob)
235 */mercurial/dispatch.py:* in _runcommand (glob)
235 */mercurial/dispatch.py:* in _runcommand (glob)
236 */mercurial/dispatch.py:* in <lambda> (glob)
236 */mercurial/dispatch.py:* in <lambda> (glob)
237 */mercurial/util.py:* in check (glob)
237 */mercurial/util.py:* in check (glob)
238 */mercurial/commands.py:* in serve (glob)
238 */mercurial/commands.py:* in serve (glob)
239 */mercurial/server.py:* in runservice (glob)
239 */mercurial/server.py:* in runservice (glob)
240 */mercurial/commandserver.py:* in run (glob)
240 */mercurial/commandserver.py:* in run (glob)
241 */mercurial/commandserver.py:* in _mainloop (glob)
241 */mercurial/commandserver.py:* in _mainloop (glob)
242 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
242 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
243 */mercurial/commandserver.py:* in _runworker (glob)
243 */mercurial/commandserver.py:* in _runworker (glob)
244 */mercurial/commandserver.py:* in _serverequest (glob)
244 */mercurial/commandserver.py:* in _serverequest (glob)
245 */mercurial/commandserver.py:* in serve (glob)
245 */mercurial/commandserver.py:* in serve (glob)
246 */mercurial/commandserver.py:* in serveone (glob)
246 */mercurial/commandserver.py:* in serveone (glob)
247 */mercurial/chgserver.py:* in runcommand (glob)
247 */mercurial/chgserver.py:* in runcommand (glob)
248 */mercurial/commandserver.py:* in runcommand (glob)
248 */mercurial/commandserver.py:* in runcommand (glob)
249 */mercurial/commandserver.py:* in _dispatchcommand (glob)
249 */mercurial/commandserver.py:* in _dispatchcommand (glob)
250 */mercurial/dispatch.py:* in dispatch (glob)
250 */mercurial/dispatch.py:* in dispatch (glob)
251 */mercurial/dispatch.py:* in _rundispatch (glob)
251 */mercurial/dispatch.py:* in _rundispatch (glob)
252 */mercurial/dispatch.py:* in _runcatch (glob)
252 */mercurial/dispatch.py:* in _runcatch (glob)
253 */mercurial/dispatch.py:* in _callcatch (glob)
253 */mercurial/dispatch.py:* in _callcatch (glob)
254 */mercurial/scmutil.py:* in callcatch (glob)
254 */mercurial/scmutil.py:* in callcatch (glob)
255 */mercurial/dispatch.py:* in _runcatchfunc (glob)
255 */mercurial/dispatch.py:* in _runcatchfunc (glob)
256 */mercurial/dispatch.py:* in _dispatch (glob)
256 */mercurial/dispatch.py:* in _dispatch (glob)
257 */mercurial/dispatch.py:* in runcommand (glob)
257 */mercurial/dispatch.py:* in runcommand (glob)
258 */mercurial/dispatch.py:* in _runcommand (glob)
258 */mercurial/dispatch.py:* in _runcommand (glob)
259 */mercurial/dispatch.py:* in <lambda> (glob)
259 */mercurial/dispatch.py:* in <lambda> (glob)
260 */mercurial/util.py:* in check (glob)
260 */mercurial/util.py:* in check (glob)
261 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
261 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
262 #endif
262 #endif
263 #if pyoxidizer
263 #if pyoxidizer
264 $ hg oldanddeprecated --traceback
264 $ hg oldanddeprecated --traceback
265 devel-warn: foorbar is deprecated, go shopping
265 devel-warn: foorbar is deprecated, go shopping
266 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
266 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
267 <string>:* (glob)
267 <string>:* (glob)
268 mercurial.dispatch:* in run (glob)
268 mercurial.dispatch:* in run (glob)
269 mercurial.dispatch:* in dispatch (glob)
269 mercurial.dispatch:* in dispatch (glob)
270 mercurial.dispatch:* in _rundispatch (glob)
270 mercurial.dispatch:* in _rundispatch (glob)
271 mercurial.dispatch:* in _runcatch (glob)
271 mercurial.dispatch:* in _runcatch (glob)
272 mercurial.dispatch:* in _callcatch (glob)
272 mercurial.dispatch:* in _callcatch (glob)
273 mercurial.scmutil:* in callcatch (glob)
273 mercurial.scmutil:* in callcatch (glob)
274 mercurial.dispatch:* in _runcatchfunc (glob)
274 mercurial.dispatch:* in _runcatchfunc (glob)
275 mercurial.dispatch:* in _dispatch (glob)
275 mercurial.dispatch:* in _dispatch (glob)
276 mercurial.dispatch:* in runcommand (glob)
276 mercurial.dispatch:* in runcommand (glob)
277 mercurial.dispatch:* in _runcommand (glob)
277 mercurial.dispatch:* in _runcommand (glob)
278 mercurial.dispatch:* in <lambda> (glob)
278 mercurial.dispatch:* in <lambda> (glob)
279 mercurial.util:* in check (glob)
279 mercurial.util:* in check (glob)
280 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
280 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
281 #endif
281 #endif
282
282
283 #if no-chg no-pyoxidizer
283 #if no-chg no-pyoxidizer
284 $ hg blackbox -l 7
284 $ hg blackbox -l 7
285 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
285 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
286 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
286 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
287 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
287 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
288 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
288 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
289 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
289 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
290 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
290 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
291 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
291 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
292 */hg:* in <module> (glob) (?)
292 */hg:* in <module> (glob) (?)
293 */mercurial/dispatch.py:* in run (glob)
293 */mercurial/dispatch.py:* in run (glob)
294 */mercurial/dispatch.py:* in dispatch (glob)
294 */mercurial/dispatch.py:* in dispatch (glob)
295 */mercurial/dispatch.py:* in _rundispatch (glob)
295 */mercurial/dispatch.py:* in _rundispatch (glob)
296 */mercurial/dispatch.py:* in _runcatch (glob)
296 */mercurial/dispatch.py:* in _runcatch (glob)
297 */mercurial/dispatch.py:* in _callcatch (glob)
297 */mercurial/dispatch.py:* in _callcatch (glob)
298 */mercurial/scmutil.py* in callcatch (glob)
298 */mercurial/scmutil.py* in callcatch (glob)
299 */mercurial/dispatch.py:* in _runcatchfunc (glob)
299 */mercurial/dispatch.py:* in _runcatchfunc (glob)
300 */mercurial/dispatch.py:* in _dispatch (glob)
300 */mercurial/dispatch.py:* in _dispatch (glob)
301 */mercurial/dispatch.py:* in runcommand (glob)
301 */mercurial/dispatch.py:* in runcommand (glob)
302 */mercurial/dispatch.py:* in _runcommand (glob)
302 */mercurial/dispatch.py:* in _runcommand (glob)
303 */mercurial/dispatch.py:* in <lambda> (glob)
303 */mercurial/dispatch.py:* in <lambda> (glob)
304 */mercurial/util.py:* in check (glob)
304 */mercurial/util.py:* in check (glob)
305 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
305 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
306 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
306 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
307 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
307 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
308 #endif
308 #endif
309 #if chg no-pyoxidizer
309 #if chg no-pyoxidizer
310 $ hg blackbox -l 7
310 $ hg blackbox -l 7
311 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
311 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
312 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
312 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
313 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
313 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
314 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
314 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
315 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
315 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
316 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
316 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
317 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
317 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
318 */hg:* in <module> (glob)
318 */hg:* in <module> (glob)
319 */mercurial/dispatch.py:* in run (glob)
319 */mercurial/dispatch.py:* in run (glob)
320 */mercurial/dispatch.py:* in dispatch (glob)
320 */mercurial/dispatch.py:* in dispatch (glob)
321 */mercurial/dispatch.py:* in _rundispatch (glob)
321 */mercurial/dispatch.py:* in _rundispatch (glob)
322 */mercurial/dispatch.py:* in _runcatch (glob)
322 */mercurial/dispatch.py:* in _runcatch (glob)
323 */mercurial/dispatch.py:* in _callcatch (glob)
323 */mercurial/dispatch.py:* in _callcatch (glob)
324 */mercurial/scmutil.py:* in callcatch (glob)
324 */mercurial/scmutil.py:* in callcatch (glob)
325 */mercurial/dispatch.py:* in _runcatchfunc (glob)
325 */mercurial/dispatch.py:* in _runcatchfunc (glob)
326 */mercurial/dispatch.py:* in _dispatch (glob)
326 */mercurial/dispatch.py:* in _dispatch (glob)
327 */mercurial/dispatch.py:* in runcommand (glob)
327 */mercurial/dispatch.py:* in runcommand (glob)
328 */mercurial/dispatch.py:* in _runcommand (glob)
328 */mercurial/dispatch.py:* in _runcommand (glob)
329 */mercurial/dispatch.py:* in <lambda> (glob)
329 */mercurial/dispatch.py:* in <lambda> (glob)
330 */mercurial/util.py:* in check (glob)
330 */mercurial/util.py:* in check (glob)
331 */mercurial/commands.py:* in serve (glob)
331 */mercurial/commands.py:* in serve (glob)
332 */mercurial/server.py:* in runservice (glob)
332 */mercurial/server.py:* in runservice (glob)
333 */mercurial/commandserver.py:* in run (glob)
333 */mercurial/commandserver.py:* in run (glob)
334 */mercurial/commandserver.py:* in _mainloop (glob)
334 */mercurial/commandserver.py:* in _mainloop (glob)
335 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
335 */mercurial/commandserver.py:* in _acceptnewconnection (glob)
336 */mercurial/commandserver.py:* in _runworker (glob)
336 */mercurial/commandserver.py:* in _runworker (glob)
337 */mercurial/commandserver.py:* in _serverequest (glob)
337 */mercurial/commandserver.py:* in _serverequest (glob)
338 */mercurial/commandserver.py:* in serve (glob)
338 */mercurial/commandserver.py:* in serve (glob)
339 */mercurial/commandserver.py:* in serveone (glob)
339 */mercurial/commandserver.py:* in serveone (glob)
340 */mercurial/chgserver.py:* in runcommand (glob)
340 */mercurial/chgserver.py:* in runcommand (glob)
341 */mercurial/commandserver.py:* in runcommand (glob)
341 */mercurial/commandserver.py:* in runcommand (glob)
342 */mercurial/commandserver.py:* in _dispatchcommand (glob)
342 */mercurial/commandserver.py:* in _dispatchcommand (glob)
343 */mercurial/dispatch.py:* in dispatch (glob)
343 */mercurial/dispatch.py:* in dispatch (glob)
344 */mercurial/dispatch.py:* in _rundispatch (glob)
344 */mercurial/dispatch.py:* in _rundispatch (glob)
345 */mercurial/dispatch.py:* in _runcatch (glob)
345 */mercurial/dispatch.py:* in _runcatch (glob)
346 */mercurial/dispatch.py:* in _callcatch (glob)
346 */mercurial/dispatch.py:* in _callcatch (glob)
347 */mercurial/scmutil.py:* in callcatch (glob)
347 */mercurial/scmutil.py:* in callcatch (glob)
348 */mercurial/dispatch.py:* in _runcatchfunc (glob)
348 */mercurial/dispatch.py:* in _runcatchfunc (glob)
349 */mercurial/dispatch.py:* in _dispatch (glob)
349 */mercurial/dispatch.py:* in _dispatch (glob)
350 */mercurial/dispatch.py:* in runcommand (glob)
350 */mercurial/dispatch.py:* in runcommand (glob)
351 */mercurial/dispatch.py:* in _runcommand (glob)
351 */mercurial/dispatch.py:* in _runcommand (glob)
352 */mercurial/dispatch.py:* in <lambda> (glob)
352 */mercurial/dispatch.py:* in <lambda> (glob)
353 */mercurial/util.py:* in check (glob)
353 */mercurial/util.py:* in check (glob)
354 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
354 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
355 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
355 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
356 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
356 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
357 #endif
357 #endif
358 #if pyoxidizer
358 #if pyoxidizer
359 $ hg blackbox -l 7
359 $ hg blackbox -l 7
360 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
360 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated
361 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
361 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
362 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
362 (compatibility will be dropped after Mercurial-42.1337, update your code.) at: $TESTTMP/buggylocking.py:* (oldanddeprecated) (glob)
363 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
363 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated exited 0 after * seconds (glob)
364 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
364 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback
365 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
365 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> devel-warn: foorbar is deprecated, go shopping
366 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
366 (compatibility will be dropped after Mercurial-42.1337, update your code.) at:
367 <string>:* in <module> (glob)
367 <string>:* in <module> (glob)
368 mercurial.dispatch:* in run (glob)
368 mercurial.dispatch:* in run (glob)
369 mercurial.dispatch:* in dispatch (glob)
369 mercurial.dispatch:* in dispatch (glob)
370 mercurial.dispatch:* in _rundispatch (glob)
370 mercurial.dispatch:* in _rundispatch (glob)
371 mercurial.dispatch:* in _runcatch (glob)
371 mercurial.dispatch:* in _runcatch (glob)
372 mercurial.dispatch:* in _callcatch (glob)
372 mercurial.dispatch:* in _callcatch (glob)
373 mercurial.scmutil* in callcatch (glob)
373 mercurial.scmutil* in callcatch (glob)
374 mercurial.dispatch:* in _runcatchfunc (glob)
374 mercurial.dispatch:* in _runcatchfunc (glob)
375 mercurial.dispatch:* in _dispatch (glob)
375 mercurial.dispatch:* in _dispatch (glob)
376 mercurial.dispatch:* in runcommand (glob)
376 mercurial.dispatch:* in runcommand (glob)
377 mercurial.dispatch:* in _runcommand (glob)
377 mercurial.dispatch:* in _runcommand (glob)
378 mercurial.dispatch:* in <lambda> (glob)
378 mercurial.dispatch:* in <lambda> (glob)
379 mercurial.util:* in check (glob)
379 mercurial.util:* in check (glob)
380 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
380 $TESTTMP/buggylocking.py:* in oldanddeprecated (glob)
381 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
381 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> oldanddeprecated --traceback exited 0 after * seconds (glob)
382 1970/01/01 00:00:00 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
382 1970/01/01 00:00:00.000 bob @cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b (5000)> blackbox -l 7
383 #endif
383 #endif
384
384
385 Test programming error failure:
385 Test programming error failure:
386
386
387 $ hg buggytransaction 2>&1 | egrep -v '^ '
387 $ hg buggytransaction 2>&1 | egrep -v '^ '
388 ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
388 ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
389 ** which supports versions unknown of Mercurial.
389 ** which supports versions unknown of Mercurial.
390 ** Please disable "buggylocking" and try your action again.
390 ** Please disable "buggylocking" and try your action again.
391 ** If that fixes the bug please report it to the extension author.
391 ** If that fixes the bug please report it to the extension author.
392 ** Python * (glob)
392 ** Python * (glob)
393 ** Mercurial Distributed SCM (*) (glob)
393 ** Mercurial Distributed SCM (*) (glob)
394 ** Extensions loaded: * (glob)
394 ** Extensions loaded: * (glob)
395 ** ProgrammingError: transaction requires locking
395 ** ProgrammingError: transaction requires locking
396 Traceback (most recent call last):
396 Traceback (most recent call last):
397 *ProgrammingError: transaction requires locking (glob)
397 *ProgrammingError: transaction requires locking (glob)
398
398
399 $ hg programmingerror 2>&1 | egrep -v '^ '
399 $ hg programmingerror 2>&1 | egrep -v '^ '
400 ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
400 ** Unknown exception encountered with possibly-broken third-party extension "buggylocking" (version N/A)
401 ** which supports versions unknown of Mercurial.
401 ** which supports versions unknown of Mercurial.
402 ** Please disable "buggylocking" and try your action again.
402 ** Please disable "buggylocking" and try your action again.
403 ** If that fixes the bug please report it to the extension author.
403 ** If that fixes the bug please report it to the extension author.
404 ** Python * (glob)
404 ** Python * (glob)
405 ** Mercurial Distributed SCM (*) (glob)
405 ** Mercurial Distributed SCM (*) (glob)
406 ** Extensions loaded: * (glob)
406 ** Extensions loaded: * (glob)
407 ** ProgrammingError: something went wrong
407 ** ProgrammingError: something went wrong
408 ** (try again)
408 ** (try again)
409 Traceback (most recent call last):
409 Traceback (most recent call last):
410 *ProgrammingError: something went wrong (glob)
410 *ProgrammingError: something went wrong (glob)
411
411
412 Old style deprecation warning
412 Old style deprecation warning
413
413
414 $ hg nouiwarning
414 $ hg nouiwarning
415 $TESTTMP/buggylocking.py:*: DeprecationWarning: this is a test (glob)
415 $TESTTMP/buggylocking.py:*: DeprecationWarning: this is a test (glob)
416 (compatibility will be dropped after Mercurial-13.37, update your code.)
416 (compatibility will be dropped after Mercurial-13.37, update your code.)
417 util.nouideprecwarn(b'this is a test', b'13.37')
417 util.nouideprecwarn(b'this is a test', b'13.37')
418
418
419 (disabled outside of test run)
419 (disabled outside of test run)
420
420
421 $ HGEMITWARNINGS= hg nouiwarning
421 $ HGEMITWARNINGS= hg nouiwarning
422
422
423 Test warning on config option access and registration
423 Test warning on config option access and registration
424
424
425 $ cat << EOF > ${TESTTMP}/buggyconfig.py
425 $ cat << EOF > ${TESTTMP}/buggyconfig.py
426 > """A small extension that tests our developer warnings for config"""
426 > """A small extension that tests our developer warnings for config"""
427 >
427 >
428 > from mercurial import configitems, registrar
428 > from mercurial import configitems, registrar
429 >
429 >
430 > cmdtable = {}
430 > cmdtable = {}
431 > command = registrar.command(cmdtable)
431 > command = registrar.command(cmdtable)
432 >
432 >
433 > configtable = {}
433 > configtable = {}
434 > configitem = registrar.configitem(configtable)
434 > configitem = registrar.configitem(configtable)
435 >
435 >
436 > configitem(b'test', b'some', default=b'foo')
436 > configitem(b'test', b'some', default=b'foo')
437 > configitem(b'test', b'dynamic', default=configitems.dynamicdefault)
437 > configitem(b'test', b'dynamic', default=configitems.dynamicdefault)
438 > configitem(b'test', b'callable', default=list)
438 > configitem(b'test', b'callable', default=list)
439 > # overwrite a core config
439 > # overwrite a core config
440 > configitem(b'ui', b'quiet', default=False)
440 > configitem(b'ui', b'quiet', default=False)
441 > configitem(b'ui', b'interactive', default=None)
441 > configitem(b'ui', b'interactive', default=None)
442 >
442 >
443 > @command(b'buggyconfig')
443 > @command(b'buggyconfig')
444 > def cmdbuggyconfig(ui, repo):
444 > def cmdbuggyconfig(ui, repo):
445 > repo.ui.config(b'ui', b'quiet', True)
445 > repo.ui.config(b'ui', b'quiet', True)
446 > repo.ui.config(b'ui', b'interactive', False)
446 > repo.ui.config(b'ui', b'interactive', False)
447 > repo.ui.config(b'test', b'some', b'bar')
447 > repo.ui.config(b'test', b'some', b'bar')
448 > repo.ui.config(b'test', b'some', b'foo')
448 > repo.ui.config(b'test', b'some', b'foo')
449 > repo.ui.config(b'test', b'dynamic', b'some-required-default')
449 > repo.ui.config(b'test', b'dynamic', b'some-required-default')
450 > repo.ui.config(b'test', b'dynamic')
450 > repo.ui.config(b'test', b'dynamic')
451 > repo.ui.config(b'test', b'callable', [])
451 > repo.ui.config(b'test', b'callable', [])
452 > repo.ui.config(b'test', b'callable', b'foo')
452 > repo.ui.config(b'test', b'callable', b'foo')
453 > repo.ui.config(b'test', b'unregistered')
453 > repo.ui.config(b'test', b'unregistered')
454 > repo.ui.config(b'unregistered', b'unregistered')
454 > repo.ui.config(b'unregistered', b'unregistered')
455 > EOF
455 > EOF
456
456
457 $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig
457 $ hg --config "extensions.buggyconfig=${TESTTMP}/buggyconfig.py" buggyconfig
458 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: */mercurial/extensions.py:* (_loadextra) (glob) (no-pyoxidizer !)
458 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: */mercurial/extensions.py:* (_loadextra) (glob) (no-pyoxidizer !)
459 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: */mercurial/extensions.py:* (_loadextra) (glob) (no-pyoxidizer !)
459 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: */mercurial/extensions.py:* (_loadextra) (glob) (no-pyoxidizer !)
460 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: mercurial.extensions:* (_loadextra) (glob) (pyoxidizer !)
460 devel-warn: extension 'buggyconfig' overwrite config item 'ui.interactive' at: mercurial.extensions:* (_loadextra) (glob) (pyoxidizer !)
461 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: mercurial.extensions:* (_loadextra) (glob) (pyoxidizer !)
461 devel-warn: extension 'buggyconfig' overwrite config item 'ui.quiet' at: mercurial.extensions:* (_loadextra) (glob) (pyoxidizer !)
462 devel-warn: specifying a mismatched default value for a registered config item: 'ui.quiet' 'True' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
462 devel-warn: specifying a mismatched default value for a registered config item: 'ui.quiet' 'True' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
463 devel-warn: specifying a mismatched default value for a registered config item: 'ui.interactive' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
463 devel-warn: specifying a mismatched default value for a registered config item: 'ui.interactive' 'False' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
464 devel-warn: specifying a mismatched default value for a registered config item: 'test.some' 'bar' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
464 devel-warn: specifying a mismatched default value for a registered config item: 'test.some' 'bar' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
465 devel-warn: config item requires an explicit default value: 'test.dynamic' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
465 devel-warn: config item requires an explicit default value: 'test.dynamic' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
466 devel-warn: specifying a mismatched default value for a registered config item: 'test.callable' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
466 devel-warn: specifying a mismatched default value for a registered config item: 'test.callable' 'foo' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
467 devel-warn: accessing unregistered config item: 'test.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
467 devel-warn: accessing unregistered config item: 'test.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
468 devel-warn: accessing unregistered config item: 'unregistered.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
468 devel-warn: accessing unregistered config item: 'unregistered.unregistered' at: $TESTTMP/buggyconfig.py:* (cmdbuggyconfig) (glob)
469
469
470 $ cd ..
470 $ cd ..
@@ -1,125 +1,125 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
2 > [extensions]
3 > blackbox=
3 > blackbox=
4 > rebase=
4 > rebase=
5 > mock=$TESTDIR/mockblackbox.py
5 > mock=$TESTDIR/mockblackbox.py
6 >
6 >
7 > [blackbox]
7 > [blackbox]
8 > track = command, commandfinish, tagscache
8 > track = command, commandfinish, tagscache
9 >
9 >
10 > [experimental]
10 > [experimental]
11 > evolution.createmarkers=True
11 > evolution.createmarkers=True
12 > EOF
12 > EOF
13
13
14 Create a repo with some tags
14 Create a repo with some tags
15
15
16 $ hg init repo
16 $ hg init repo
17 $ cd repo
17 $ cd repo
18 $ echo initial > foo
18 $ echo initial > foo
19 $ hg -q commit -A -m initial
19 $ hg -q commit -A -m initial
20 $ hg tag -m 'test tag' test1
20 $ hg tag -m 'test tag' test1
21 $ echo first > first
21 $ echo first > first
22 $ hg -q commit -A -m first
22 $ hg -q commit -A -m first
23 $ hg tag -m 'test2 tag' test2
23 $ hg tag -m 'test2 tag' test2
24 $ hg -q up -r 0
24 $ hg -q up -r 0
25 $ echo newhead > newhead
25 $ echo newhead > newhead
26 $ hg commit -A -m newhead
26 $ hg commit -A -m newhead
27 adding newhead
27 adding newhead
28 created new head
28 created new head
29 $ hg tag -m 'test head 2 tag' head2
29 $ hg tag -m 'test head 2 tag' head2
30
30
31 $ hg log -G -T '{rev}:{node|short} {tags} {desc}\n'
31 $ hg log -G -T '{rev}:{node|short} {tags} {desc}\n'
32 @ 5:2942a772f72a tip test head 2 tag
32 @ 5:2942a772f72a tip test head 2 tag
33 |
33 |
34 o 4:042eb6bfcc49 head2 newhead
34 o 4:042eb6bfcc49 head2 newhead
35 |
35 |
36 | o 3:c3cb30f2d2cd test2 tag
36 | o 3:c3cb30f2d2cd test2 tag
37 | |
37 | |
38 | o 2:d75775ffbc6b test2 first
38 | o 2:d75775ffbc6b test2 first
39 | |
39 | |
40 | o 1:5f97d42da03f test tag
40 | o 1:5f97d42da03f test tag
41 |/
41 |/
42 o 0:55482a6fb4b1 test1 initial
42 o 0:55482a6fb4b1 test1 initial
43
43
44
44
45 Trigger tags cache population by doing something that accesses tags info
45 Trigger tags cache population by doing something that accesses tags info
46
46
47 $ hg tags
47 $ hg tags
48 tip 5:2942a772f72a
48 tip 5:2942a772f72a
49 head2 4:042eb6bfcc49
49 head2 4:042eb6bfcc49
50 test2 2:d75775ffbc6b
50 test2 2:d75775ffbc6b
51 test1 0:55482a6fb4b1
51 test1 0:55482a6fb4b1
52
52
53 $ cat .hg/cache/tags2-visible
53 $ cat .hg/cache/tags2-visible
54 5 2942a772f72a444bef4bef13874d515f50fa27b6
54 5 2942a772f72a444bef4bef13874d515f50fa27b6
55 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
55 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
56 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
56 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
57 d75775ffbc6bca1794d300f5571272879bd280da test2
57 d75775ffbc6bca1794d300f5571272879bd280da test2
58
58
59 Hiding a non-tip changeset should change filtered hash and cause tags recompute
59 Hiding a non-tip changeset should change filtered hash and cause tags recompute
60
60
61 $ hg debugobsolete -d '0 0' c3cb30f2d2cd0aae008cc91a07876e3c5131fd22 -u dummyuser
61 $ hg debugobsolete -d '0 0' c3cb30f2d2cd0aae008cc91a07876e3c5131fd22 -u dummyuser
62 1 new obsolescence markers
62 1 new obsolescence markers
63 obsoleted 1 changesets
63 obsoleted 1 changesets
64
64
65 $ hg tags
65 $ hg tags
66 tip 5:2942a772f72a
66 tip 5:2942a772f72a
67 head2 4:042eb6bfcc49
67 head2 4:042eb6bfcc49
68 test1 0:55482a6fb4b1
68 test1 0:55482a6fb4b1
69
69
70 $ cat .hg/cache/tags2-visible
70 $ cat .hg/cache/tags2-visible
71 5 2942a772f72a444bef4bef13874d515f50fa27b6 f34fbc9a9769ba9eff5aff3d008a6b49f85c08b1
71 5 2942a772f72a444bef4bef13874d515f50fa27b6 f34fbc9a9769ba9eff5aff3d008a6b49f85c08b1
72 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
72 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
73 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
73 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
74
74
75 $ hg blackbox -l 5
75 $ hg blackbox -l 5
76 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags
76 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags
77 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 2/2 cache hits/lookups in * seconds (glob)
77 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 2/2 cache hits/lookups in * seconds (glob)
78 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2-visible with 2 tags
78 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2-visible with 2 tags
79 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags exited 0 after * seconds (glob)
79 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags exited 0 after * seconds (glob)
80 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5
80 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5
81
81
82 Hiding another changeset should cause the filtered hash to change
82 Hiding another changeset should cause the filtered hash to change
83
83
84 $ hg debugobsolete -d '0 0' d75775ffbc6bca1794d300f5571272879bd280da -u dummyuser
84 $ hg debugobsolete -d '0 0' d75775ffbc6bca1794d300f5571272879bd280da -u dummyuser
85 1 new obsolescence markers
85 1 new obsolescence markers
86 obsoleted 1 changesets
86 obsoleted 1 changesets
87 $ hg debugobsolete -d '0 0' 5f97d42da03fd56f3b228b03dfe48af5c0adf75b -u dummyuser
87 $ hg debugobsolete -d '0 0' 5f97d42da03fd56f3b228b03dfe48af5c0adf75b -u dummyuser
88 1 new obsolescence markers
88 1 new obsolescence markers
89 obsoleted 1 changesets
89 obsoleted 1 changesets
90
90
91 $ hg tags
91 $ hg tags
92 tip 5:2942a772f72a
92 tip 5:2942a772f72a
93 head2 4:042eb6bfcc49
93 head2 4:042eb6bfcc49
94
94
95 $ cat .hg/cache/tags2-visible
95 $ cat .hg/cache/tags2-visible
96 5 2942a772f72a444bef4bef13874d515f50fa27b6 2fce1eec33263d08a4d04293960fc73a555230e4
96 5 2942a772f72a444bef4bef13874d515f50fa27b6 2fce1eec33263d08a4d04293960fc73a555230e4
97 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
97 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
98
98
99 $ hg blackbox -l 5
99 $ hg blackbox -l 5
100 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags
100 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags
101 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 1/1 cache hits/lookups in * seconds (glob)
101 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 1/1 cache hits/lookups in * seconds (glob)
102 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2-visible with 1 tags
102 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2-visible with 1 tags
103 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags exited 0 after * seconds (glob)
103 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> tags exited 0 after * seconds (glob)
104 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5
104 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5
105
105
106 Resolving tags on an unfiltered repo writes a separate tags cache
106 Resolving tags on an unfiltered repo writes a separate tags cache
107
107
108 $ hg --hidden tags
108 $ hg --hidden tags
109 tip 5:2942a772f72a
109 tip 5:2942a772f72a
110 head2 4:042eb6bfcc49
110 head2 4:042eb6bfcc49
111 test2 2:d75775ffbc6b
111 test2 2:d75775ffbc6b
112 test1 0:55482a6fb4b1
112 test1 0:55482a6fb4b1
113
113
114 $ cat .hg/cache/tags2
114 $ cat .hg/cache/tags2
115 5 2942a772f72a444bef4bef13874d515f50fa27b6
115 5 2942a772f72a444bef4bef13874d515f50fa27b6
116 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
116 042eb6bfcc4909bad84a1cbf6eb1ddf0ab587d41 head2
117 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
117 55482a6fb4b1881fa8f746fd52cf6f096bb21c89 test1
118 d75775ffbc6bca1794d300f5571272879bd280da test2
118 d75775ffbc6bca1794d300f5571272879bd280da test2
119
119
120 $ hg blackbox -l 5
120 $ hg blackbox -l 5
121 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> --hidden tags
121 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> --hidden tags
122 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 2/2 cache hits/lookups in * seconds (glob)
122 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> 2/2 cache hits/lookups in * seconds (glob)
123 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2 with 3 tags
123 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> writing .hg/cache/tags2 with 3 tags
124 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> --hidden tags exited 0 after * seconds (glob)
124 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> --hidden tags exited 0 after * seconds (glob)
125 1970/01/01 00:00:00 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5
125 1970/01/01 00:00:00.000 bob @2942a772f72a444bef4bef13874d515f50fa27b6 (5000)> blackbox -l 5
@@ -1,935 +1,935 b''
1 setup
1 setup
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > blackbox=
5 > blackbox=
6 > mock=$TESTDIR/mockblackbox.py
6 > mock=$TESTDIR/mockblackbox.py
7 > [blackbox]
7 > [blackbox]
8 > track = command, commandfinish, tagscache
8 > track = command, commandfinish, tagscache
9 > EOF
9 > EOF
10
10
11 Helper functions:
11 Helper functions:
12
12
13 $ cacheexists() {
13 $ cacheexists() {
14 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
14 > [ -f .hg/cache/tags2-visible ] && echo "tag cache exists" || echo "no tag cache"
15 > }
15 > }
16
16
17 $ fnodescacheexists() {
17 $ fnodescacheexists() {
18 > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache"
18 > [ -f .hg/cache/hgtagsfnodes1 ] && echo "fnodes cache exists" || echo "no fnodes cache"
19 > }
19 > }
20
20
21 $ dumptags() {
21 $ dumptags() {
22 > rev=$1
22 > rev=$1
23 > echo "rev $rev: .hgtags:"
23 > echo "rev $rev: .hgtags:"
24 > hg cat -r$rev .hgtags
24 > hg cat -r$rev .hgtags
25 > }
25 > }
26
26
27 # XXX need to test that the tag cache works when we strip an old head
27 # XXX need to test that the tag cache works when we strip an old head
28 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
28 # and add a new one rooted off non-tip: i.e. node and rev of tip are the
29 # same, but stuff has changed behind tip.
29 # same, but stuff has changed behind tip.
30
30
31 Setup:
31 Setup:
32
32
33 $ hg init t
33 $ hg init t
34 $ cd t
34 $ cd t
35 $ cacheexists
35 $ cacheexists
36 no tag cache
36 no tag cache
37 $ fnodescacheexists
37 $ fnodescacheexists
38 no fnodes cache
38 no fnodes cache
39 $ hg id
39 $ hg id
40 000000000000 tip
40 000000000000 tip
41 $ cacheexists
41 $ cacheexists
42 no tag cache
42 no tag cache
43 $ fnodescacheexists
43 $ fnodescacheexists
44 no fnodes cache
44 no fnodes cache
45 $ echo a > a
45 $ echo a > a
46 $ hg add a
46 $ hg add a
47 $ hg commit -m "test"
47 $ hg commit -m "test"
48 $ hg co
48 $ hg co
49 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 $ hg identify
50 $ hg identify
51 acb14030fe0a tip
51 acb14030fe0a tip
52 $ hg identify -r 'wdir()'
52 $ hg identify -r 'wdir()'
53 acb14030fe0a tip
53 acb14030fe0a tip
54 $ cacheexists
54 $ cacheexists
55 tag cache exists
55 tag cache exists
56 No fnodes cache because .hgtags file doesn't exist
56 No fnodes cache because .hgtags file doesn't exist
57 (this is an implementation detail)
57 (this is an implementation detail)
58 $ fnodescacheexists
58 $ fnodescacheexists
59 no fnodes cache
59 no fnodes cache
60
60
61 Try corrupting the cache
61 Try corrupting the cache
62
62
63 $ printf 'a b' > .hg/cache/tags2-visible
63 $ printf 'a b' > .hg/cache/tags2-visible
64 $ hg identify
64 $ hg identify
65 acb14030fe0a tip
65 acb14030fe0a tip
66 $ cacheexists
66 $ cacheexists
67 tag cache exists
67 tag cache exists
68 $ fnodescacheexists
68 $ fnodescacheexists
69 no fnodes cache
69 no fnodes cache
70 $ hg identify
70 $ hg identify
71 acb14030fe0a tip
71 acb14030fe0a tip
72
72
73 Create local tag with long name:
73 Create local tag with long name:
74
74
75 $ T=`hg identify --debug --id`
75 $ T=`hg identify --debug --id`
76 $ hg tag -l "This is a local tag with a really long name!"
76 $ hg tag -l "This is a local tag with a really long name!"
77 $ hg tags
77 $ hg tags
78 tip 0:acb14030fe0a
78 tip 0:acb14030fe0a
79 This is a local tag with a really long name! 0:acb14030fe0a
79 This is a local tag with a really long name! 0:acb14030fe0a
80 $ rm .hg/localtags
80 $ rm .hg/localtags
81
81
82 Create a tag behind hg's back:
82 Create a tag behind hg's back:
83
83
84 $ echo "$T first" > .hgtags
84 $ echo "$T first" > .hgtags
85 $ cat .hgtags
85 $ cat .hgtags
86 acb14030fe0a21b60322c440ad2d20cf7685a376 first
86 acb14030fe0a21b60322c440ad2d20cf7685a376 first
87 $ hg add .hgtags
87 $ hg add .hgtags
88 $ hg commit -m "add tags"
88 $ hg commit -m "add tags"
89 $ hg tags
89 $ hg tags
90 tip 1:b9154636be93
90 tip 1:b9154636be93
91 first 0:acb14030fe0a
91 first 0:acb14030fe0a
92 $ hg identify
92 $ hg identify
93 b9154636be93 tip
93 b9154636be93 tip
94
94
95 We should have a fnodes cache now that we have a real tag
95 We should have a fnodes cache now that we have a real tag
96 The cache should have an empty entry for rev 0 and a valid entry for rev 1.
96 The cache should have an empty entry for rev 0 and a valid entry for rev 1.
97
97
98
98
99 $ fnodescacheexists
99 $ fnodescacheexists
100 fnodes cache exists
100 fnodes cache exists
101 $ f --size --hexdump .hg/cache/hgtagsfnodes1
101 $ f --size --hexdump .hg/cache/hgtagsfnodes1
102 .hg/cache/hgtagsfnodes1: size=48
102 .hg/cache/hgtagsfnodes1: size=48
103 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
103 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
104 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
104 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
105 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
105 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
106 $ hg debugtagscache
106 $ hg debugtagscache
107 0 acb14030fe0a21b60322c440ad2d20cf7685a376 missing
107 0 acb14030fe0a21b60322c440ad2d20cf7685a376 missing
108 1 b9154636be938d3d431e75a7c906504a079bfe07 26b7b4a773e09ee3c52f510e19e05e1ff966d859
108 1 b9154636be938d3d431e75a7c906504a079bfe07 26b7b4a773e09ee3c52f510e19e05e1ff966d859
109
109
110 Repeat with cold tag cache:
110 Repeat with cold tag cache:
111
111
112 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
112 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
113 $ hg identify
113 $ hg identify
114 b9154636be93 tip
114 b9154636be93 tip
115
115
116 $ fnodescacheexists
116 $ fnodescacheexists
117 fnodes cache exists
117 fnodes cache exists
118 $ f --size --hexdump .hg/cache/hgtagsfnodes1
118 $ f --size --hexdump .hg/cache/hgtagsfnodes1
119 .hg/cache/hgtagsfnodes1: size=48
119 .hg/cache/hgtagsfnodes1: size=48
120 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
120 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
121 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
121 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
122 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
122 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
123
123
124 And again, but now unable to write tag cache or lock file:
124 And again, but now unable to write tag cache or lock file:
125
125
126 #if unix-permissions no-fsmonitor
126 #if unix-permissions no-fsmonitor
127
127
128 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
128 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
129 $ chmod 555 .hg/cache
129 $ chmod 555 .hg/cache
130 $ hg identify
130 $ hg identify
131 b9154636be93 tip
131 b9154636be93 tip
132 $ chmod 755 .hg/cache
132 $ chmod 755 .hg/cache
133
133
134 (this block should be protected by no-fsmonitor, because "chmod 555 .hg"
134 (this block should be protected by no-fsmonitor, because "chmod 555 .hg"
135 makes watchman fail at accessing to files under .hg)
135 makes watchman fail at accessing to files under .hg)
136
136
137 $ chmod 555 .hg
137 $ chmod 555 .hg
138 $ hg identify
138 $ hg identify
139 b9154636be93 tip
139 b9154636be93 tip
140 $ chmod 755 .hg
140 $ chmod 755 .hg
141 #endif
141 #endif
142
142
143 Tag cache debug info written to blackbox log
143 Tag cache debug info written to blackbox log
144
144
145 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
145 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
146 $ hg identify
146 $ hg identify
147 b9154636be93 tip
147 b9154636be93 tip
148 $ hg blackbox -l 6
148 $ hg blackbox -l 6
149 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
149 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
150 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing 48 bytes to cache/hgtagsfnodes1
150 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing 48 bytes to cache/hgtagsfnodes1
151 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/2 cache hits/lookups in * seconds (glob)
151 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/2 cache hits/lookups in * seconds (glob)
152 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
152 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
153 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
153 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
154 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
154 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
155
155
156 Failure to acquire lock results in no write
156 Failure to acquire lock results in no write
157
157
158 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
158 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
159 $ echo 'foo:1' > .hg/store/lock
159 $ echo 'foo:1' > .hg/store/lock
160 $ hg identify
160 $ hg identify
161 b9154636be93 tip
161 b9154636be93 tip
162 $ hg blackbox -l 6
162 $ hg blackbox -l 6
163 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
163 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify
164 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired
164 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> not writing .hg/cache/hgtagsfnodes1 because lock cannot be acquired
165 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/2 cache hits/lookups in * seconds (glob)
165 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> 0/2 cache hits/lookups in * seconds (glob)
166 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
166 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> writing .hg/cache/tags2-visible with 1 tags
167 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
167 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> identify exited 0 after * seconds (glob)
168 1970/01/01 00:00:00 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
168 1970/01/01 00:00:00.000 bob @b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l 6
169
169
170 $ fnodescacheexists
170 $ fnodescacheexists
171 no fnodes cache
171 no fnodes cache
172
172
173 $ rm .hg/store/lock
173 $ rm .hg/store/lock
174
174
175 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
175 $ rm -f .hg/cache/tags2-visible .hg/cache/hgtagsfnodes1
176 $ hg identify
176 $ hg identify
177 b9154636be93 tip
177 b9154636be93 tip
178
178
179 Create a branch:
179 Create a branch:
180
180
181 $ echo bb > a
181 $ echo bb > a
182 $ hg status
182 $ hg status
183 M a
183 M a
184 $ hg identify
184 $ hg identify
185 b9154636be93+ tip
185 b9154636be93+ tip
186 $ hg co first
186 $ hg co first
187 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
187 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
188 $ hg id
188 $ hg id
189 acb14030fe0a+ first
189 acb14030fe0a+ first
190 $ hg id -r 'wdir()'
190 $ hg id -r 'wdir()'
191 acb14030fe0a+ first
191 acb14030fe0a+ first
192 $ hg -v id
192 $ hg -v id
193 acb14030fe0a+ first
193 acb14030fe0a+ first
194 $ hg status
194 $ hg status
195 M a
195 M a
196 $ echo 1 > b
196 $ echo 1 > b
197 $ hg add b
197 $ hg add b
198 $ hg commit -m "branch"
198 $ hg commit -m "branch"
199 created new head
199 created new head
200
200
201 Creating a new commit shouldn't append the .hgtags fnodes cache until
201 Creating a new commit shouldn't append the .hgtags fnodes cache until
202 tags info is accessed
202 tags info is accessed
203
203
204 $ f --size --hexdump .hg/cache/hgtagsfnodes1
204 $ f --size --hexdump .hg/cache/hgtagsfnodes1
205 .hg/cache/hgtagsfnodes1: size=48
205 .hg/cache/hgtagsfnodes1: size=48
206 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
206 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
207 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
207 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
208 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
208 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
209
209
210 $ hg id
210 $ hg id
211 c8edf04160c7 tip
211 c8edf04160c7 tip
212
212
213 First 4 bytes of record 3 are changeset fragment
213 First 4 bytes of record 3 are changeset fragment
214
214
215 $ f --size --hexdump .hg/cache/hgtagsfnodes1
215 $ f --size --hexdump .hg/cache/hgtagsfnodes1
216 .hg/cache/hgtagsfnodes1: size=72
216 .hg/cache/hgtagsfnodes1: size=72
217 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
217 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
218 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
218 0010: ff ff ff ff ff ff ff ff b9 15 46 36 26 b7 b4 a7 |..........F6&...|
219 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
219 0020: 73 e0 9e e3 c5 2f 51 0e 19 e0 5e 1f f9 66 d8 59 |s..../Q...^..f.Y|
220 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............|
220 0030: c8 ed f0 41 00 00 00 00 00 00 00 00 00 00 00 00 |...A............|
221 0040: 00 00 00 00 00 00 00 00 |........|
221 0040: 00 00 00 00 00 00 00 00 |........|
222
222
223 Merge the two heads:
223 Merge the two heads:
224
224
225 $ hg merge 1
225 $ hg merge 1
226 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
226 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
227 (branch merge, don't forget to commit)
227 (branch merge, don't forget to commit)
228 $ hg blackbox -l3
228 $ hg blackbox -l3
229 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28 (5000)> merge 1
229 1970/01/01 00:00:00.000 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28 (5000)> merge 1
230 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> merge 1 exited 0 after * seconds (glob)
230 1970/01/01 00:00:00.000 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> merge 1 exited 0 after * seconds (glob)
231 1970/01/01 00:00:00 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l3
231 1970/01/01 00:00:00.000 bob @c8edf04160c7f731e4589d66ab3ab3486a64ac28+b9154636be938d3d431e75a7c906504a079bfe07 (5000)> blackbox -l3
232 $ hg id
232 $ hg id
233 c8edf04160c7+b9154636be93+ tip
233 c8edf04160c7+b9154636be93+ tip
234 $ hg status
234 $ hg status
235 M .hgtags
235 M .hgtags
236 $ hg commit -m "merge"
236 $ hg commit -m "merge"
237
237
238 Create a fake head, make sure tag not visible afterwards:
238 Create a fake head, make sure tag not visible afterwards:
239
239
240 $ cp .hgtags tags
240 $ cp .hgtags tags
241 $ hg tag last
241 $ hg tag last
242 $ hg rm .hgtags
242 $ hg rm .hgtags
243 $ hg commit -m "remove"
243 $ hg commit -m "remove"
244
244
245 $ mv tags .hgtags
245 $ mv tags .hgtags
246 $ hg add .hgtags
246 $ hg add .hgtags
247 $ hg commit -m "readd"
247 $ hg commit -m "readd"
248 $
248 $
249 $ hg tags
249 $ hg tags
250 tip 6:35ff301afafe
250 tip 6:35ff301afafe
251 first 0:acb14030fe0a
251 first 0:acb14030fe0a
252
252
253 Add invalid tags:
253 Add invalid tags:
254
254
255 $ echo "spam" >> .hgtags
255 $ echo "spam" >> .hgtags
256 $ echo >> .hgtags
256 $ echo >> .hgtags
257 $ echo "foo bar" >> .hgtags
257 $ echo "foo bar" >> .hgtags
258 $ echo "a5a5 invalid" >> .hg/localtags
258 $ echo "a5a5 invalid" >> .hg/localtags
259 $ cat .hgtags
259 $ cat .hgtags
260 acb14030fe0a21b60322c440ad2d20cf7685a376 first
260 acb14030fe0a21b60322c440ad2d20cf7685a376 first
261 spam
261 spam
262
262
263 foo bar
263 foo bar
264 $ hg commit -m "tags"
264 $ hg commit -m "tags"
265
265
266 Report tag parse error on other head:
266 Report tag parse error on other head:
267
267
268 $ hg up 3
268 $ hg up 3
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
270 $ echo 'x y' >> .hgtags
270 $ echo 'x y' >> .hgtags
271 $ hg commit -m "head"
271 $ hg commit -m "head"
272 created new head
272 created new head
273
273
274 $ hg tags --debug
274 $ hg tags --debug
275 .hgtags@75d9f02dfe28, line 2: cannot parse entry
275 .hgtags@75d9f02dfe28, line 2: cannot parse entry
276 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
276 .hgtags@75d9f02dfe28, line 4: node 'foo' is not well formed
277 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
277 .hgtags@c4be69a18c11, line 2: node 'x' is not well formed
278 tip 8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663
278 tip 8:c4be69a18c11e8bc3a5fdbb576017c25f7d84663
279 first 0:acb14030fe0a21b60322c440ad2d20cf7685a376
279 first 0:acb14030fe0a21b60322c440ad2d20cf7685a376
280 $ hg tip
280 $ hg tip
281 changeset: 8:c4be69a18c11
281 changeset: 8:c4be69a18c11
282 tag: tip
282 tag: tip
283 parent: 3:ac5e980c4dc0
283 parent: 3:ac5e980c4dc0
284 user: test
284 user: test
285 date: Thu Jan 01 00:00:00 1970 +0000
285 date: Thu Jan 01 00:00:00 1970 +0000
286 summary: head
286 summary: head
287
287
288
288
289 Test tag precedence rules:
289 Test tag precedence rules:
290
290
291 $ cd ..
291 $ cd ..
292 $ hg init t2
292 $ hg init t2
293 $ cd t2
293 $ cd t2
294 $ echo foo > foo
294 $ echo foo > foo
295 $ hg add foo
295 $ hg add foo
296 $ hg ci -m 'add foo' # rev 0
296 $ hg ci -m 'add foo' # rev 0
297 $ hg tag bar # rev 1
297 $ hg tag bar # rev 1
298 $ echo >> foo
298 $ echo >> foo
299 $ hg ci -m 'change foo 1' # rev 2
299 $ hg ci -m 'change foo 1' # rev 2
300 $ hg up -C 1
300 $ hg up -C 1
301 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 $ hg tag -r 1 -f bar # rev 3
302 $ hg tag -r 1 -f bar # rev 3
303 $ hg up -C 1
303 $ hg up -C 1
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 $ echo >> foo
305 $ echo >> foo
306 $ hg ci -m 'change foo 2' # rev 4
306 $ hg ci -m 'change foo 2' # rev 4
307 created new head
307 created new head
308 $ hg tags
308 $ hg tags
309 tip 4:0c192d7d5e6b
309 tip 4:0c192d7d5e6b
310 bar 1:78391a272241
310 bar 1:78391a272241
311
311
312 Repeat in case of cache effects:
312 Repeat in case of cache effects:
313
313
314 $ hg tags
314 $ hg tags
315 tip 4:0c192d7d5e6b
315 tip 4:0c192d7d5e6b
316 bar 1:78391a272241
316 bar 1:78391a272241
317
317
318 Detailed dump of tag info:
318 Detailed dump of tag info:
319
319
320 $ hg heads -q # expect 4, 3, 2
320 $ hg heads -q # expect 4, 3, 2
321 4:0c192d7d5e6b
321 4:0c192d7d5e6b
322 3:6fa450212aeb
322 3:6fa450212aeb
323 2:7a94127795a3
323 2:7a94127795a3
324 $ dumptags 2
324 $ dumptags 2
325 rev 2: .hgtags:
325 rev 2: .hgtags:
326 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
326 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
327 $ dumptags 3
327 $ dumptags 3
328 rev 3: .hgtags:
328 rev 3: .hgtags:
329 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
329 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
330 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
330 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
331 78391a272241d70354aa14c874552cad6b51bb42 bar
331 78391a272241d70354aa14c874552cad6b51bb42 bar
332 $ dumptags 4
332 $ dumptags 4
333 rev 4: .hgtags:
333 rev 4: .hgtags:
334 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
334 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
335
335
336 Dump cache:
336 Dump cache:
337
337
338 $ cat .hg/cache/tags2-visible
338 $ cat .hg/cache/tags2-visible
339 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
339 4 0c192d7d5e6b78a714de54a2e9627952a877e25a
340 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
340 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
341 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
341 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
342 78391a272241d70354aa14c874552cad6b51bb42 bar
342 78391a272241d70354aa14c874552cad6b51bb42 bar
343
343
344 $ f --size --hexdump .hg/cache/hgtagsfnodes1
344 $ f --size --hexdump .hg/cache/hgtagsfnodes1
345 .hg/cache/hgtagsfnodes1: size=120
345 .hg/cache/hgtagsfnodes1: size=120
346 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
346 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
347 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
347 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
348 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
348 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
349 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
349 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
350 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
350 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
351 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
351 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
352 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
352 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
353 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=|
353 0070: 78 ee 5a 2d ad bc 94 3d |x.Z-...=|
354
354
355 Corrupt the .hgtags fnodes cache
355 Corrupt the .hgtags fnodes cache
356 Extra junk data at the end should get overwritten on next cache update
356 Extra junk data at the end should get overwritten on next cache update
357
357
358 $ echo extra >> .hg/cache/hgtagsfnodes1
358 $ echo extra >> .hg/cache/hgtagsfnodes1
359 $ echo dummy1 > foo
359 $ echo dummy1 > foo
360 $ hg commit -m throwaway1
360 $ hg commit -m throwaway1
361
361
362 $ hg tags
362 $ hg tags
363 tip 5:8dbfe60eff30
363 tip 5:8dbfe60eff30
364 bar 1:78391a272241
364 bar 1:78391a272241
365
365
366 $ hg blackbox -l 6
366 $ hg blackbox -l 6
367 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags
367 1970/01/01 00:00:00.000 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags
368 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing 24 bytes to cache/hgtagsfnodes1
368 1970/01/01 00:00:00.000 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing 24 bytes to cache/hgtagsfnodes1
369 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> 3/4 cache hits/lookups in * seconds (glob)
369 1970/01/01 00:00:00.000 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> 3/4 cache hits/lookups in * seconds (glob)
370 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing .hg/cache/tags2-visible with 1 tags
370 1970/01/01 00:00:00.000 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> writing .hg/cache/tags2-visible with 1 tags
371 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob)
371 1970/01/01 00:00:00.000 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob)
372 1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6
372 1970/01/01 00:00:00.000 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6
373
373
374 On junk data + missing cache entries, hg also overwrites the junk.
374 On junk data + missing cache entries, hg also overwrites the junk.
375
375
376 $ rm -f .hg/cache/tags2-visible
376 $ rm -f .hg/cache/tags2-visible
377 >>> import os
377 >>> import os
378 >>> with open(".hg/cache/hgtagsfnodes1", "ab+") as fp:
378 >>> with open(".hg/cache/hgtagsfnodes1", "ab+") as fp:
379 ... fp.seek(-10, os.SEEK_END) and None
379 ... fp.seek(-10, os.SEEK_END) and None
380 ... fp.truncate() and None
380 ... fp.truncate() and None
381
381
382 $ hg debugtagscache | tail -2
382 $ hg debugtagscache | tail -2
383 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
383 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
384 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 missing
384 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 missing
385 $ hg tags
385 $ hg tags
386 tip 5:8dbfe60eff30
386 tip 5:8dbfe60eff30
387 bar 1:78391a272241
387 bar 1:78391a272241
388 $ hg debugtagscache | tail -2
388 $ hg debugtagscache | tail -2
389 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
389 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
390 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8af31de17fab7422878ee5a2dadbc943d
390 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8af31de17fab7422878ee5a2dadbc943d
391
391
392 If the 4 bytes of node hash for a record don't match an existing node, the entry
392 If the 4 bytes of node hash for a record don't match an existing node, the entry
393 is flagged as invalid.
393 is flagged as invalid.
394
394
395 >>> import os
395 >>> import os
396 >>> with open(".hg/cache/hgtagsfnodes1", "rb+") as fp:
396 >>> with open(".hg/cache/hgtagsfnodes1", "rb+") as fp:
397 ... fp.seek(-24, os.SEEK_END) and None
397 ... fp.seek(-24, os.SEEK_END) and None
398 ... fp.write(b'\xde\xad') and None
398 ... fp.write(b'\xde\xad') and None
399
399
400 $ f --size --hexdump .hg/cache/hgtagsfnodes1
400 $ f --size --hexdump .hg/cache/hgtagsfnodes1
401 .hg/cache/hgtagsfnodes1: size=144
401 .hg/cache/hgtagsfnodes1: size=144
402 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
402 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
403 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
403 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
404 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
404 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
405 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
405 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
406 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
406 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
407 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
407 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
408 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
408 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
409 0070: 78 ee 5a 2d ad bc 94 3d de ad e6 0e 0c 04 f2 a8 |x.Z-...=........|
409 0070: 78 ee 5a 2d ad bc 94 3d de ad e6 0e 0c 04 f2 a8 |x.Z-...=........|
410 0080: af 31 de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |.1....B(x.Z-...=|
410 0080: af 31 de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |.1....B(x.Z-...=|
411
411
412 $ hg debugtagscache | tail -2
412 $ hg debugtagscache | tail -2
413 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
413 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
414 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 invalid
414 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 invalid
415
415
416 $ hg tags
416 $ hg tags
417 tip 5:8dbfe60eff30
417 tip 5:8dbfe60eff30
418 bar 1:78391a272241
418 bar 1:78391a272241
419
419
420 BUG: If the filenode part of an entry in hgtagsfnodes is corrupt and
420 BUG: If the filenode part of an entry in hgtagsfnodes is corrupt and
421 tags2-visible is missing, `hg tags` aborts. Corrupting the leading 4 bytes of
421 tags2-visible is missing, `hg tags` aborts. Corrupting the leading 4 bytes of
422 node hash (as above) doesn't seem to trigger the issue. Also note that the
422 node hash (as above) doesn't seem to trigger the issue. Also note that the
423 debug command hides the corruption, both with and without tags2-visible.
423 debug command hides the corruption, both with and without tags2-visible.
424
424
425 $ mv .hg/cache/hgtagsfnodes1 .hg/cache/hgtagsfnodes1.bak
425 $ mv .hg/cache/hgtagsfnodes1 .hg/cache/hgtagsfnodes1.bak
426 $ hg debugupdatecaches
426 $ hg debugupdatecaches
427
427
428 >>> import os
428 >>> import os
429 >>> with open(".hg/cache/hgtagsfnodes1", "rb+") as fp:
429 >>> with open(".hg/cache/hgtagsfnodes1", "rb+") as fp:
430 ... fp.seek(-16, os.SEEK_END) and None
430 ... fp.seek(-16, os.SEEK_END) and None
431 ... fp.write(b'\xde\xad') and None
431 ... fp.write(b'\xde\xad') and None
432
432
433 $ f --size --hexdump .hg/cache/hgtagsfnodes1
433 $ f --size --hexdump .hg/cache/hgtagsfnodes1
434 .hg/cache/hgtagsfnodes1: size=144
434 .hg/cache/hgtagsfnodes1: size=144
435 0000: bb d1 79 df 00 00 00 00 00 00 00 00 00 00 00 00 |..y.............|
435 0000: bb d1 79 df 00 00 00 00 00 00 00 00 00 00 00 00 |..y.............|
436 0010: 00 00 00 00 00 00 00 00 78 39 1a 27 0c 04 f2 a8 |........x9.'....|
436 0010: 00 00 00 00 00 00 00 00 78 39 1a 27 0c 04 f2 a8 |........x9.'....|
437 0020: af 31 de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |.1....B(x.Z-...=|
437 0020: af 31 de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |.1....B(x.Z-...=|
438 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
438 0030: 7a 94 12 77 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |z..w.....1....B(|
439 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
439 0040: 78 ee 5a 2d ad bc 94 3d 6f a4 50 21 7d 3b 71 8c |x.Z-...=o.P!};q.|
440 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
440 0050: 96 4e f3 7b 89 e5 50 eb da fd 57 89 e7 6c e1 b0 |.N.{..P...W..l..|
441 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
441 0060: 0c 19 2d 7d 0c 04 f2 a8 af 31 de 17 fa b7 42 28 |..-}.....1....B(|
442 0070: 78 ee 5a 2d ad bc 94 3d 8d bf e6 0e 0c 04 f2 a8 |x.Z-...=........|
442 0070: 78 ee 5a 2d ad bc 94 3d 8d bf e6 0e 0c 04 f2 a8 |x.Z-...=........|
443 0080: de ad de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |......B(x.Z-...=|
443 0080: de ad de 17 fa b7 42 28 78 ee 5a 2d ad bc 94 3d |......B(x.Z-...=|
444
444
445 $ hg debugtagscache | tail -2
445 $ hg debugtagscache | tail -2
446 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
446 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
447 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d (unknown node)
447 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d (unknown node)
448
448
449 $ rm -f .hg/cache/tags2-visible
449 $ rm -f .hg/cache/tags2-visible
450 $ hg debugtagscache | tail -2
450 $ hg debugtagscache | tail -2
451 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
451 4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
452 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d (unknown node)
452 5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8deadde17fab7422878ee5a2dadbc943d (unknown node)
453
453
454 $ hg tags
454 $ hg tags
455 tip 5:8dbfe60eff30
455 tip 5:8dbfe60eff30
456 bar 1:78391a272241
456 bar 1:78391a272241
457
457
458 BUG: Unless this file is restored, the `hg tags` in the next unix-permissions
458 BUG: Unless this file is restored, the `hg tags` in the next unix-permissions
459 conditional will fail: "abort: data/.hgtags.i@0c04f2a8dead: no match found"
459 conditional will fail: "abort: data/.hgtags.i@0c04f2a8dead: no match found"
460
460
461 $ mv .hg/cache/hgtagsfnodes1.bak .hg/cache/hgtagsfnodes1
461 $ mv .hg/cache/hgtagsfnodes1.bak .hg/cache/hgtagsfnodes1
462
462
463 #if unix-permissions no-root
463 #if unix-permissions no-root
464 Errors writing to .hgtags fnodes cache are silently ignored
464 Errors writing to .hgtags fnodes cache are silently ignored
465
465
466 $ echo dummy2 > foo
466 $ echo dummy2 > foo
467 $ hg commit -m throwaway2
467 $ hg commit -m throwaway2
468
468
469 $ chmod a-w .hg/cache/hgtagsfnodes1
469 $ chmod a-w .hg/cache/hgtagsfnodes1
470 $ rm -f .hg/cache/tags2-visible
470 $ rm -f .hg/cache/tags2-visible
471
471
472 $ hg tags
472 $ hg tags
473 tip 6:b968051b5cf3
473 tip 6:b968051b5cf3
474 bar 1:78391a272241
474 bar 1:78391a272241
475
475
476 $ hg blackbox -l 6
476 $ hg blackbox -l 6
477 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
477 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
478 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> couldn't write cache/hgtagsfnodes1: [Errno *] * (glob)
478 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> couldn't write cache/hgtagsfnodes1: [Errno *] * (glob)
479 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/4 cache hits/lookups in * seconds (glob)
479 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/4 cache hits/lookups in * seconds (glob)
480 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
480 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
481 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
481 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
482 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
482 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
483
483
484 $ chmod a+w .hg/cache/hgtagsfnodes1
484 $ chmod a+w .hg/cache/hgtagsfnodes1
485
485
486 $ rm -f .hg/cache/tags2-visible
486 $ rm -f .hg/cache/tags2-visible
487 $ hg tags
487 $ hg tags
488 tip 6:b968051b5cf3
488 tip 6:b968051b5cf3
489 bar 1:78391a272241
489 bar 1:78391a272241
490
490
491 $ hg blackbox -l 6
491 $ hg blackbox -l 6
492 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
492 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags
493 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing 24 bytes to cache/hgtagsfnodes1
493 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing 24 bytes to cache/hgtagsfnodes1
494 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/4 cache hits/lookups in * seconds (glob)
494 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> 2/4 cache hits/lookups in * seconds (glob)
495 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
495 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> writing .hg/cache/tags2-visible with 1 tags
496 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
496 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> tags exited 0 after * seconds (glob)
497 1970/01/01 00:00:00 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
497 1970/01/01 00:00:00.000 bob @b968051b5cf3f624b771779c6d5f84f1d4c3fb5d (5000)> blackbox -l 6
498
498
499 $ f --size .hg/cache/hgtagsfnodes1
499 $ f --size .hg/cache/hgtagsfnodes1
500 .hg/cache/hgtagsfnodes1: size=168
500 .hg/cache/hgtagsfnodes1: size=168
501
501
502 $ hg -q --config extensions.strip= strip -r 6 --no-backup
502 $ hg -q --config extensions.strip= strip -r 6 --no-backup
503 #endif
503 #endif
504
504
505 Stripping doesn't truncate the tags cache until new data is available
505 Stripping doesn't truncate the tags cache until new data is available
506
506
507 $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible
507 $ rm -f .hg/cache/hgtagsfnodes1 .hg/cache/tags2-visible
508 $ hg tags
508 $ hg tags
509 tip 5:8dbfe60eff30
509 tip 5:8dbfe60eff30
510 bar 1:78391a272241
510 bar 1:78391a272241
511
511
512 $ f --size .hg/cache/hgtagsfnodes1
512 $ f --size .hg/cache/hgtagsfnodes1
513 .hg/cache/hgtagsfnodes1: size=144
513 .hg/cache/hgtagsfnodes1: size=144
514
514
515 $ hg -q --config extensions.strip= strip -r 5 --no-backup
515 $ hg -q --config extensions.strip= strip -r 5 --no-backup
516 $ hg tags
516 $ hg tags
517 tip 4:0c192d7d5e6b
517 tip 4:0c192d7d5e6b
518 bar 1:78391a272241
518 bar 1:78391a272241
519
519
520 $ hg blackbox -l 5
520 $ hg blackbox -l 5
521 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing 24 bytes to cache/hgtagsfnodes1
521 1970/01/01 00:00:00.000 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing 24 bytes to cache/hgtagsfnodes1
522 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> 2/4 cache hits/lookups in * seconds (glob)
522 1970/01/01 00:00:00.000 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> 2/4 cache hits/lookups in * seconds (glob)
523 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing .hg/cache/tags2-visible with 1 tags
523 1970/01/01 00:00:00.000 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> writing .hg/cache/tags2-visible with 1 tags
524 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> tags exited 0 after * seconds (glob)
524 1970/01/01 00:00:00.000 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> tags exited 0 after * seconds (glob)
525 1970/01/01 00:00:00 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> blackbox -l 5
525 1970/01/01 00:00:00.000 bob @0c192d7d5e6b78a714de54a2e9627952a877e25a (5000)> blackbox -l 5
526
526
527 $ f --size .hg/cache/hgtagsfnodes1
527 $ f --size .hg/cache/hgtagsfnodes1
528 .hg/cache/hgtagsfnodes1: size=120
528 .hg/cache/hgtagsfnodes1: size=120
529
529
530 $ echo dummy > foo
530 $ echo dummy > foo
531 $ hg commit -m throwaway3
531 $ hg commit -m throwaway3
532
532
533 $ hg tags
533 $ hg tags
534 tip 5:035f65efb448
534 tip 5:035f65efb448
535 bar 1:78391a272241
535 bar 1:78391a272241
536
536
537 $ hg blackbox -l 6
537 $ hg blackbox -l 6
538 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags
538 1970/01/01 00:00:00.000 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags
539 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing 24 bytes to cache/hgtagsfnodes1
539 1970/01/01 00:00:00.000 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing 24 bytes to cache/hgtagsfnodes1
540 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> 3/4 cache hits/lookups in * seconds (glob)
540 1970/01/01 00:00:00.000 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> 3/4 cache hits/lookups in * seconds (glob)
541 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing .hg/cache/tags2-visible with 1 tags
541 1970/01/01 00:00:00.000 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> writing .hg/cache/tags2-visible with 1 tags
542 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags exited 0 after * seconds (glob)
542 1970/01/01 00:00:00.000 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> tags exited 0 after * seconds (glob)
543 1970/01/01 00:00:00 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> blackbox -l 6
543 1970/01/01 00:00:00.000 bob @035f65efb448350f4772141702a81ab1df48c465 (5000)> blackbox -l 6
544 $ f --size .hg/cache/hgtagsfnodes1
544 $ f --size .hg/cache/hgtagsfnodes1
545 .hg/cache/hgtagsfnodes1: size=144
545 .hg/cache/hgtagsfnodes1: size=144
546
546
547 $ hg -q --config extensions.strip= strip -r 5 --no-backup
547 $ hg -q --config extensions.strip= strip -r 5 --no-backup
548
548
549 Test tag removal:
549 Test tag removal:
550
550
551 $ hg tag --remove bar # rev 5
551 $ hg tag --remove bar # rev 5
552 $ hg tip -vp
552 $ hg tip -vp
553 changeset: 5:5f6e8655b1c7
553 changeset: 5:5f6e8655b1c7
554 tag: tip
554 tag: tip
555 user: test
555 user: test
556 date: Thu Jan 01 00:00:00 1970 +0000
556 date: Thu Jan 01 00:00:00 1970 +0000
557 files: .hgtags
557 files: .hgtags
558 description:
558 description:
559 Removed tag bar
559 Removed tag bar
560
560
561
561
562 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
562 diff -r 0c192d7d5e6b -r 5f6e8655b1c7 .hgtags
563 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
563 --- a/.hgtags Thu Jan 01 00:00:00 1970 +0000
564 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
564 +++ b/.hgtags Thu Jan 01 00:00:00 1970 +0000
565 @@ -1,1 +1,3 @@
565 @@ -1,1 +1,3 @@
566 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
566 bbd179dfa0a71671c253b3ae0aa1513b60d199fa bar
567 +78391a272241d70354aa14c874552cad6b51bb42 bar
567 +78391a272241d70354aa14c874552cad6b51bb42 bar
568 +0000000000000000000000000000000000000000 bar
568 +0000000000000000000000000000000000000000 bar
569
569
570 $ hg tags
570 $ hg tags
571 tip 5:5f6e8655b1c7
571 tip 5:5f6e8655b1c7
572 $ hg tags # again, try to expose cache bugs
572 $ hg tags # again, try to expose cache bugs
573 tip 5:5f6e8655b1c7
573 tip 5:5f6e8655b1c7
574
574
575 Remove nonexistent tag:
575 Remove nonexistent tag:
576
576
577 $ hg tag --remove foobar
577 $ hg tag --remove foobar
578 abort: tag 'foobar' does not exist
578 abort: tag 'foobar' does not exist
579 [10]
579 [10]
580 $ hg tip
580 $ hg tip
581 changeset: 5:5f6e8655b1c7
581 changeset: 5:5f6e8655b1c7
582 tag: tip
582 tag: tip
583 user: test
583 user: test
584 date: Thu Jan 01 00:00:00 1970 +0000
584 date: Thu Jan 01 00:00:00 1970 +0000
585 summary: Removed tag bar
585 summary: Removed tag bar
586
586
587
587
588 Undo a tag with rollback:
588 Undo a tag with rollback:
589
589
590 $ hg rollback # destroy rev 5 (restore bar)
590 $ hg rollback # destroy rev 5 (restore bar)
591 repository tip rolled back to revision 4 (undo commit)
591 repository tip rolled back to revision 4 (undo commit)
592 working directory now based on revision 4
592 working directory now based on revision 4
593 $ hg tags
593 $ hg tags
594 tip 4:0c192d7d5e6b
594 tip 4:0c192d7d5e6b
595 bar 1:78391a272241
595 bar 1:78391a272241
596 $ hg tags
596 $ hg tags
597 tip 4:0c192d7d5e6b
597 tip 4:0c192d7d5e6b
598 bar 1:78391a272241
598 bar 1:78391a272241
599
599
600 Test tag rank:
600 Test tag rank:
601
601
602 $ cd ..
602 $ cd ..
603 $ hg init t3
603 $ hg init t3
604 $ cd t3
604 $ cd t3
605 $ echo foo > foo
605 $ echo foo > foo
606 $ hg add foo
606 $ hg add foo
607 $ hg ci -m 'add foo' # rev 0
607 $ hg ci -m 'add foo' # rev 0
608 $ hg tag -f bar # rev 1 bar -> 0
608 $ hg tag -f bar # rev 1 bar -> 0
609 $ hg tag -f bar # rev 2 bar -> 1
609 $ hg tag -f bar # rev 2 bar -> 1
610 $ hg tag -fr 0 bar # rev 3 bar -> 0
610 $ hg tag -fr 0 bar # rev 3 bar -> 0
611 $ hg tag -fr 1 bar # rev 4 bar -> 1
611 $ hg tag -fr 1 bar # rev 4 bar -> 1
612 $ hg tag -fr 0 bar # rev 5 bar -> 0
612 $ hg tag -fr 0 bar # rev 5 bar -> 0
613 $ hg tags
613 $ hg tags
614 tip 5:85f05169d91d
614 tip 5:85f05169d91d
615 bar 0:bbd179dfa0a7
615 bar 0:bbd179dfa0a7
616 $ hg co 3
616 $ hg co 3
617 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
617 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
618 $ echo barbar > foo
618 $ echo barbar > foo
619 $ hg ci -m 'change foo' # rev 6
619 $ hg ci -m 'change foo' # rev 6
620 created new head
620 created new head
621 $ hg tags
621 $ hg tags
622 tip 6:735c3ca72986
622 tip 6:735c3ca72986
623 bar 0:bbd179dfa0a7
623 bar 0:bbd179dfa0a7
624
624
625 Don't allow moving tag without -f:
625 Don't allow moving tag without -f:
626
626
627 $ hg tag -r 3 bar
627 $ hg tag -r 3 bar
628 abort: tag 'bar' already exists (use -f to force)
628 abort: tag 'bar' already exists (use -f to force)
629 [10]
629 [10]
630 $ hg tags
630 $ hg tags
631 tip 6:735c3ca72986
631 tip 6:735c3ca72986
632 bar 0:bbd179dfa0a7
632 bar 0:bbd179dfa0a7
633
633
634 Strip 1: expose an old head:
634 Strip 1: expose an old head:
635
635
636 $ hg --config extensions.mq= strip 5
636 $ hg --config extensions.mq= strip 5
637 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
637 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
638 $ hg tags # partly stale cache
638 $ hg tags # partly stale cache
639 tip 5:735c3ca72986
639 tip 5:735c3ca72986
640 bar 1:78391a272241
640 bar 1:78391a272241
641 $ hg tags # up-to-date cache
641 $ hg tags # up-to-date cache
642 tip 5:735c3ca72986
642 tip 5:735c3ca72986
643 bar 1:78391a272241
643 bar 1:78391a272241
644
644
645 Strip 2: destroy whole branch, no old head exposed
645 Strip 2: destroy whole branch, no old head exposed
646
646
647 $ hg --config extensions.mq= strip 4
647 $ hg --config extensions.mq= strip 4
648 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
648 saved backup bundle to $TESTTMP/t3/.hg/strip-backup/*-backup.hg (glob)
649 $ hg tags # partly stale
649 $ hg tags # partly stale
650 tip 4:735c3ca72986
650 tip 4:735c3ca72986
651 bar 0:bbd179dfa0a7
651 bar 0:bbd179dfa0a7
652 $ rm -f .hg/cache/tags2-visible
652 $ rm -f .hg/cache/tags2-visible
653 $ hg tags # cold cache
653 $ hg tags # cold cache
654 tip 4:735c3ca72986
654 tip 4:735c3ca72986
655 bar 0:bbd179dfa0a7
655 bar 0:bbd179dfa0a7
656
656
657 Test tag rank with 3 heads:
657 Test tag rank with 3 heads:
658
658
659 $ cd ..
659 $ cd ..
660 $ hg init t4
660 $ hg init t4
661 $ cd t4
661 $ cd t4
662 $ echo foo > foo
662 $ echo foo > foo
663 $ hg add
663 $ hg add
664 adding foo
664 adding foo
665 $ hg ci -m 'add foo' # rev 0
665 $ hg ci -m 'add foo' # rev 0
666 $ hg tag bar # rev 1 bar -> 0
666 $ hg tag bar # rev 1 bar -> 0
667 $ hg tag -f bar # rev 2 bar -> 1
667 $ hg tag -f bar # rev 2 bar -> 1
668 $ hg up -qC 0
668 $ hg up -qC 0
669 $ hg tag -fr 2 bar # rev 3 bar -> 2
669 $ hg tag -fr 2 bar # rev 3 bar -> 2
670 $ hg tags
670 $ hg tags
671 tip 3:197c21bbbf2c
671 tip 3:197c21bbbf2c
672 bar 2:6fa450212aeb
672 bar 2:6fa450212aeb
673 $ hg up -qC 0
673 $ hg up -qC 0
674 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
674 $ hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2
675
675
676 Bar should still point to rev 2:
676 Bar should still point to rev 2:
677
677
678 $ hg tags
678 $ hg tags
679 tip 4:3b4b14ed0202
679 tip 4:3b4b14ed0202
680 bar 2:6fa450212aeb
680 bar 2:6fa450212aeb
681
681
682 Test that removing global/local tags does not get confused when trying
682 Test that removing global/local tags does not get confused when trying
683 to remove a tag of type X which actually only exists as a type Y:
683 to remove a tag of type X which actually only exists as a type Y:
684
684
685 $ cd ..
685 $ cd ..
686 $ hg init t5
686 $ hg init t5
687 $ cd t5
687 $ cd t5
688 $ echo foo > foo
688 $ echo foo > foo
689 $ hg add
689 $ hg add
690 adding foo
690 adding foo
691 $ hg ci -m 'add foo' # rev 0
691 $ hg ci -m 'add foo' # rev 0
692
692
693 $ hg tag -r 0 -l localtag
693 $ hg tag -r 0 -l localtag
694 $ hg tag --remove localtag
694 $ hg tag --remove localtag
695 abort: tag 'localtag' is not a global tag
695 abort: tag 'localtag' is not a global tag
696 [10]
696 [10]
697 $
697 $
698 $ hg tag -r 0 globaltag
698 $ hg tag -r 0 globaltag
699 $ hg tag --remove -l globaltag
699 $ hg tag --remove -l globaltag
700 abort: tag 'globaltag' is not a local tag
700 abort: tag 'globaltag' is not a local tag
701 [10]
701 [10]
702 $ hg tags -v
702 $ hg tags -v
703 tip 1:a0b6fe111088
703 tip 1:a0b6fe111088
704 localtag 0:bbd179dfa0a7 local
704 localtag 0:bbd179dfa0a7 local
705 globaltag 0:bbd179dfa0a7
705 globaltag 0:bbd179dfa0a7
706
706
707 Templated output:
707 Templated output:
708
708
709 (immediate values)
709 (immediate values)
710
710
711 $ hg tags -T '{pad(tag, 9)} {rev}:{node} ({type})\n'
711 $ hg tags -T '{pad(tag, 9)} {rev}:{node} ({type})\n'
712 tip 1:a0b6fe111088c8c29567d3876cc466aa02927cae ()
712 tip 1:a0b6fe111088c8c29567d3876cc466aa02927cae ()
713 localtag 0:bbd179dfa0a71671c253b3ae0aa1513b60d199fa (local)
713 localtag 0:bbd179dfa0a71671c253b3ae0aa1513b60d199fa (local)
714 globaltag 0:bbd179dfa0a71671c253b3ae0aa1513b60d199fa ()
714 globaltag 0:bbd179dfa0a71671c253b3ae0aa1513b60d199fa ()
715
715
716 (ctx/revcache dependent)
716 (ctx/revcache dependent)
717
717
718 $ hg tags -T '{pad(tag, 9)} {rev} {file_adds}\n'
718 $ hg tags -T '{pad(tag, 9)} {rev} {file_adds}\n'
719 tip 1 .hgtags
719 tip 1 .hgtags
720 localtag 0 foo
720 localtag 0 foo
721 globaltag 0 foo
721 globaltag 0 foo
722
722
723 $ hg tags -T '{pad(tag, 9)} {rev}:{node|shortest}\n'
723 $ hg tags -T '{pad(tag, 9)} {rev}:{node|shortest}\n'
724 tip 1:a0b6
724 tip 1:a0b6
725 localtag 0:bbd1
725 localtag 0:bbd1
726 globaltag 0:bbd1
726 globaltag 0:bbd1
727
727
728 Test for issue3911
728 Test for issue3911
729
729
730 $ hg tag -r 0 -l localtag2
730 $ hg tag -r 0 -l localtag2
731 $ hg tag -l --remove localtag2
731 $ hg tag -l --remove localtag2
732 $ hg tags -v
732 $ hg tags -v
733 tip 1:a0b6fe111088
733 tip 1:a0b6fe111088
734 localtag 0:bbd179dfa0a7 local
734 localtag 0:bbd179dfa0a7 local
735 globaltag 0:bbd179dfa0a7
735 globaltag 0:bbd179dfa0a7
736
736
737 $ hg tag -r 1 -f localtag
737 $ hg tag -r 1 -f localtag
738 $ hg tags -v
738 $ hg tags -v
739 tip 2:5c70a037bb37
739 tip 2:5c70a037bb37
740 localtag 1:a0b6fe111088
740 localtag 1:a0b6fe111088
741 globaltag 0:bbd179dfa0a7
741 globaltag 0:bbd179dfa0a7
742
742
743 $ hg tags -v
743 $ hg tags -v
744 tip 2:5c70a037bb37
744 tip 2:5c70a037bb37
745 localtag 1:a0b6fe111088
745 localtag 1:a0b6fe111088
746 globaltag 0:bbd179dfa0a7
746 globaltag 0:bbd179dfa0a7
747
747
748 $ hg tag -r 1 localtag2
748 $ hg tag -r 1 localtag2
749 $ hg tags -v
749 $ hg tags -v
750 tip 3:bbfb8cd42be2
750 tip 3:bbfb8cd42be2
751 localtag2 1:a0b6fe111088
751 localtag2 1:a0b6fe111088
752 localtag 1:a0b6fe111088
752 localtag 1:a0b6fe111088
753 globaltag 0:bbd179dfa0a7
753 globaltag 0:bbd179dfa0a7
754
754
755 $ hg tags -v
755 $ hg tags -v
756 tip 3:bbfb8cd42be2
756 tip 3:bbfb8cd42be2
757 localtag2 1:a0b6fe111088
757 localtag2 1:a0b6fe111088
758 localtag 1:a0b6fe111088
758 localtag 1:a0b6fe111088
759 globaltag 0:bbd179dfa0a7
759 globaltag 0:bbd179dfa0a7
760
760
761 $ cd ..
761 $ cd ..
762
762
763 Create a repository with tags data to test .hgtags fnodes transfer
763 Create a repository with tags data to test .hgtags fnodes transfer
764
764
765 $ hg init tagsserver
765 $ hg init tagsserver
766 $ cd tagsserver
766 $ cd tagsserver
767 $ touch foo
767 $ touch foo
768 $ hg -q commit -A -m initial
768 $ hg -q commit -A -m initial
769 $ hg tag -m 'tag 0.1' 0.1
769 $ hg tag -m 'tag 0.1' 0.1
770 $ echo second > foo
770 $ echo second > foo
771 $ hg commit -m second
771 $ hg commit -m second
772 $ hg tag -m 'tag 0.2' 0.2
772 $ hg tag -m 'tag 0.2' 0.2
773 $ hg tags
773 $ hg tags
774 tip 3:40f0358cb314
774 tip 3:40f0358cb314
775 0.2 2:f63cc8fe54e4
775 0.2 2:f63cc8fe54e4
776 0.1 0:96ee1d7354c4
776 0.1 0:96ee1d7354c4
777 $ cd ..
777 $ cd ..
778
778
779 Cloning should pull down hgtags fnodes mappings and write the cache file
779 Cloning should pull down hgtags fnodes mappings and write the cache file
780
780
781 $ hg clone --pull tagsserver tagsclient
781 $ hg clone --pull tagsserver tagsclient
782 requesting all changes
782 requesting all changes
783 adding changesets
783 adding changesets
784 adding manifests
784 adding manifests
785 adding file changes
785 adding file changes
786 added 4 changesets with 4 changes to 2 files
786 added 4 changesets with 4 changes to 2 files
787 new changesets 96ee1d7354c4:40f0358cb314
787 new changesets 96ee1d7354c4:40f0358cb314
788 updating to branch default
788 updating to branch default
789 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
790
790
791 Missing tags2* files means the cache wasn't written through the normal mechanism.
791 Missing tags2* files means the cache wasn't written through the normal mechanism.
792
792
793 $ ls tagsclient/.hg/cache
793 $ ls tagsclient/.hg/cache
794 branch2-base
794 branch2-base
795 branch2-immutable
795 branch2-immutable
796 branch2-served
796 branch2-served
797 branch2-served.hidden
797 branch2-served.hidden
798 branch2-visible
798 branch2-visible
799 branch2-visible-hidden
799 branch2-visible-hidden
800 hgtagsfnodes1
800 hgtagsfnodes1
801 rbc-names-v1
801 rbc-names-v1
802 rbc-revs-v1
802 rbc-revs-v1
803 tags2
803 tags2
804 tags2-served
804 tags2-served
805
805
806 Cache should contain the head only, even though other nodes have tags data
806 Cache should contain the head only, even though other nodes have tags data
807
807
808 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
808 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
809 tagsclient/.hg/cache/hgtagsfnodes1: size=96
809 tagsclient/.hg/cache/hgtagsfnodes1: size=96
810 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
810 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
811 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
811 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
812 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
812 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
813 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
813 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
814 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
814 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
815 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
815 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
816
816
817 Running hg tags should produce tags2* file and not change cache
817 Running hg tags should produce tags2* file and not change cache
818
818
819 $ hg -R tagsclient tags
819 $ hg -R tagsclient tags
820 tip 3:40f0358cb314
820 tip 3:40f0358cb314
821 0.2 2:f63cc8fe54e4
821 0.2 2:f63cc8fe54e4
822 0.1 0:96ee1d7354c4
822 0.1 0:96ee1d7354c4
823
823
824 $ ls tagsclient/.hg/cache
824 $ ls tagsclient/.hg/cache
825 branch2-base
825 branch2-base
826 branch2-immutable
826 branch2-immutable
827 branch2-served
827 branch2-served
828 branch2-served.hidden
828 branch2-served.hidden
829 branch2-visible
829 branch2-visible
830 branch2-visible-hidden
830 branch2-visible-hidden
831 hgtagsfnodes1
831 hgtagsfnodes1
832 rbc-names-v1
832 rbc-names-v1
833 rbc-revs-v1
833 rbc-revs-v1
834 tags2
834 tags2
835 tags2-served
835 tags2-served
836 tags2-visible
836 tags2-visible
837
837
838 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
838 $ f --size --hexdump tagsclient/.hg/cache/hgtagsfnodes1
839 tagsclient/.hg/cache/hgtagsfnodes1: size=96
839 tagsclient/.hg/cache/hgtagsfnodes1: size=96
840 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
840 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
841 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
841 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
842 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
842 0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
843 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
843 0030: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
844 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
844 0040: ff ff ff ff ff ff ff ff 40 f0 35 8c 19 e0 a7 d3 |........@.5.....|
845 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
845 0050: 8a 5c 6a 82 4d cf fb a5 87 d0 2f a3 1e 4f 2f 8a |.\j.M...../..O/.|
846
846
847 Check that the bundle includes cache data
847 Check that the bundle includes cache data
848
848
849 $ hg -R tagsclient bundle --all ./test-cache-in-bundle-all-rev.hg
849 $ hg -R tagsclient bundle --all ./test-cache-in-bundle-all-rev.hg
850 4 changesets found
850 4 changesets found
851 $ hg debugbundle ./test-cache-in-bundle-all-rev.hg
851 $ hg debugbundle ./test-cache-in-bundle-all-rev.hg
852 Stream params: {Compression: BZ}
852 Stream params: {Compression: BZ}
853 changegroup -- {nbchanges: 4, version: 02} (mandatory: True)
853 changegroup -- {nbchanges: 4, version: 02} (mandatory: True)
854 96ee1d7354c4ad7372047672c36a1f561e3a6a4c
854 96ee1d7354c4ad7372047672c36a1f561e3a6a4c
855 c4dab0c2fd337eb9191f80c3024830a4889a8f34
855 c4dab0c2fd337eb9191f80c3024830a4889a8f34
856 f63cc8fe54e4d326f8d692805d70e092f851ddb1
856 f63cc8fe54e4d326f8d692805d70e092f851ddb1
857 40f0358cb314c824a5929ee527308d90e023bc10
857 40f0358cb314c824a5929ee527308d90e023bc10
858 hgtagsfnodes -- {} (mandatory: True)
858 hgtagsfnodes -- {} (mandatory: True)
859 cache:rev-branch-cache -- {} (mandatory: False)
859 cache:rev-branch-cache -- {} (mandatory: False)
860
860
861 Check that local clone includes cache data
861 Check that local clone includes cache data
862
862
863 $ hg clone tagsclient tags-local-clone
863 $ hg clone tagsclient tags-local-clone
864 updating to branch default
864 updating to branch default
865 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
865 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
866 $ (cd tags-local-clone/.hg/cache/; ls -1 tag*)
866 $ (cd tags-local-clone/.hg/cache/; ls -1 tag*)
867 tags2
867 tags2
868 tags2-served
868 tags2-served
869 tags2-visible
869 tags2-visible
870
870
871 Avoid writing logs on trying to delete an already deleted tag
871 Avoid writing logs on trying to delete an already deleted tag
872 $ hg init issue5752
872 $ hg init issue5752
873 $ cd issue5752
873 $ cd issue5752
874 $ echo > a
874 $ echo > a
875 $ hg commit -Am 'add a'
875 $ hg commit -Am 'add a'
876 adding a
876 adding a
877 $ hg tag a
877 $ hg tag a
878 $ hg tags
878 $ hg tags
879 tip 1:bd7ee4f3939b
879 tip 1:bd7ee4f3939b
880 a 0:a8a82d372bb3
880 a 0:a8a82d372bb3
881 $ hg log
881 $ hg log
882 changeset: 1:bd7ee4f3939b
882 changeset: 1:bd7ee4f3939b
883 tag: tip
883 tag: tip
884 user: test
884 user: test
885 date: Thu Jan 01 00:00:00 1970 +0000
885 date: Thu Jan 01 00:00:00 1970 +0000
886 summary: Added tag a for changeset a8a82d372bb3
886 summary: Added tag a for changeset a8a82d372bb3
887
887
888 changeset: 0:a8a82d372bb3
888 changeset: 0:a8a82d372bb3
889 tag: a
889 tag: a
890 user: test
890 user: test
891 date: Thu Jan 01 00:00:00 1970 +0000
891 date: Thu Jan 01 00:00:00 1970 +0000
892 summary: add a
892 summary: add a
893
893
894 $ hg tag --remove a
894 $ hg tag --remove a
895 $ hg log
895 $ hg log
896 changeset: 2:e7feacc7ec9e
896 changeset: 2:e7feacc7ec9e
897 tag: tip
897 tag: tip
898 user: test
898 user: test
899 date: Thu Jan 01 00:00:00 1970 +0000
899 date: Thu Jan 01 00:00:00 1970 +0000
900 summary: Removed tag a
900 summary: Removed tag a
901
901
902 changeset: 1:bd7ee4f3939b
902 changeset: 1:bd7ee4f3939b
903 user: test
903 user: test
904 date: Thu Jan 01 00:00:00 1970 +0000
904 date: Thu Jan 01 00:00:00 1970 +0000
905 summary: Added tag a for changeset a8a82d372bb3
905 summary: Added tag a for changeset a8a82d372bb3
906
906
907 changeset: 0:a8a82d372bb3
907 changeset: 0:a8a82d372bb3
908 user: test
908 user: test
909 date: Thu Jan 01 00:00:00 1970 +0000
909 date: Thu Jan 01 00:00:00 1970 +0000
910 summary: add a
910 summary: add a
911
911
912 $ hg tag --remove a
912 $ hg tag --remove a
913 abort: tag 'a' is already removed
913 abort: tag 'a' is already removed
914 [10]
914 [10]
915 $ hg log
915 $ hg log
916 changeset: 2:e7feacc7ec9e
916 changeset: 2:e7feacc7ec9e
917 tag: tip
917 tag: tip
918 user: test
918 user: test
919 date: Thu Jan 01 00:00:00 1970 +0000
919 date: Thu Jan 01 00:00:00 1970 +0000
920 summary: Removed tag a
920 summary: Removed tag a
921
921
922 changeset: 1:bd7ee4f3939b
922 changeset: 1:bd7ee4f3939b
923 user: test
923 user: test
924 date: Thu Jan 01 00:00:00 1970 +0000
924 date: Thu Jan 01 00:00:00 1970 +0000
925 summary: Added tag a for changeset a8a82d372bb3
925 summary: Added tag a for changeset a8a82d372bb3
926
926
927 changeset: 0:a8a82d372bb3
927 changeset: 0:a8a82d372bb3
928 user: test
928 user: test
929 date: Thu Jan 01 00:00:00 1970 +0000
929 date: Thu Jan 01 00:00:00 1970 +0000
930 summary: add a
930 summary: add a
931
931
932 $ cat .hgtags
932 $ cat .hgtags
933 a8a82d372bb35b42ff736e74f07c23bcd99c371f a
933 a8a82d372bb35b42ff736e74f07c23bcd99c371f a
934 a8a82d372bb35b42ff736e74f07c23bcd99c371f a
934 a8a82d372bb35b42ff736e74f07c23bcd99c371f a
935 0000000000000000000000000000000000000000 a
935 0000000000000000000000000000000000000000 a
General Comments 0
You need to be logged in to leave comments. Login now