##// END OF EJS Templates
branchmap: read and write key part related to filtered revision...
Pierre-Yves David -
r18184:8d48af68 default
parent child Browse files
Show More
@@ -18,9 +18,14 b' def read(repo):'
18 return branchcache()
18 return branchcache()
19
19
20 try:
20 try:
21 last, lrev = lines.pop(0).split(" ", 1)
21 cachekey = lines.pop(0).split(" ", 2)
22 last, lrev = cachekey[:2]
22 last, lrev = bin(last), int(lrev)
23 last, lrev = bin(last), int(lrev)
23 partial = branchcache(tipnode=last, tiprev=lrev)
24 filteredhash = None
25 if len(cachekey) > 2:
26 filteredhash = bin(cachekey[2])
27 partial = branchcache(tipnode=last, tiprev=lrev,
28 filteredhash=filteredhash)
24 if not partial.validfor(repo):
29 if not partial.validfor(repo):
25 # invalidate the cache
30 # invalidate the cache
26 raise ValueError('tip differs')
31 raise ValueError('tip differs')
@@ -113,7 +118,10 b' class branchcache(dict):'
113 def write(self, repo):
118 def write(self, repo):
114 try:
119 try:
115 f = repo.opener("cache/branchheads", "w", atomictemp=True)
120 f = repo.opener("cache/branchheads", "w", atomictemp=True)
116 f.write("%s %s\n" % (hex(self.tipnode), self.tiprev))
121 cachekey = [hex(self.tipnode), str(self.tiprev)]
122 if self.filteredhash is not None:
123 cachekey.append(hex(self.filteredhash))
124 f.write(" ".join(cachekey) + '\n')
117 for label, nodes in self.iteritems():
125 for label, nodes in self.iteritems():
118 for node in nodes:
126 for node in nodes:
119 f.write("%s %s\n" % (hex(node), encoding.fromlocal(label)))
127 f.write("%s %s\n" % (hex(node), encoding.fromlocal(label)))
General Comments 0
You need to be logged in to leave comments. Login now