treemanifest: add a test demonstrating histpack crash during amend
Summary:
As demonstrated by the added test. Traceback looks like:
File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 734, in __exit__
self.close()
File "/usr/lib/python2.7/site-packages/mercurial/transaction.py", line 40, in _active
return func(self, *args, **kwds)
File "/usr/lib/python2.7/site-packages/mercurial/transaction.py", line 468, in close
self._finalizecallback[cat](self)
File "/usr/lib/python2.7/site-packages/mercurial/localrepo.py", line 1371, in commitnotransaction
self.manifestlog.commitpending()
File "/usr/lib/python2.7/site-packages/hgext/treemanifest/__init__.py", line 681, in commitpending
hpack.close()
File "/usr/lib/python2.7/site-packages/hgext/remotefilelog/historypack.py", line 532, in close
self._write()
File "/usr/lib/python2.7/site-packages/hgext/remotefilelog/historypack.py", line 513, in _write
raise ValueError("attempting to add nullid linknode")
Reviewed By: DurhamG
Differential Revision: D8363934
fbshipit-source-id: ea84aa085b37541bce9a5e643a61cf17ae33e0b4
2018-06-12 03:58:44 +03:00
|
|
|
Crash in histpack code path where the amend destination already exists
|
|
|
|
|
2018-10-10 19:59:49 +03:00
|
|
|
$ enable undo treemanifest fastmanifest remotefilelog
|
treemanifest: add a test demonstrating histpack crash during amend
Summary:
As demonstrated by the added test. Traceback looks like:
File "/usr/lib/python2.7/site-packages/mercurial/util.py", line 734, in __exit__
self.close()
File "/usr/lib/python2.7/site-packages/mercurial/transaction.py", line 40, in _active
return func(self, *args, **kwds)
File "/usr/lib/python2.7/site-packages/mercurial/transaction.py", line 468, in close
self._finalizecallback[cat](self)
File "/usr/lib/python2.7/site-packages/mercurial/localrepo.py", line 1371, in commitnotransaction
self.manifestlog.commitpending()
File "/usr/lib/python2.7/site-packages/hgext/treemanifest/__init__.py", line 681, in commitpending
hpack.close()
File "/usr/lib/python2.7/site-packages/hgext/remotefilelog/historypack.py", line 532, in close
self._write()
File "/usr/lib/python2.7/site-packages/hgext/remotefilelog/historypack.py", line 513, in _write
raise ValueError("attempting to add nullid linknode")
Reviewed By: DurhamG
Differential Revision: D8363934
fbshipit-source-id: ea84aa085b37541bce9a5e643a61cf17ae33e0b4
2018-06-12 03:58:44 +03:00
|
|
|
$ setconfig experimental.evolution=createmarkers treemanifest.treeonly=1 remotefilelog.reponame=foo remotefilelog.cachepath=$TESTTMP/cache
|
|
|
|
$ newrepo
|
|
|
|
$ drawdag << 'EOS'
|
|
|
|
> B
|
|
|
|
> |
|
|
|
|
> A
|
|
|
|
> EOS
|
|
|
|
|
|
|
|
$ enable undo
|
|
|
|
$ hg up -q $B
|
|
|
|
$ echo foo > msg
|
|
|
|
$ hg commit --amend -l msg
|
|
|
|
$ hg undo -q
|
2018-08-22 13:43:12 +03:00
|
|
|
hint[undo-uncommit-unamend]: undoing amends discards their changes.
|
|
|
|
to restore the changes to the working copy, run 'hg revert -r 220f69710758 --all'
|
|
|
|
in the future, you can use 'hg unamend' instead of 'hg undo' to keep changes
|
|
|
|
hint[hint-ack]: use 'hg hint --ack undo-uncommit-unamend' to silence these hints
|
2018-06-12 03:58:45 +03:00
|
|
|
$ hg commit --amend -l msg
|
|
|
|
|
|
|
|
Make sure no invalid manifests were written:
|
|
|
|
|
|
|
|
$ cd .hg/store/packs/manifests
|
|
|
|
$ for i in *.histidx; do hg debughistorypack $i; done
|
|
|
|
|
|
|
|
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
2018-08-17 19:33:59 +03:00
|
|
|
41b34f08c135 000000000000 000000000000 426bada5c675
|
2018-06-12 03:58:45 +03:00
|
|
|
|
|
|
|
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
2018-08-17 19:33:59 +03:00
|
|
|
eb7988638387 41b34f08c135 000000000000 220f69710758
|
2018-06-12 03:58:45 +03:00
|
|
|
|
|
|
|
|
|
|
|
Node P1 Node P2 Node Link Node Copy From
|
2018-08-17 19:33:59 +03:00
|
|
|
eb7988638387 41b34f08c135 000000000000 112478962961
|