##// END OF EJS Templates
discovery: properly filter changeset in 'peer.known' (issue4982)...
discovery: properly filter changeset in 'peer.known' (issue4982) The 'peer.known' call (handled at the repository level) was applying its own manual filtering (looking at phases) instead of relying on the repoview mechanism. This led to the discovery finding more "common" node that 'getbundle' was willing to recognised. From there, bad things happen, issue4982 is a symptom of it. While situations like described in issue4982 can still happen because of race conditions, fixing 'peer.known' is important for consistency in all cases. We update the code to use 'repoview' filtering. This lead to small changes in the tests for exchanging obsolescence marker because the discovery yields different results. The test affected in 'test-obsolete-changeset-exchange.t' is a test for issue4982 getting back to its expected state.

File last commit:

r27156:55fa7c39 default
r27319:b64b6fdc default
Show More
test-commit-interactive-curses.t
191 lines | 3.4 KiB | text/troff | Tads3Lexer
/ tests / test-commit-interactive-curses.t
Laurent Charignon
record: add tests for the curses recording interface
r24344 Set up a repo
$ cat <<EOF >> $HGRCPATH
> [ui]
> interactive = true
> [experimental]
> crecord = true
> crecordtest = testModeCommands
> EOF
$ hg init a
$ cd a
Committing some changes but stopping on the way
$ echo "a" > a
$ hg add a
$ cat <<EOF >testModeCommands
> TOGGLE
> X
> EOF
$ hg commit -i -m "a" -d "0 0"
no changes to record
$ hg tip
changeset: -1:000000000000
tag: tip
user:
date: Thu Jan 01 00:00:00 1970 +0000
Committing some changes
$ cat <<EOF >testModeCommands
> X
> EOF
$ hg commit -i -m "a" -d "0 0"
$ hg tip
changeset: 0:cb9a9f314b8b
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
Committing only one file
$ echo "a" >> a
Matt Harbison
test-interactive: use stable EOL in various file generating routines...
r24434 >>> open('b', 'wb').write("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
Laurent Charignon
record: add tests for the curses recording interface
r24344 $ hg add b
$ cat <<EOF >testModeCommands
> TOGGLE
> KEY_DOWN
> X
> EOF
$ hg commit -i -m "one file" -d "0 0"
$ hg tip
changeset: 1:fb2705a663ea
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: one file
$ hg cat -r tip a
a
$ cat a
a
a
Laurent Charignon
crecord: exit edition of hunk with non-zero status does not interrupt session...
r25557 Committing only one hunk while aborting edition of hunk
Laurent Charignon
record: add tests for the curses recording interface
r24344
- Untoggle all the hunks, go down to the second file
- unfold it
- go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
- toggle the second hunk
Laurent Charignon
commit: add amend mode for commit -i...
r27156 - toggle on and off the amend mode (to check that it toggles off)
Mads Kiilerich
spelling: trivial spell checking
r26781 - edit the hunk and quit the editor immediately with non-zero status
Laurent Charignon
record: add tests for the curses recording interface
r24344 - commit
Laurent Charignon
crecord: exit edition of hunk with non-zero status does not interrupt session...
r25557 $ printf "printf 'editor ran\n'; exit 1" > editor.sh
Laurent Charignon
record: add tests for the curses recording interface
r24344 $ echo "x" > c
$ cat b >> c
$ echo "y" >> c
$ mv c b
$ cat <<EOF >testModeCommands
> A
> KEY_DOWN
> f
> KEY_DOWN
> KEY_DOWN
> KEY_DOWN
> KEY_DOWN
> TOGGLE
Laurent Charignon
commit: add amend mode for commit -i...
r27156 > a
> a
Laurent Charignon
crecord: exit edition of hunk with non-zero status does not interrupt session...
r25557 > e
Laurent Charignon
record: add tests for the curses recording interface
r24344 > X
> EOF
Laurent Charignon
crecord: exit edition of hunk with non-zero status does not interrupt session...
r25557 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -m "one hunk" -d "0 0"
editor ran
$ rm editor.sh
Laurent Charignon
record: add tests for the curses recording interface
r24344 $ hg tip
changeset: 2:7d10dfe755a8
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: one hunk
$ hg cat -r tip b
1
2
3
4
5
6
7
8
9
10
y
$ cat b
x
1
2
3
4
5
6
7
8
9
10
y
$ hg commit -m "other hunks"
$ hg tip
changeset: 3:a6735021574d
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: other hunks
$ hg cat -r tip b
x
1
2
3
4
5
6
7
8
9
10
y
Laurent Charignon
record_curses: add test for newly added files...
r24469 Newly added files can be selected with the curses interface
Laurent Charignon
record: add tests for the curses recording interface
r24344
Laurent Charignon
record_curses: add test for newly added files...
r24469 $ hg update -C .
Laurent Charignon
record: fix record with change on moved file crashes (issue4619)...
r24837 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
Laurent Charignon
record_curses: add test for newly added files...
r24469 $ echo "hello" > x
$ hg add x
$ cat <<EOF >testModeCommands
> TOGGLE
> TOGGLE
> X
> EOF
$ hg st
A x
? testModeCommands
$ hg commit -i -m "newly added file" -d "0 0"
$ hg st
? testModeCommands
Laurent Charignon
commit: add amend mode for commit -i...
r27156 Amend option works
$ echo "hello world" > x
$ hg diff -c .
diff -r a6735021574d -r 2b0e9be4d336 x
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,1 @@
+hello
$ cat <<EOF >testModeCommands
> a
> X
> EOF
$ hg commit -i -m "newly added file" -d "0 0"
saved backup bundle to $TESTTMP/a/.hg/strip-backup/2b0e9be4d336-28bbe4e2-amend-backup.hg (glob)
$ hg diff -c .
diff -r a6735021574d -r c1d239d165ae x
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x Thu Jan 01 00:00:00 1970 +0000
@@ -0,0 +1,1 @@
+hello world