treemanifest: test for pulling normal scratch branch into treeonly repo

Adds a test and improves output for dealing pulling a normal scratch branch into
a treeonly repo (so the manifest doesn't exist).

In the future we could fix this by having the server generate the trees on the
fly for infinitepush branches that don't already have them.

Differential Revision: https://phab.mercurial-scm.org/D1268
This commit is contained in:
Durham Goode 2017-11-01 17:10:05 -07:00
parent 0ea3abac80
commit d6440bad3c
2 changed files with 22 additions and 5 deletions

View File

@ -193,6 +193,19 @@ Pull a treeonly scratch branch into a treeonly client
-rw-r--r-- 0 undo.phaseroots
Pull a normal scratch branch into a treeonly client
$ hg pull -r scratch/nontree
pulling from ssh://user@dummy/master
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
new changesets 42ec76eb772a
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hg log -r 42ec76eb772a -T ' ' --stat
abort: unable to download the following trees from the server:
bf0601d5cb94247e00d0bdd1d8327f0dd36f54e9
[255]
$ cd ..
Verify its not on the server

View File

@ -679,9 +679,8 @@ def _unpackmanifestscg1(orig, self, repo, *args, **kwargs):
if repo.ui.configbool('treemanifest', 'treeonly'):
self.manifestheader()
chain = None
for chunkdata in iter(lambda: self.deltachunk(chain), {}):
chain = chunkdata['node']
for chunkdata in self.deltaiter():
pass
return
mfrevlog = repo.manifestlog._revlog
@ -1008,8 +1007,13 @@ def _prefetchtrees(repo, rootdir, mfnodes, basemfnodes, directories):
raise error.Abort(_("unable to download %d trees (%s,...)") %
(len(missingnodes), list(missingnodes)[0]))
except bundle2.AbortFromPart as exc:
repo.ui.status(_('remote: abort: %s\n') % exc)
raise error.Abort(_('pull failed on remote'), hint=exc.hint)
repo.ui.debug('remote: abort: %s\n' % exc)
hexnodes = list(hex(mfnode) for mfnode in mfnodes)
nodestr = '\n'.join(hexnodes[:10])
if len(hexnodes) > 10:
nodestr += '\n...'
raise error.Abort(_('unable to download the following trees from the '
'server:\n%s') % nodestr, hint=exc.hint)
except error.BundleValueError as exc:
raise error.Abort(_('missing support for %s') % exc)
finally: