Changeset 4a415b6458b2…
Parent 72bc313a59ac…
by Andrew Pritchard <andrewp@fogcreek.com>
Changes to one file · Browse files at 4a415b6458b2 Showing diff from parent 72bc313a59ac Diff from another changeset...
@@ -9,6 +9,8 @@ import bfutil
import bfsetup
+_heads_prefix = 'kbfiles\n'
+
def putbfile(repo, proto, sha):
"""putbfile puts a bfile into a repository's local cache and into the system cache."""
f = None
@@ -101,8 +103,8 @@ f = wireproto.future()
yield {}, f
d = f.value
- if d[:8] == 'kbfiles\n':
- d = d[8:]
+ if d[:len(_heads_prefix)] == _heads_prefix:
+ d = d[len(_heads_prefix):]
try:
yield wireproto.decodelist(d[:-1])
except ValueError:
@@ -129,5 +131,5 @@
def heads(repo, proto):
if bfutil.iskbfilesrepo(repo):
- return 'kbfiles\n' + wireproto.heads(repo, proto)
+ return _heads_prefix + wireproto.heads(repo, proto)
return wireproto.heads(repo, proto)
|
Loading...