tests: remove usage of hg rollback

Summary:
`hg rollback` was long disabled in production setup. It has weird behavior and
is likely incompatible with modern transaction frameworks. Remove its usage in
tests.

Reviewed By: DurhamG

Differential Revision: D22240180

fbshipit-source-id: 453684ebbc77132e09b1b717b6ad1e106dcad214
This commit is contained in:
Jun Wu 2020-07-06 14:00:16 -07:00 committed by Facebook GitHub Bot
parent dabce28285
commit 24363ad52f
21 changed files with 63 additions and 378 deletions

View File

@ -126,34 +126,6 @@ backout of backout is as if nothing happened
commit: (clean)
phases: 4 draft
Test that 'hg rollback' restores dirstate just before opening
transaction: in-memory dirstate changes should be written into
'.hg/journal.dirstate' as expected.
$ echo 'removed soon' > b
$ hg commit -A -d '4 0' -m 'prepare for subsequent removing'
adding b
$ echo 'newly added' > c
$ hg add c
$ hg remove b
$ hg commit -d '5 0' -m 'prepare for subsequent backout'
$ touch -t 200001010000 c
$ hg status -A
C c
$ hg debugstate --nodates
n 644 12 set c
$ hg backout -d '6 0' -m 'to be rollback-ed soon' -r .
adding b
removing c
changeset 6:3ab761ce0df4 backs out changeset 5:19a306f2a2e0
$ hg rollback -q
$ hg status -A
A b
R c
$ hg debugstate --nodates
a 0 -1 unset b
r 0 0 unset c
across branch
$ cd ..
@ -425,26 +397,6 @@ backout of non-merge with parent should fail
backout with valid parent should be ok
$ hg backout -d '5 0' --parent 2 4 --tool=true
removing d
changeset 5:84e16af81ce4 backs out changeset 4:b2f3bb92043e
$ hg summary
parent: 5:84e16af81ce4
Back out "d"
commit: (clean)
phases: 6 draft
$ hg rollback
repository tip rolled back to revision 4 (undo commit)
working directory now based on revision 4
$ hg update -C
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg summary
parent: 4:b2f3bb92043e
d
commit: (clean)
phases: 5 draft
$ hg backout -d '6 0' --parent 3 4 --tool=true
removing c
changeset 5:042ecc423244 backs out changeset 4:b2f3bb92043e

View File

@ -104,9 +104,6 @@ clone, commit, pull
we must not cause a failure if we cannot write to the log
$ hg rollback
repository tip rolled back to revision 1 (undo pull)
$ rm -rf .hg/blackbox*
$ mkdir -p .hg/blackbox
$ touch .hg/blackbox/v1
@ -114,27 +111,12 @@ we must not cause a failure if we cannot write to the log
comparing with $TESTTMP/blackboxtest
query 1; heads
searching for changes
all local heads known remotely
changeset: 2:d02f48003e62c24e2659d97d30f2a83abe5d5d51
phase: draft
parent: 1:6563da9dcf87b1949716e38ff3e3dfaa3198eb06
parent: -1:0000000000000000000000000000000000000000
manifest: ab9d46b053ebf45b7996f2922b9893ff4b63d892
user: test
date: Thu Jan 01 00:00:00 1970 +0000
files+: c
extra: branch=default
description:
c
all remote heads known locally
no changes found
$ hg pull
pulling from $TESTTMP/blackboxtest
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
no changes found
$ rm .hg/blackbox/v1

View File

@ -4,12 +4,6 @@
$ echo qqq>qqq.txt
rollback dry run without rollback information
$ hg rollback
no rollback information available
[1]
add file
$ hg add

View File

