diff --git a/fastmanifest/implementation.py b/fastmanifest/implementation.py --- a/fastmanifest/implementation.py +++ b/fastmanifest/implementation.py @@ -823,6 +823,13 @@ @propertycache def parents(self): + if util.safehasattr(self._manifestlog, 'historystore'): + store = self._manifestlog.historystore + try: + p1, p2, linknode, copyfrom = store.getnodeinfo('', self._node) + return p1, p2 + except KeyError: + pass return self._revlog.parents(self._node) def read(self): diff --git a/tests/test-treemanifest-server.t b/tests/test-treemanifest-server.t --- a/tests/test-treemanifest-server.t +++ b/tests/test-treemanifest-server.t @@ -119,12 +119,16 @@ abort: push failed on remote [255] -Test pushing only trees with commit hooks -TODO: change this to create a treeonly commit and try to push it - $ hg push --to mybook +Test pushing tree-only commit with commit hooks + $ hg up -q '.^' + $ mkdir subdir2 + $ echo >> subdir2/z + $ hg commit -qAm 'add subdir2/z (treeonly)' --config treemanifest.treeonly=True + 1 trees fetched over * (glob) + $ hg push --to mybook -r . pushing to ssh://user@dummy/master searching for changes - remote: +++ hg log -r 15486e46ccf6947fbb0a0209e6ce479e7f87ffae -T '{file_adds}' + remote: +++ hg log -r aa8c79ec65bb33cc0dff01df2d70f8635cffc02d -T '{file_adds}' remote: ++ [[ subdir2/z == \s\u\b\d\i\r\2\/\z ]] remote: ++ exit 1 remote: prepushrebase.myhook hook exited with status 1 @@ -133,11 +137,16 @@ $ mv ../master/.hg/hgrc.bak ../master/.hg/hgrc Test pushing only trees (no flats) with pushrebase creates trees on the server - $ hg push --to mybook + $ hg push --to mybook -r . pushing to ssh://user@dummy/master searching for changes remote: pushing 1 changeset: - remote: 15486e46ccf6 add subdir2/z + remote: aa8c79ec65bb add subdir2/z (treeonly) + remote: 1 new changeset from the server will be downloaded + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files (+1 heads) $ ls ../master/.hg/store/meta subdir subdir2 @@ -149,14 +158,14 @@ Verify flat was updated and tree was updated, even though only tree was sent $ hg debugdata .hg/store/00manifest.i 1 subdir/x\x001406e74118627694268417491f018a4a883152f0 (esc) - subdir2/z\x0069a1b67522704ec122181c0890bd16e9d3e7516a (esc) + subdir2/z\x00cc31c19aff7dbbbed214ec304839a8003fdd0b10 (esc) $ hg debugdata .hg/store/00manifesttree.i 1 subdir\x00bc0c2c938b929f98b1c31a8c5994396ebb096bf0t (esc) - subdir2\x00ddb35f099a648a43a997aef53123bce309c794fdt (esc) + subdir2\x0002fd4859c40acf72a0ce0f75c2f8bef76935f3dct (esc) $ hg debugdata .hg/store/meta/subdir2/00manifest.i 0 - z\x0069a1b67522704ec122181c0890bd16e9d3e7516a (esc) + z\x00cc31c19aff7dbbbed214ec304839a8003fdd0b10 (esc) Test stripping trees $ hg up -q tip @@ -165,19 +174,19 @@ $ hg debugindex .hg/store/00manifesttree.i rev offset length delta linkrev nodeid p1 p2 0 0 50 -1 0 85b359fdb09e 000000000000 000000000000 - 1 50 62 0 1 54cbf534b62b 85b359fdb09e 000000000000 - 2 112 61 1 2 a6f4164c3e4e 54cbf534b62b 000000000000 + 1 50 62 0 1 7e680cec965b 85b359fdb09e 000000000000 + 2 112 61 1 2 d03189a14084 7e680cec965b 000000000000 $ hg debugindex .hg/store/meta/subdir/00manifest.i rev offset length delta linkrev nodeid p1 p2 0 0 44 -1 0 bc0c2c938b92 000000000000 000000000000 1 44 54 0 2 126c4ddee02e bc0c2c938b92 000000000000 $ hg strip -r tip 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - saved backup bundle to $TESTTMP/master/.hg/strip-backup/0619d7982079-bc05b04f-backup.hg (glob) + saved backup bundle to $TESTTMP/master/.hg/strip-backup/4fd4fee9fca1-46b625db-backup.hg (glob) $ hg debugindex .hg/store/00manifesttree.i rev offset length delta linkrev nodeid p1 p2 0 0 50 -1 0 85b359fdb09e 000000000000 000000000000 - 1 50 62 0 1 54cbf534b62b 85b359fdb09e 000000000000 + 1 50 62 0 1 7e680cec965b 85b359fdb09e 000000000000 $ hg debugindex .hg/store/meta/subdir/00manifest.i rev offset length delta linkrev nodeid p1 p2 0 0 44 -1 0 bc0c2c938b92 000000000000 000000000000