##// END OF EJS Templates
branchmap: log events related to branch cache...
Gregory Szorc -
r21031:05cfcecb default
parent child Browse files
Show More
@@ -8,6 +8,7 b''
8 from node import bin, hex, nullid, nullrev
8 from node import bin, hex, nullid, nullrev
9 import encoding
9 import encoding
10 import util
10 import util
11 import time
11
12
12 def _filename(repo):
13 def _filename(repo):
13 """name of a branchcache file for a given repo or repoview"""
14 """name of a branchcache file for a given repo or repoview"""
@@ -206,8 +207,10 b' class branchcache(dict):'
206 if self.filteredhash is not None:
207 if self.filteredhash is not None:
207 cachekey.append(hex(self.filteredhash))
208 cachekey.append(hex(self.filteredhash))
208 f.write(" ".join(cachekey) + '\n')
209 f.write(" ".join(cachekey) + '\n')
210 nodecount = 0
209 for label, nodes in sorted(self.iteritems()):
211 for label, nodes in sorted(self.iteritems()):
210 for node in nodes:
212 for node in nodes:
213 nodecount += 1
211 if node in self._closednodes:
214 if node in self._closednodes:
212 state = 'c'
215 state = 'c'
213 else:
216 else:
@@ -215,6 +218,9 b' class branchcache(dict):'
215 f.write("%s %s %s\n" % (hex(node), state,
218 f.write("%s %s %s\n" % (hex(node), state,
216 encoding.fromlocal(label)))
219 encoding.fromlocal(label)))
217 f.close()
220 f.close()
221 repo.ui.log('branchcache',
222 'wrote %s branch cache with %d labels and %d nodes\n',
223 repo.filtername, len(self), nodecount)
218 except (IOError, OSError, util.Abort):
224 except (IOError, OSError, util.Abort):
219 # Abort may be raise by read only opener
225 # Abort may be raise by read only opener
220 pass
226 pass
@@ -224,6 +230,7 b' class branchcache(dict):'
224 missing heads, and a generator of nodes that are strictly a superset of
230 missing heads, and a generator of nodes that are strictly a superset of
225 heads missing, this function updates self to be correct.
231 heads missing, this function updates self to be correct.
226 """
232 """
233 starttime = time.time()
227 cl = repo.changelog
234 cl = repo.changelog
228 # collect new branch entries
235 # collect new branch entries
229 newbranches = {}
236 newbranches = {}
@@ -272,3 +279,7 b' class branchcache(dict):'
272 self.tipnode = cl.node(tiprev)
279 self.tipnode = cl.node(tiprev)
273 self.tiprev = tiprev
280 self.tiprev = tiprev
274 self.filteredhash = self._hashfiltered(repo)
281 self.filteredhash = self._hashfiltered(repo)
282
283 duration = time.time() - starttime
284 repo.ui.log('branchcache', 'updated %s branch cache in %.4f seconds\n',
285 repo.filtername, duration)
@@ -55,8 +55,10 b' clone, commit, pull'
55 adding file changes
55 adding file changes
56 added 1 changesets with 1 changes to 1 files
56 added 1 changesets with 1 changes to 1 files
57 (run 'hg update' to get a working copy)
57 (run 'hg update' to get a working copy)
58 $ hg blackbox -l 3
58 $ hg blackbox -l 5
59 1970/01/01 00:00:00 bob> pull
59 1970/01/01 00:00:00 bob> pull
60 1970/01/01 00:00:00 bob> updated served branch cache in ?.???? seconds (glob)
61 1970/01/01 00:00:00 bob> wrote served branch cache with 1 labels and 2 nodes
60 1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62
62 1970/01/01 00:00:00 bob> 1 incoming changes - new heads: d02f48003e62
61 1970/01/01 00:00:00 bob> pull exited 0 after * seconds (glob)
63 1970/01/01 00:00:00 bob> pull exited 0 after * seconds (glob)
62
64
@@ -115,9 +117,11 b' backup bundles get logged'
115 $ hg strip tip
117 $ hg strip tip
116 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
117 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
119 saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
118 $ hg blackbox -l 3
120 $ hg blackbox -l 5
119 1970/01/01 00:00:00 bob> strip tip
121 1970/01/01 00:00:00 bob> strip tip
120 1970/01/01 00:00:00 bob> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
122 1970/01/01 00:00:00 bob> saved backup bundle to $TESTTMP/blackboxtest2/.hg/strip-backup/*-backup.hg (glob)
123 1970/01/01 00:00:00 bob> updated base branch cache in ?.???? seconds (glob)
124 1970/01/01 00:00:00 bob> wrote base branch cache with 1 labels and 2 nodes
121 1970/01/01 00:00:00 bob> strip tip exited 0 after * seconds (glob)
125 1970/01/01 00:00:00 bob> strip tip exited 0 after * seconds (glob)
122
126
123 tags cache gets logged
127 tags cache gets logged
General Comments 0
You need to be logged in to leave comments. Login now