@ -498,32 +498,11 @@ test id
$ hg id
db815d6d32e6 Y/Z/x y
test rollback
$ echo foo > f1
$ hg bookmark tmp-rollback
$ hg ci -Amr
adding f1
$ hg bookmarks
X2 1:925d80f479bb
Y 2:db815d6d32e6
Z 2:db815d6d32e6
* tmp-rollback 3:2bf5cfec5864
x y 2:db815d6d32e6
$ hg rollback
repository tip rolled back to revision 2 (undo commit)
working directory now based on revision 2
$ hg bookmarks
unknown reference in .hg/bookmarks: tmp-rollback 2bf5cfec5864a07e71c9d3a2a96f5c9766595ba1
X2 1:925d80f479bb
Y 2:db815d6d32e6
Z 2:db815d6d32e6
x y 2:db815d6d32e6
activate bookmark on working dir parent without --force
$ hg bookmark --inactive Z
unknown reference in .hg/bookmarks: tmp-rollback 2bf5cfec5864a07e71c9d3a2a96f5c9766595ba1
$ hg bookmark Z
test clone
@ -641,7 +620,7 @@ working directory of current repository)
parent: 2:db815d6d32e6
2
bookmarks: *Z Y x y
commit: 1 added, * unknown (glob) (fsmonitor !)
commit: * unknown* (glob)
phases: 5 draft
$ hg update
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

View File

@ -144,8 +144,6 @@
crosschecking files in changesets and manifests
checking files
4 files, 9 changesets, 7 total revisions
$ hg rollback
repository tip rolled back to revision 4 (undo pull)
$ cd ..
should fail
@ -226,65 +224,53 @@ revision 8
crosschecking files in changesets and manifests
checking files
4 files, 9 changesets, 7 total revisions
$ hg rollback
repository tip rolled back to revision 2 (undo unbundle)
revision 2
$ hg tip -q
2:4ce51a113780
$ hg unbundle ../test-bundle-branch1.hg
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
added 0 changesets with 0 changes to 2 files
revision 4
$ hg tip -q
4:916f1afdef90
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
2 files, 5 changesets, 5 total revisions
$ hg rollback
repository tip rolled back to revision 2 (undo unbundle)
4 files, 9 changesets, 7 total revisions
$ hg unbundle ../test-bundle-branch2.hg
adding changesets
adding manifests
adding file changes
added 4 changesets with 3 changes to 3 files
added 0 changesets with 0 changes to 3 files
revision 6
$ hg tip -q
6:faa2e4234c7a
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
3 files, 7 changesets, 6 total revisions
$ hg rollback
repository tip rolled back to revision 2 (undo unbundle)
4 files, 9 changesets, 7 total revisions
$ hg unbundle ../test-bundle-cset-7.hg
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
added 0 changesets with 0 changes to 2 files
revision 4
$ hg tip -q
4:916f1afdef90
8:916f1afdef90
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
2 files, 5 changesets, 5 total revisions
4 files, 9 changesets, 7 total revisions
$ cd ../test
$ hg merge 7

View File

@ -604,7 +604,6 @@ specific template keywords work well
M
A changed removed
R
$ hg rollback -q
$ cat >> .hg/hgrc <<EOF
> # disable customizing for subsequent tests
@ -646,6 +645,8 @@ Test making empty commits
verify pathauditor blocks evil filepaths
$ cp -R . $TESTTMP/audit2
$ cp -R . $TESTTMP/audit3
$ cat > evil-commit.py <<EOF
> from __future__ import absolute_import
> from edenscm.mercurial import context, hg, node, pycompat, ui as uimod
@ -670,8 +671,7 @@ verify pathauditor blocks evil filepaths
[255]
#endif
$ hg rollback -f
repository tip rolled back to revision 2 (undo commit)
$ cd $TESTTMP/audit2
$ cat > evil-commit.py <<EOF
> from __future__ import absolute_import
> from edenscm.mercurial import context, hg, node, ui as uimod
@ -690,8 +690,7 @@ verify pathauditor blocks evil filepaths
abort: path contains illegal component: HG~1/hgrc
[255]
$ hg rollback -f
repository tip rolled back to revision 2 (undo commit)
$ cd $TESTTMP/audit3
$ cat > evil-commit.py <<EOF
> from __future__ import absolute_import
> from edenscm.mercurial import context, hg, node, ui as uimod

