mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
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:
parent
0ea3abac80
commit
d6440bad3c
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user