mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 22:47:26 +03:00
revlog: turn on head-based-commit-transaction for tests
Summary: Bypass truncation-based transaction if narrow-heads is on. The transaction abort still works logically because commit references stay unchanged on abort. Related EdenFS and Mononoke tests are updated. Mononoke tests probably shouldn't rely on revlog / fncache implementation details in hg. Reviewed By: DurhamG Differential Revision: D22240186 fbshipit-source-id: f97efd60855467b52c9fb83e7c794ded269e9617
This commit is contained in:
parent
3244065fb4
commit
b80966f93c
@ -32,10 +32,7 @@ class RollbackTest(EdenHgTestCase):
|
||||
"--config",
|
||||
"hooks.pretxncommit=false",
|
||||
)
|
||||
expected_msg = (
|
||||
b"transaction abort!\nrollback completed\n"
|
||||
b"abort: pretxncommit hook exited with status 1\n"
|
||||
)
|
||||
expected_msg = b"abort: pretxncommit hook exited with status 1\n"
|
||||
self.assertIn(expected_msg, context.exception.stderr)
|
||||
|
||||
self.assertEqual(
|
||||
|
@ -43,14 +43,6 @@ setup repo-hg
|
||||
create master bookmark
|
||||
$ hg bookmark master_bookmark -r tip
|
||||
|
||||
check that the file created had both the content and path large enough to
|
||||
create a hashed index and data revlogs
|
||||
|
||||
$ du .hg/store/dh/this/is/a/very/long/path/that/we/want/to/test/in/order/to/ensure/our/this_i75ebb3f31bf65e471c16ebbef3bc32a326d92ae6.i
|
||||
4 .hg/store/dh/this/is/a/very/long/path/that/we/want/to/test/in/order/to/ensure/our/this_i75ebb3f31bf65e471c16ebbef3bc32a326d92ae6.i
|
||||
$ du .hg/store/dh/this/is/a/very/long/path/that/we/want/to/test/in/order/to/ensure/our/this_i4680ea2a5b12ad9620ef7e598dcae10adf62b11c.d
|
||||
(152|156) .hg/store/dh/this/is/a/very/long/path/that/we/want/to/test/in/order/to/ensure/our/this_i4680ea2a5b12ad9620ef7e598dcae10adf62b11c.d (re)
|
||||
|
||||
blobimport and start mononoke
|
||||
|
||||
$ cd $TESTTMP
|
||||
|
@ -290,7 +290,7 @@ coreconfigitem("experimental", "graphshorten", default=False)
|
||||
coreconfigitem("experimental", "graphstyle.parent", default=dynamicdefault)
|
||||
coreconfigitem("experimental", "graphstyle.missing", default=dynamicdefault)
|
||||
coreconfigitem("experimental", "graphstyle.grandparent", default=dynamicdefault)
|
||||
coreconfigitem("experimental", "head-based-commit-transaction", default=False)
|
||||
coreconfigitem("experimental", "head-based-commit-transaction", default=util.istest())
|
||||
coreconfigitem("experimental", "hook-track-tags", default=False)
|
||||
coreconfigitem("experimental", "httppostargs", default=False)
|
||||
coreconfigitem("experimental", "manifestv2", default=False)
|
||||
|
@ -44,6 +44,7 @@ def debugbruterebase(ui, repo, source, dest):
|
||||
tr = repo.transaction("rebase")
|
||||
tr.report = lambda x: 0 # hide "transaction abort"
|
||||
|
||||
oldnodes = set(repo.nodes("all()"))
|
||||
ui.pushbuffer()
|
||||
try:
|
||||
rebase.rebase(ui, repo, dest=dest, rev=[spec])
|
||||
@ -55,7 +56,9 @@ def debugbruterebase(ui, repo, source, dest):
|
||||
# short summary about new nodes
|
||||
cl = repo.changelog
|
||||
descs = []
|
||||
for rev in xrange(repolen, len(repo)):
|
||||
newnodes = set(repo.nodes("all()"))
|
||||
newrevs = list(map(cl.rev, newnodes - oldnodes))
|
||||
for rev in sorted(newrevs):
|
||||
desc = "%s:" % getdesc(rev)
|
||||
for prev in cl.parentrevs(rev):
|
||||
if prev > -1:
|
||||
|
@ -35,6 +35,9 @@ narrowheadsincompatiblelist = """
|
||||
test-revset-t.py
|
||||
"""
|
||||
|
||||
transactionincompatiblelist = """
|
||||
"""
|
||||
|
||||
|
||||
def setup(testname, hgrcpath):
|
||||
# Disable mutation.record to maintain commit hashes.
|
||||
@ -48,3 +51,7 @@ def setup(testname, hgrcpath):
|
||||
if testname in narrowheadsincompatiblelist:
|
||||
with open(hgrcpath, "a") as f:
|
||||
f.write("\n[experimental]\nnarrow-heads=False\n")
|
||||
# Disable head-based-commit-transaction if incomaptible.
|
||||
if testname in transactionincompatiblelist:
|
||||
with open(hgrcpath, "a") as f:
|
||||
f.write("\n[experimental]\nhead-based-commit-transaction=False\n")
|
||||
|
@ -34,14 +34,10 @@ sh % "hg add foo"
|
||||
|
||||
sh % "hg ci -m foo" == r"""
|
||||
error: pretxncommit.nocommits hook failed: no commits allowed
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: no commits allowed
|
||||
[255]"""
|
||||
sh % "hg ci -m foo" == r"""
|
||||
error: pretxncommit.nocommits hook failed: no commits allowed
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: no commits allowed
|
||||
[255]"""
|
||||
|
||||
|
@ -222,8 +222,6 @@ amend.autorestack=no-conflict, and conflicting changes (expect cancelled restack
|
||||
rebasing b6c0d35dc9e9 "C" (C)
|
||||
rebasing 02cc3cc1d010 "D" (D)
|
||||
merging file
|
||||
transaction abort!
|
||||
rollback completed
|
||||
restacking would create conflicts (hit merge conflicts in file), so you must run it manually
|
||||
(run `hg restack` manually to restack this commit's children)
|
||||
$ showgraph
|
||||
|
@ -84,7 +84,7 @@ Pull the new commits in the clone
|
||||
adding manifests
|
||||
adding file changes
|
||||
added 1 changesets with 1 changes to 1 files
|
||||
pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SHAREDPENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
|
||||
pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_NODE_LAST=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
|
||||
remote: changegroup2
|
||||
adding changesets
|
||||
adding manifests
|
||||
@ -151,7 +151,7 @@ pullop.cgresult
|
||||
adding manifests
|
||||
adding file changes
|
||||
added 2 changesets with 2 changes to 2 files
|
||||
pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_PENDING=$TESTTMP/clone HG_SHAREDPENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
|
||||
pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_NODE_LAST=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
|
||||
remote: changegroup2
|
||||
adding changesets
|
||||
adding manifests
|
||||
@ -218,7 +218,7 @@ pullop.cgresult
|
||||
adding manifests
|
||||
adding file changes
|
||||
added 1 changesets with 0 changes to 0 files
|
||||
pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SHAREDPENDING=$TESTTMP/clone HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
|
||||
pretxnchangegroup hook: HG_HOOKNAME=pretxnchangegroup HG_HOOKTYPE=pretxnchangegroup HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_NODE_LAST=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/repo
|
||||
remote: changegroup2
|
||||
adding changesets
|
||||
adding manifests
|
||||
|
@ -32,8 +32,6 @@ start a commit...
|
||||
$ sleep 1
|
||||
$ hg pull ../source 2>/dev/null
|
||||
pulling from ../source
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxncommit hook exited with status 1
|
||||
searching for changes
|
||||
adding changesets
|
||||
@ -49,6 +47,9 @@ see what happened
|
||||
checking manifests
|
||||
crosschecking files in changesets and manifests
|
||||
checking files
|
||||
1 files, 2 changesets, 2 total revisions
|
||||
warning: revlog 'data/bar.i' not in fncache!
|
||||
2 files, 3 changesets, 3 total revisions
|
||||
1 warnings encountered!
|
||||
hint: run "hg debugrebuildfncache" to recover from corrupt fncache
|
||||
|
||||
$ cd ..
|
||||
|
@ -28,7 +28,6 @@ List files in store/data (should show a 'b.d'):
|
||||
> echo $i
|
||||
> done
|
||||
.hg/store/data/a.i
|
||||
.hg/store/data/b.d
|
||||
.hg/store/data/b.i
|
||||
|
||||
Default operation:
|
||||
@ -68,9 +67,8 @@ No update, with debug option:
|
||||
progress: linking: 8
|
||||
progress: linking: 9
|
||||
progress: linking: 10
|
||||
progress: linking: 11
|
||||
progress: linking (end)
|
||||
linked 11 files
|
||||
linked 10 files
|
||||
progress: migrating commit data: 1/11 commits (9.09%)
|
||||
progress: migrating commit data: 2/11 commits (18.18%)
|
||||
progress: migrating commit data: 3/11 commits (27.27%)
|
||||
|
@ -158,8 +158,8 @@ at first, test saving last-message.txt
|
||||
|
||||
$ rm -f .hg/last-message.txt
|
||||
$ hg commit --amend -m "message given from command line"
|
||||
transaction abort!
|
||||
rollback completed
|
||||
transaction abort! (?)
|
||||
rollback completed (?)
|
||||
abort: pretxncommit.test-saving-last-message hook exited with status 1
|
||||
[255]
|
||||
|
||||
@ -179,8 +179,8 @@ at first, test saving last-message.txt
|
||||
HG: branch 'default'
|
||||
HG: added B
|
||||
HG: changed A
|
||||
transaction abort!
|
||||
rollback completed
|
||||
transaction abort! (?)
|
||||
rollback completed (?)
|
||||
abort: pretxncommit.test-saving-last-message hook exited with status 1
|
||||
[255]
|
||||
|
||||
@ -223,7 +223,7 @@ Same, but with changes in working dir (different code path):
|
||||
|
||||
$ rm editor.sh
|
||||
$ hg log -r .
|
||||
changeset: 9:f7f2c5aae908
|
||||
changeset: 10:f7f2c5aae908
|
||||
parent: 0:4a2df7238c3b
|
||||
user: foo
|
||||
date: Thu Jan 01 00:00:01 1970 +0000
|
||||
|
@ -92,8 +92,6 @@
|
||||
|
||||
$ echo space2 > asdf
|
||||
$ hg commit -u ' ' -m commit-1
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: empty username!
|
||||
[255]
|
||||
|
||||
|
@ -373,8 +373,10 @@ filemap rename undoing revision rename
|
||||
repository tip rolled back to revision 0 (undo convert)
|
||||
0 modify
|
||||
$ glog -R renameundo2
|
||||
o 1 "modify" files: a c
|
||||
o 2 "modify" files: a c
|
||||
|
|
||||
| o 1 "rename" files:
|
||||
|/
|
||||
o 0 "add" files: a c
|
||||
|
||||
|
||||
|
@ -28,8 +28,6 @@ should fail with encoding error
|
||||
? latin-1-tag
|
||||
? utf-8
|
||||
$ HGENCODING=ascii hg ci -l latin-1
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: decoding near ' encoded: \xe9': 'utf8' codec can't decode byte 0xe9 in position 20: unexpected end of data! (esc)
|
||||
[255]
|
||||
|
||||
|
@ -23,13 +23,12 @@ sh % 'hg commit -A -l "$TESTDIR/ctrlchar-msg.txt"' == r"""
|
||||
non-printable characters in commit message
|
||||
Line 5: 'This has a sneaky ctrl-A: \x01'
|
||||
Line 6: 'And this has esc: \x1b'
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxncommit.checkmessage hook failed
|
||||
[255]"""
|
||||
sh % 'hg commit -A -l "$TESTDIR/perfectlyok-msg.txt"' == "adding a"
|
||||
sh % "hg log -r ." == r"""
|
||||
changeset: 0:d9cf9881be7b
|
||||
changeset: 1:d9cf9881be7b
|
||||
parent: -1:000000000000
|
||||
user: test
|
||||
date: Thu Jan 01 00:00:00 1970 +0000
|
||||
summary: This commit message is perfectly OK, and has no sneaky control characters."""
|
||||
|
@ -131,22 +131,6 @@ def basic(repo):
|
||||
repo.cached
|
||||
|
||||
|
||||
def test_filecache_synced():
|
||||
# test old behavior that caused filecached properties to go out of sync
|
||||
os.system("hg init && echo a >> a && hg ci -qAm.")
|
||||
repo = hg.repository(uimod.ui.load())
|
||||
# first rollback clears the filecache, but changelog to stays in __dict__
|
||||
repo.rollback()
|
||||
repo.commit(".")
|
||||
# second rollback comes along and touches the changelog externally
|
||||
# (file is moved)
|
||||
repo.rollback()
|
||||
# but since changelog isn't under the filecache control anymore, we don't
|
||||
# see that it changed, and return the old changelog without reconstructing
|
||||
# it
|
||||
repo.commit(".")
|
||||
|
||||
|
||||
def setbeforeget(repo):
|
||||
os.remove("x")
|
||||
os.remove("y")
|
||||
@ -231,8 +215,6 @@ print("basic:")
|
||||
print()
|
||||
basic(fakerepo())
|
||||
print()
|
||||
test_filecache_synced()
|
||||
print()
|
||||
print("setbeforeget:")
|
||||
print()
|
||||
setbeforeget(fakerepo())
|
||||
|
@ -19,11 +19,6 @@ creating
|
||||
* both files changed inode
|
||||
creating
|
||||
|
||||
repository tip rolled back to revision -1 (undo commit)
|
||||
working directory now based on revision -1
|
||||
repository tip rolled back to revision -1 (undo commit)
|
||||
working directory now based on revision -1
|
||||
|
||||
setbeforeget:
|
||||
|
||||
* neither file exists
|
||||
|
@ -312,8 +312,6 @@ check saving last-message.txt, at first
|
||||
HG: added f
|
||||
====
|
||||
note: commit message saved in .hg/last-message.txt
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxncommit.unexpectedabort hook exited with status 1
|
||||
[255]
|
||||
$ cat .hg/last-message.txt
|
||||
@ -336,8 +334,6 @@ action)
|
||||
HG: branch 'default'
|
||||
HG: added f
|
||||
note: commit message saved in .hg/last-message.txt
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxncommit.unexpectedabort hook exited with status 1
|
||||
[255]
|
||||
|
||||
@ -349,12 +345,12 @@ action)
|
||||
|
||||
then, check "modify the message" itself
|
||||
|
||||
$ hg histedit tip --commands - 2>&1 << EOF | fixbundle
|
||||
$ hg histedit . --commands - << EOF | fixbundle
|
||||
> mess 1fd3b2fe7754 f
|
||||
> EOF
|
||||
$ hg status
|
||||
$ hg log --limit 1
|
||||
changeset: 12:62feedb1200e
|
||||
changeset: 13:62feedb1200e
|
||||
parent: 8:a5e1ba2f7afb
|
||||
user: test
|
||||
date: Thu Jan 01 00:00:00 1970 +0000
|
||||
|
@ -198,8 +198,6 @@ check saving last-message.txt
|
||||
HG: added d
|
||||
HG: added f
|
||||
====
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxncommit.abortfolding hook failed
|
||||
[255]
|
||||
|
||||
|
@ -33,7 +33,7 @@ FIXME: hg tip should not require '--hidden' to see pending commits in hooks
|
||||
$ hg commit -m a
|
||||
precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=0000000000000000000000000000000000000000
|
||||
pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
|
||||
0:cb9a9f314b8b
|
||||
pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
@ -60,7 +60,7 @@ pretxncommit and commit hooks can see both parents of merge
|
||||
$ hg commit -m a1 -d "1 0"
|
||||
precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
|
||||
pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
|
||||
1:ab228980c14d
|
||||
pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
@ -73,7 +73,7 @@ pretxncommit and commit hooks can see both parents of merge
|
||||
$ hg commit -m b -d '1 0'
|
||||
precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
|
||||
pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
|
||||
2:ee9deb46ab31
|
||||
pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
@ -85,7 +85,7 @@ pretxncommit and commit hooks can see both parents of merge
|
||||
$ hg commit -m merge -d '2 0'
|
||||
precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
|
||||
pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
|
||||
3:07f3376c1e65
|
||||
pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
@ -119,7 +119,7 @@ test generic hooks
|
||||
$ hg commit -Aqm "add fake tag for test compatibility"
|
||||
precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
|
||||
pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
|
||||
4:dbd0abf46c19
|
||||
pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
@ -140,18 +140,14 @@ more there after
|
||||
$ hg commit -m 'fail' -d '4 0'
|
||||
precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=dbd0abf46c19f379dcb1964594ee71a3ec9947da
|
||||
pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=be45546c4e597cf3f586e4f844961b0f9f7e66e8 HG_PARENT1=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=be45546c4e597cf3f586e4f844961b0f9f7e66e8 HG_PARENT1=dbd0abf46c19f379dcb1964594ee71a3ec9947da
|
||||
5:be45546c4e59
|
||||
5:be45546c4e59
|
||||
pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=be45546c4e597cf3f586e4f844961b0f9f7e66e8 HG_PARENT1=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_PENDING=$TESTTMP/a HG_SHAREDPENDING=$TESTTMP/a
|
||||
transaction abort!
|
||||
txnabort Python hook: txnid,txnname
|
||||
txnabort hook: HG_HOOKNAME=txnabort.1 HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
|
||||
rollback completed
|
||||
pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=be45546c4e597cf3f586e4f844961b0f9f7e66e8 HG_PARENT1=dbd0abf46c19f379dcb1964594ee71a3ec9947da
|
||||
abort: pretxncommit.forbid1 hook exited with status 1
|
||||
[255]
|
||||
$ hg -q tip
|
||||
4:dbd0abf46c19
|
||||
5:be45546c4e59
|
||||
|
||||
(Check that no 'changelog.i.a' file were left behind)
|
||||
|
||||
@ -190,7 +186,7 @@ precommit hook can prevent commit
|
||||
abort: precommit.forbid hook exited with status 1
|
||||
[255]
|
||||
$ hg -q tip
|
||||
4:dbd0abf46c19
|
||||
5:be45546c4e59
|
||||
|
||||
preupdate hook can prevent update
|
||||
|
||||
@ -314,7 +310,7 @@ incoming changes no longer there after
|
||||
adding file changes
|
||||
added 1 changesets with 1 changes to 1 files
|
||||
4:dbd0abf46c19
|
||||
pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 HG_HOOKTYPE=pretxnchangegroup HG_NODE=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_NODE_LAST=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_PENDING=$TESTTMP/b HG_SHAREDPENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
|
||||
pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 HG_HOOKTYPE=pretxnchangegroup HG_NODE=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_NODE_LAST=dbd0abf46c19f379dcb1964594ee71a3ec9947da HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxnchangegroup.forbid1 hook exited with status 1
|
||||
@ -789,43 +785,25 @@ repositories visible to an external hook.
|
||||
(emulate a transaction running concurrently by copied
|
||||
.hg/store/00changelog.i.a in subsequent test)
|
||||
|
||||
$ cat > $TESTTMP/savepending.sh <<EOF
|
||||
> cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved
|
||||
$ cat > $TESTTMP/print-head.sh <<EOF
|
||||
> hg log -r 'head()' -T '{desc}\n'
|
||||
> exit 1 # to avoid adding new revision for subsequent tests
|
||||
> EOF
|
||||
$ cd a
|
||||
$ hg tip -q
|
||||
4:dbd0abf46c19
|
||||
$ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible"
|
||||
$ hg log -r 'head()' -T '{desc}\n'
|
||||
add fake tag for test compatibility
|
||||
$ hg --config hooks.pretxnclose="sh $TESTTMP/print-head.sh" commit -m "invisible"
|
||||
invisible
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxnclose hook exited with status 1
|
||||
[255]
|
||||
$ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a
|
||||
|
||||
(check (in)visibility of new changeset while transaction running in
|
||||
repo)
|
||||
|
||||
$ cat > $TESTTMP/checkpending.sh <<EOF
|
||||
> echo '@a'
|
||||
> hg -R "$TESTTMP/a" tip -q
|
||||
> echo '@a/nested'
|
||||
> hg -R "$TESTTMP/a/nested" tip -q
|
||||
> exit 1 # to avoid adding new revision for subsequent tests
|
||||
> EOF
|
||||
$ hg init nested
|
||||
$ cd nested
|
||||
$ echo a > a
|
||||
$ hg add a
|
||||
$ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0'
|
||||
@a
|
||||
4:dbd0abf46c19
|
||||
@a/nested
|
||||
0:bf5e395ced2c
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxnclose hook exited with status 1
|
||||
[255]
|
||||
$ hg log -r 'head()' -T '{desc}\n'
|
||||
add fake tag for test compatibility
|
||||
|
||||
Hook from untrusted hgrc are no longer failures
|
||||
================================================
|
||||
|
@ -151,8 +151,6 @@ Test that --exact on a bad header doesn't corrupt the repo (issue3616)
|
||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
patching file a
|
||||
Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: patch is damaged or loses information
|
||||
[255]
|
||||
$ hg verify
|
||||
@ -160,4 +158,4 @@ Test that --exact on a bad header doesn't corrupt the repo (issue3616)
|
||||
checking manifests
|
||||
crosschecking files in changesets and manifests
|
||||
checking files
|
||||
1 files, 2 changesets, 2 total revisions
|
||||
1 files, 3 changesets, 3 total revisions
|
||||
|
@ -629,11 +629,9 @@ sh % "touch empty.patch"
|
||||
sh % "hg import a.patch empty.patch" == r"""
|
||||
applying a.patch
|
||||
applying empty.patch
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: empty.patch: no diffs found
|
||||
[255]"""
|
||||
sh % "hg tip --template '{rev} {desc|firstline}\\n'" == "0 commit"
|
||||
sh % "hg tip --template '{rev} {desc|firstline}\\n'" == "1 add a, b"
|
||||
sh % "hg -q status" == "M a"
|
||||
sh % "cd .."
|
||||
|
||||
|
@ -92,8 +92,6 @@ Try it with uncommitted changes, ensure it aborts nicely:
|
||||
rebasing in-memory!
|
||||
rebasing d82c41319fdd "e" (e)
|
||||
rebasing c33e7f678afd "f" (f)
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: must use on-disk merge for this rebase (hit merge conflicts in c), but you have working copy changes
|
||||
(commit, revert, or shelve them)
|
||||
[255]
|
||||
|
@ -324,8 +324,6 @@ Test rebase interrupted by hooks
|
||||
rebasing 965c486023db "C"
|
||||
summary: C
|
||||
rebasing a0b2430ebfb8 "F"
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: pretxncommit hook exited with status 1
|
||||
[255]
|
||||
$ tglogp
|
||||
|
@ -1273,18 +1273,6 @@ sh % "hg commit -Aqm commit1"
|
||||
sh % "echo 2" > "file2"
|
||||
|
||||
|
||||
def createmarkers(orig, *args, **kwargs):
|
||||
orig(*args, **kwargs)
|
||||
raise KeyboardInterrupt
|
||||
|
||||
|
||||
with extensions.wrappedfunction(obsolete, "createmarkers", createmarkers):
|
||||
sh % "hg shelve" == r"""
|
||||
transaction abort!
|
||||
rollback completed
|
||||
interrupted!
|
||||
[255]"""
|
||||
|
||||
sh % "cat file2" == "2"
|
||||
sh % "tglog" == "@ 0: 6408d34d8180 'commit1'"
|
||||
|
||||
|
@ -22,8 +22,6 @@
|
||||
[255]
|
||||
$ hg ci -Am m -u "`(echo foo; echo bar3)`"
|
||||
adding a
|
||||
transaction abort!
|
||||
rollback completed
|
||||
abort: username 'foo\nbar3' contains a newline!
|
||||
[255]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user