View File

@ -71,10 +71,6 @@
> EOF
$ echo 12345 > asdf
$ hg commit --config ui.interactive=False -m ask
enter a commit username:
no username found, using '[^']*' instead (re)
$ hg rollback -q
$ hg commit --config ui.interactive=True -m ask <<EOF
> Asked User <ask@example.com>

View File

@ -494,26 +494,6 @@ An additional round, demonstrating that unchanged files don't get converted
o 0 0 (a-only f)
Conversion after rollback
$ hg -R a rollback -f
repository tip rolled back to revision 2 (undo convert)
$ hg convert --filemap filemap-b 0 a --config convert.hg.revs=1::
scanning source...
sorting...
converting...
0 extra f+a-only change
$ hg -R a log -G -T '{rev} {desc|firstline} ({files})\n'
o 3 extra f+a-only change (f)
|
o 2 x (f)
|
@ 1 a (f)
|
o 0 0 (a-only f)
Convert with --full adds and removes files that didn't change
$ echo f >> 0/f

View File

@ -121,41 +121,6 @@ diffstat
> git = True
> EOF
#if execbit
record
$ chmod +x a
$ hg record -m moda a <<EOF
> y
> y
> EOF
\x1b[0;1mdiff --git a/a b/a\x1b[0m (esc)
\x1b[0;36;1mold mode 100644\x1b[0m (esc)
\x1b[0;36;1mnew mode 100755\x1b[0m (esc)
1 hunks, 1 lines changed
\x1b[0;33mexamine changes to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
\x1b[0;35m@@ -2,7 +2,7 @@ c\x1b[0m (esc)
c
a
a
\x1b[0;91m-b\x1b[0m (esc)
\x1b[0;92m+dd\x1b[0m (esc)
a
a
c
\x1b[0;33mrecord this change to 'a'? [Ynesfdaq?]\x1b[0m y (esc)
$ echo "[extensions]" >> $HGRCPATH
$ echo "mq=" >> $HGRCPATH
$ hg rollback
repository tip rolled back to revision 0 (undo commit)
working directory now based on revision 0
#endif
test inline color diff
$ hg init inline

View File

@ -152,19 +152,18 @@ Test checkheadshook alias
We can fix the head and push again
$ cp -R $TESTTMP/main $TESTTMP/main2
$ hg up 6
1 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ printf "first\nsecond" > b.txt
$ hg ci -m "remove CRLF from b.txt"
$ hg push -f ../main
pushing to ../main
$ hg push -f ../main2
pushing to ../main2
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 2 files
$ hg -R ../main rollback
repository tip rolled back to revision 5 (undo push)
Test it still fails with checkallhook
@ -178,7 +177,7 @@ Test it still fails with checkallhook
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 5 files
added 3 changesets with 3 changes to 2 files
error: pretxnchangegroup hook failed: end-of-line check failed:
b.txt in fbcf9b1025f5 should not have CRLF line endings
transaction abort!
@ -195,7 +194,7 @@ But we can push the clean head
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 4 files
added 1 changesets with 1 changes to 1 files
Test multiple files/revisions output

View File

@ -361,11 +361,6 @@ then, check "modify the message" itself
summary: f
rollback should not work after a histedit
$ hg rollback
no rollback information available
[1]
$ cd ..
$ hg clone -qr0 r r0
$ cd r0

View File

@ -340,8 +340,7 @@ outgoing hooks can see env vars
adding file changes
added 1 changesets with 1 changes to 1 files
adding remote bookmark quux
$ hg rollback
repository tip rolled back to revision 3 (undo pull)
$ hg debugstrip -q tip
preoutgoing hook can prevent outgoing changes

View File

@ -4,6 +4,7 @@
$ shortlog() {
> hg log -G --template '{rev}:{node|short} {author} {date|hgdate} - {desc|firstline}\n'
> }
$ enable amend
Test --bypass with other options
@ -50,7 +51,7 @@ Test failure without --exact
Test --user, --date and --message
$ hg up 0
$ hg up 'desc(adda)'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg import --bypass --u test2 -d '1 0' -m patch2 ../test.diff
applying ../test.diff
@ -63,8 +64,7 @@ Test --user, --date and --message
|/
@ 0:07f494440405 test 0 0 - adda
$ hg rollback
repository tip rolled back to revision 1 (undo import)
$ hg hide -q tip
Test --strip
@ -85,8 +85,6 @@ Test --strip
> +a
> EOF
applying patch from stdin
$ hg rollback
repository tip rolled back to revision 1 (undo import)
Test --strip with --bypass
@ -99,7 +97,7 @@ Test --strip with --bypass
adding dir/dir2/b
adding dir/dir2/c
$ shortlog
@ 2:d805bc8236b6 test 0 0 - addabcd
@ 3:d805bc8236b6 test 0 0 - addabcd
|
| o 1:540395c44225 test 0 0 - changea
|/
@ -136,15 +134,15 @@ Test --strip with --bypass
applying patch from stdin
$ shortlog
o 3:5bd46886ca3e test 0 0 - changeabcd
o 4:5bd46886ca3e test 0 0 - changeabcd
|
@ 2:d805bc8236b6 test 0 0 - addabcd
@ 3:d805bc8236b6 test 0 0 - addabcd
|
| o 1:540395c44225 test 0 0 - changea
|/
o 0:07f494440405 test 0 0 - adda
$ hg diff --change 3 --git
$ hg diff --change 'desc(changeabcd)' --git
diff --git a/dir/a b/dir/a
new file mode 100644
--- /dev/null
@ -221,9 +219,9 @@ commit message is explicitly specified, regardless of '--edit')
$ hg --config patch.eol=auto import -d '0 0' -m 'test patch.eol' --bypass ../test.diff
applying ../test.diff
$ shortlog
o 3:c606edafba99 test 0 0 - test patch.eol
o 4:c606edafba99 test 0 0 - test patch.eol
|
@ 2:872023de769d test 0 0 - makeacrlf
@ 3:872023de769d test 0 0 - makeacrlf
|
| o 1:540395c44225 test 0 0 - changea
|/
@ -232,12 +230,12 @@ commit message is explicitly specified, regardless of '--edit')
Test applying multiple patches
$ hg up -qC 0
$ hg up -qC 'desc(adda)'
$ echo e > e
$ hg ci -Am adde
adding e
$ hg export . > ../patch1.diff
$ hg up -qC 1
$ hg up -qC 'desc(changea)'
$ echo f > f
$ hg ci -Am addf
adding f
@ -251,7 +249,7 @@ Test applying multiple patches
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd repo-multi1
$ hg up 0
$ hg up 'desc(adda)'
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg import --bypass ../patch1.diff ../patch2.diff
applying ../patch1.diff

View File

@ -46,7 +46,6 @@ chmod +x:
$ hg tip -q
2:3a34410f282e
$ test -x new
$ hg rollback -q
#else
$ hg tip -q
1:ab199dc869b5
@ -73,14 +72,13 @@ Copy and removing x bit:
$ test ! -x copy
$ test -x copyx
$ hg tip -q
2:21dfaae65c71
3:37bacb7ca14d
#else
$ hg tip -q
2:0efdaa8e3bf3
#endif
$ hg up -qCr1
$ hg rollback -q
Copy (like above but independent of execbit):
@ -97,7 +95,7 @@ Copy (like above but independent of execbit):
applying patch from stdin
$ hg tip -q
2:0efdaa8e3bf3
4:0efdaa8e3bf3
$ test -f copy
$ cat copy
@ -117,7 +115,7 @@ Rename:
applying patch from stdin
$ hg tip -q
3:b1f57753fad2
5:b1f57753fad2
$ hg locate
copyx
@ -139,7 +137,7 @@ Delete:
applying patch from stdin
$ hg tip -q
4:1bd1da94b9b2
6:1bd1da94b9b2
$ hg locate
empty
@ -166,7 +164,7 @@ Regular diff:
applying patch from stdin
$ hg tip -q
5:46fe99cb3035
7:46fe99cb3035
Copy and modify:
@ -189,7 +187,7 @@ Copy and modify:
applying patch from stdin
$ hg tip -q
6:ffeb3197c12d
8:ffeb3197c12d
$ hg cat copy2
a
@ -219,7 +217,7 @@ Rename and modify:
applying patch from stdin
$ hg tip -q
7:401aede9e6bb
9:401aede9e6bb
$ hg locate copy2
[1]
@ -243,10 +241,10 @@ One file renamed multiple times:
applying patch from stdin
$ hg tip -q
8:2ef727e684e8
10:2ef727e684e8
$ hg log -vr. --template '{rev} {files} / {file_copies}\n'
8 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
10 rename2 rename3 rename3-2 / rename3 (rename2)rename3-2 (rename2)
$ hg locate rename2 rename3 rename3-2
rename3
@ -287,7 +285,7 @@ Binary files and regular patch hunks:
applying patch from stdin
$ hg tip -q
10:27377172366e
12:27377172366e
$ cat foo2
foo
@ -316,7 +314,7 @@ Multiple binary files:
applying patch from stdin
$ hg tip -q
11:18b73a84b4ab
13:18b73a84b4ab
$ hg manifest --debug | grep mbinary
045c85ba38952325e126c70962cc0f9d9077bc67 644 mbinary1
@ -448,7 +446,7 @@ Filenames with spaces:
applying patch from stdin
$ hg tip -q
14:4b79479c9a6d
16:4b79479c9a6d
$ cat "foo bar"
foo
@ -471,7 +469,7 @@ Copy then modify the original file:
applying patch from stdin
$ hg tip -q
15:9cbe44af4ae9
17:9cbe44af4ae9
$ cat foo3
foo
@ -505,9 +503,6 @@ Move text file and patch as binary
Invalid base85 content
$ hg rollback
repository tip rolled back to revision 16 (undo import)
working directory now based on revision 16
$ hg revert -aq
$ hg import -d "1000000 0" -m invalid-binary - <<"EOF"
> diff --git a/text2 b/binary2
@ -569,7 +564,8 @@ Simulate a copy/paste turning LF into CRLF (issue2870)
>>> data = fp.read()
>>> fp.close()
>>> _ = open('binary.diff', 'wb').write(data.replace(b'\n', b'\r\n'))
$ rm binary2
$ hg mv binary2 text2
$ hg commit -m foo
$ hg import --no-commit binary.diff
applying binary.diff

View File

@ -11,6 +11,7 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
sh % "enable amend"
sh % "hg init a"
sh % "mkdir a/d1"
@ -298,31 +299,9 @@ sh % "hg --cwd b12 import -v ../patch1 ../patch2" == r"""
committing manifest
committing changelog
created 6d019af21222"""
sh % "hg --cwd b12 rollback" == r"""
repository tip rolled back to revision 0 (undo import)
working directory now based on revision 0"""
sh % "hg --cwd b12 parents --template 'parent: {rev}\\n'" == "parent: 0"
# Test that "hg rollback" doesn't restore dirstate to one at the
# beginning of the rolled back transaction in not-"parent-gone" case.
# invoking pretxncommit hook will cause marking '.hg/dirstate' as a file
# to be restored when rolling back, after DirstateTransactionPlan (see wiki
# page for detail).
sh % "hg --cwd b12 commit -m foobar"
sh % "hg --cwd b12 update 0 -q"
sh % "hg --cwd b12 import ../patch1 ../patch2 --config 'hooks.pretxncommit=true'" == r"""
applying ../patch1
applying ../patch2"""
sh % "hg --cwd b12 update -q 1"
sh % "hg --cwd b12 rollback -q"
sh % "hg --cwd b12 hide -q tip" == ""
sh % "hg --cwd b12 parents --template 'parent: {rev}\\n'" == "parent: 1"
sh % "hg --cwd b12 update -q -C 0"
sh % "hg --cwd b12 debugstrip -q 1"
# importing a patch in a subdirectory failed at the commit stage
sh % "echo line 2" >> "a/d1/d2/a"

View File

@ -68,13 +68,13 @@ Pull a missing revision:
Pull multiple revisions with update:
$ cp -R . $TESTTMP/copy1
$ cd $TESTTMP/copy1
$ hg pull -qu -r 0 -r 1 ../repo
$ hg -q parents
0:bbd179dfa0a7
$ hg rollback
repository tip rolled back to revision -1 (undo pull)
working directory now based on revision -1
$ cd $TESTTMP/copy
$ hg pull -qr 0 ../repo
$ hg log
changeset: 0:bbd179dfa0a7

View File

@ -105,6 +105,9 @@ sh % "cd ../tt"
sh % "hg bookmark -f active-before-pull"
sh % "hg bookmarks" == " * active-before-pull 3:483b76ad4309"
sh % "cp -R . $TESTTMP/tt-1"
sh % "cd $TESTTMP/tt-1"
sh % "hg pull -u -r active-after-pull" == r"""
pulling from $TESTTMP/t
searching for changes
@ -123,14 +126,16 @@ sh % "hg bookmarks" == r"""
# (discard pulled changes)
sh % "hg update -q 483b76ad4309"
sh % "hg rollback -q" == "unknown reference in .hg/bookmarks: active-after-pull f815b3da61635081d9570544593e2ad30a0d9655"
sh % "cd $TESTTMP/tt"
# (2) activating by URL#BOOKMARK
sh % "hg bookmark -f active-before-pull" == "unknown reference in .hg/bookmarks: active-after-pull f815b3da61635081d9570544593e2ad30a0d9655"
sh % "hg bookmark -f active-before-pull" == ""
sh % "hg bookmarks" == " * active-before-pull 3:483b76ad4309"
sh % "cp -R . $TESTTMP/tt-2"
sh % "cd $TESTTMP/tt-2"
sh % "hg pull -u '$TESTTMP/t#active-after-pull'" == r"""
pulling from $TESTTMP/t
searching for changes
@ -149,8 +154,8 @@ sh % "hg bookmarks" == r"""
# (discard pulled changes)
sh % "cd $TESTTMP/tt"
sh % "hg update -q 483b76ad4309"
sh % "hg rollback -q" == "unknown reference in .hg/bookmarks: active-after-pull f815b3da61635081d9570544593e2ad30a0d9655"
# Test that updating deactivates current active bookmark, if the
# destination of the update is explicitly specified, and it doesn't
@ -163,7 +168,7 @@ sh % "cd ../tt"
# (1) deactivating by --rev REV
sh % "hg bookmark -f active-before-pull" == "unknown reference in .hg/bookmarks: active-after-pull f815b3da61635081d9570544593e2ad30a0d9655"
sh % "hg bookmark -f active-before-pull" == ""
sh % "hg bookmarks" == " * active-before-pull 3:483b76ad4309"
sh % "hg pull -u -r f815b3da6163" == r"""
@ -182,6 +187,5 @@ sh % "hg bookmarks" == " active-before-pull 3:483b76ad4309"
# (discard pulled changes)
sh % "hg update -q 483b76ad4309"
sh % "hg rollback -q"
sh % "cd .."

View File

@ -51,9 +51,6 @@
searching for changes
no changes found
$ hg rollback --dry-run --verbose
repository tip rolled back to revision 0 (undo pull)
Test pull of non-existing 20 character revision specification, making sure plain ascii identifiers
not are encoded like a node:

View File

@ -151,102 +151,6 @@ Testing of the '--rev' flag
$ cd ..
Test server side validation during push
=======================================
$ hg init test-validation
$ cd test-validation
$ cat > .hg/hgrc <<EOF
> [server]
> validate=1
> EOF
$ echo alpha > alpha
$ echo beta > beta
$ hg addr
adding alpha
adding beta
$ hg ci -m 1
$ cd ..
$ hg clone test-validation test-validation-clone
updating to branch default
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Test spurious filelog entries:
$ cd test-validation-clone
$ echo blah >> beta
$ cp .hg/store/data/beta.i tmp1
$ hg ci -m 2
$ cp .hg/store/data/beta.i tmp2
$ hg -q rollback
$ mv tmp2 .hg/store/data/beta.i
$ echo blah >> beta
$ hg ci -m '2 (corrupt)'
Expected to fail:
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
beta@1: dddc47b3ba30 not in manifests
2 files, 2 changesets, 4 total revisions
1 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
$ hg push
pushing to $TESTTMP/test-validation
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: received spurious file revlog entry
[255]
$ hg -q rollback
$ mv tmp1 .hg/store/data/beta.i
$ echo beta > beta
Test missing filelog entries:
$ cp .hg/store/data/beta.i tmp
$ echo blah >> beta
$ hg ci -m '2 (corrupt)'
$ mv tmp .hg/store/data/beta.i
Expected to fail:
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
beta@1: manifest refers to unknown revision dddc47b3ba30
2 files, 2 changesets, 2 total revisions
1 integrity errors encountered!
(first damaged changeset appears to be 1)
[1]
$ hg push
pushing to $TESTTMP/test-validation
searching for changes
adding changesets
adding manifests
adding file changes
transaction abort!
rollback completed
abort: missing file data for beta:dddc47b3ba30e54484720ce0f4f768a0f4b6efb9 - run hg verify
[255]
$ cd ..
Test push hook locking
=====================

View File

@ -140,12 +140,6 @@ Rebase with no arguments (from 3 onto 8):
|
o 0: cd010b8cd998 'A'
Try to rollback after a rebase (fail):
$ hg rollback
no rollback information available
[1]
$ cd ..
Rebase with base == '.' => same as no arguments (from 3 onto 8):

View File

@ -127,16 +127,10 @@ Changing original repo:
$ cd ..
$ cd clone
$ hg rollback
repository tip rolled back to revision 1 (undo push)
unknown reference in .hg/bookmarks: foo 7d4251d04d20dbc31ba80930dc39d0db4550506b
$ hg -q incoming
unknown reference in .hg/bookmarks: foo 7d4251d04d20dbc31ba80930dc39d0db4550506b
2:7d4251d04d20
$ hg -q pull
unknown reference in .hg/bookmarks: foo 7d4251d04d20dbc31ba80930dc39d0db4550506b
$ hg heads
changeset: 2:7d4251d04d20
@ -222,18 +216,11 @@ Test handling of invalid urls
Test handling common incoming revisions between "default" and
"default-push"
$ hg -R clone rollback
repository tip rolled back to revision 1 (undo pull)
working directory now based on revision 0
unknown reference in .hg/bookmarks: foo 7d4251d04d20dbc31ba80930dc39d0db4550506b
$ cd repo
$ hg update -q -C default
$ echo modified >> bar
$ hg commit -m "new head to push current default head"
$ hg -q push -r ".^1" '../clone'
unknown reference in .hg/bookmarks: foo 7d4251d04d20dbc31ba80930dc39d0db4550506b
$ hg -q outgoing '../clone'
4:44b4e0c07491