##// END OF EJS Templates
py3: fix formatting of branchmap log messages with repo.filtername=None...
Martin von Zweigbergk -
r42805:c7d236b5 default
parent child Browse files
Show More
@@ -121,6 +121,12 b' def _unknownnode(node):'
121 """
121 """
122 raise ValueError(r'node %s does not exist' % pycompat.sysstr(hex(node)))
122 raise ValueError(r'node %s does not exist' % pycompat.sysstr(hex(node)))
123
123
124 def _branchcachedesc(repo):
125 if repo.filtername is not None:
126 return 'branch cache (%s)' % repo.filtername
127 else:
128 return 'branch cache'
129
124 class branchcache(object):
130 class branchcache(object):
125 """A dict like object that hold branches heads cache.
131 """A dict like object that hold branches heads cache.
126
132
@@ -241,11 +247,9 b' class branchcache(object):'
241
247
242 except Exception as inst:
248 except Exception as inst:
243 if repo.ui.debugflag:
249 if repo.ui.debugflag:
244 msg = 'invalid branchheads cache'
250 msg = 'invalid %s: %s\n'
245 if repo.filtername is not None:
251 repo.ui.debug(msg % (_branchcachedesc(repo),
246 msg += ' (%s)' % repo.filtername
252 pycompat.bytestr(inst)))
247 msg += ': %s\n'
248 repo.ui.debug(msg % pycompat.bytestr(inst))
249 bcache = None
253 bcache = None
250
254
251 finally:
255 finally:
@@ -351,9 +355,8 b' class branchcache(object):'
351 state = 'o'
355 state = 'o'
352 f.write("%s %s %s\n" % (hex(node), state, label))
356 f.write("%s %s %s\n" % (hex(node), state, label))
353 f.close()
357 f.close()
354 repo.ui.log('branchcache',
358 repo.ui.log('branchcache', 'wrote %s with %d labels and %d nodes\n',
355 'wrote %s branch cache with %d labels and %d nodes\n',
359 _branchcachedesc(repo), len(self._entries), nodecount)
356 repo.filtername, len(self._entries), nodecount)
357 except (IOError, OSError, error.Abort) as inst:
360 except (IOError, OSError, error.Abort) as inst:
358 # Abort may be raised by read only opener, so log and continue
361 # Abort may be raised by read only opener, so log and continue
359 repo.ui.debug("couldn't write branch cache: %s\n" %
362 repo.ui.debug("couldn't write branch cache: %s\n" %
@@ -424,8 +427,8 b' class branchcache(object):'
424 self.filteredhash = scmutil.filteredhash(repo, self.tiprev)
427 self.filteredhash = scmutil.filteredhash(repo, self.tiprev)
425
428
426 duration = util.timer() - starttime
429 duration = util.timer() - starttime
427 repo.ui.log('branchcache', 'updated %s branch cache in %.4f seconds\n',
430 repo.ui.log('branchcache', 'updated %s in %.4f seconds\n',
428 repo.filtername or b'None', duration)
431 _branchcachedesc(repo), duration)
429
432
430 self.write(repo)
433 self.write(repo)
431
434
@@ -125,8 +125,8 b' clone, commit, pull'
125 (run 'hg update' to get a working copy)
125 (run 'hg update' to get a working copy)
126 $ hg blackbox -l 6
126 $ hg blackbox -l 6
127 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull
127 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull
128 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated served branch cache in * seconds (glob)
128 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (served) in * seconds (glob)
129 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote served branch cache with 1 labels and 2 nodes
129 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (served) with 1 labels and 2 nodes
130 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
130 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> 1 incoming changes - new heads: d02f48003e62
131 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
131 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pull exited 0 after * seconds (glob)
132 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
132 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
@@ -189,8 +189,8 b' backup bundles get logged'
189 $ hg blackbox -l 6
189 $ hg blackbox -l 6
190 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
190 1970/01/01 00:00:00 bob @73f6ee326b27d820b0472f1a825e3a50f3dc489b (5000)> strip tip
191 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg
191 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/73f6ee326b27-7612e004-backup.hg
192 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated base branch cache in * seconds (glob)
192 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> updated branch cache (base) in * seconds (glob)
193 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote base branch cache with 1 labels and 2 nodes
193 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> wrote branch cache (base) with 1 labels and 2 nodes
194 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
194 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> strip tip exited 0 after * seconds (glob)
195 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
195 1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> blackbox -l 6
196
196
@@ -303,8 +303,8 b' log rotation'
303 result: 0
303 result: 0
304 $ hg blackbox
304 $ hg blackbox
305 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache
305 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updating the branch cache
306 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob)
306 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated branch cache (served) in * seconds (glob)
307 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes
307 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote branch cache (served) with 1 labels and 1 nodes
308 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob)
308 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug commit -m commit2 -d 2000-01-02 foo exited 0 after *.?? seconds (glob)
309 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0
309 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> --debug log -r 0
310 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
310 1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags
@@ -181,7 +181,7 b' Make sure bookmark movement is correct'
181 starting 4 threads for background file closing (?)
181 starting 4 threads for background file closing (?)
182 changed branch on 2 changesets
182 changed branch on 2 changesets
183 updating the branch cache
183 updating the branch cache
184 invalid branchheads cache (served): tip differs
184 invalid branch cache (served): tip differs
185
185
186 $ hg glog -r '(.^)::'
186 $ hg glog -r '(.^)::'
187 @ 9:de1404b45a69 Added e
187 @ 9:de1404b45a69 Added e
@@ -324,8 +324,8 b' Check that the right ancestors is used w'
324 bundle2-input-part: total payload size 24
324 bundle2-input-part: total payload size 24
325 bundle2-input-bundle: 2 parts total
325 bundle2-input-bundle: 2 parts total
326 updating the branch cache
326 updating the branch cache
327 invalid branchheads cache (served): tip differs
327 invalid branch cache (served): tip differs
328 invalid branchheads cache (served.hidden): tip differs
328 invalid branch cache (served.hidden): tip differs
329 rebase completed
329 rebase completed
330
330
331 Test minimization of merge conflicts
331 Test minimization of merge conflicts
@@ -861,7 +861,7 b' check strip behavior'
861 bundle2-output-part: "phase-heads" 24 bytes payload
861 bundle2-output-part: "phase-heads" 24 bytes payload
862 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
862 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
863 updating the branch cache
863 updating the branch cache
864 invalid branchheads cache (served): tip differs
864 invalid branch cache (served): tip differs
865 $ hg log -G
865 $ hg log -G
866 o changeset: 2:5c51d8d6557d
866 o changeset: 2:5c51d8d6557d
867 | tag: tip
867 | tag: tip
General Comments 0
You need to be logged in to leave comments. Login now