Mercurial > public > mercurial-scm > hg
comparison mercurial/bundlerepo.py @ 27753:d4071cc73f46
changegroup3: add empty chunk separating directories and files
Remotefilelog overrides changegroup._addchangegroupfiles(), assuming
it is about files, which seems like a natural assumption. However, in
changegroup3, directory manifests are sent in the files section of the
changegroup. These naturally make remotefilelog unhappy.
The fact that the directories are not separated from the files
(although they do come before the files) also makes server.validate
harder to implement. Since we read one chunk at a time from the steam,
once we have found a file (non-directory) entry in the stream, we
would have to push the read data back into the stream, or otherwise
refactor the code. It will be easier if we add an empty chunk after
all directory manifests.
This change adds that empty chunk, although we don't yet take
advantage of it on the reading side. We will soon move the tree
manifest stuff out of _addchangegroupfiles() and into
_unpackmanifests().
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 11 Jan 2016 15:10:31 -0800 |
parents | a40e2f7fe49d |
children | 6fe2da48a6dd |
comparison
equal
deleted
inserted
replaced
27752:29cfc474c5fd | 27753:d4071cc73f46 |
---|---|
327 def manifest(self): | 327 def manifest(self): |
328 self.bundle.seek(self.manstart) | 328 self.bundle.seek(self.manstart) |
329 # consume the header if it exists | 329 # consume the header if it exists |
330 self.bundle.manifestheader() | 330 self.bundle.manifestheader() |
331 m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev) | 331 m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev) |
332 # XXX: hack to work with changegroup3, but we still don't handle | |
333 # tree manifests correctly | |
334 if self.bundle.version == "03": | |
335 self.bundle.filelogheader() | |
332 self.filestart = self.bundle.tell() | 336 self.filestart = self.bundle.tell() |
333 return m | 337 return m |
334 | 338 |
335 @localrepo.unfilteredpropertycache | 339 @localrepo.unfilteredpropertycache |
336 def manstart(self): | 340 def manstart(self): |