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