Skip to content
Snippets Groups Projects
Commit 06793ad3 authored by Nicolas Dumazet's avatar Nicolas Dumazet
Browse files

tests: unify test-add

parent 80c63b2a
No related branches found
No related tags found
No related merge requests found
adding a
? a
adding a
A a
adding a
A a
A a
? b
A a
A b
% should fail
b already tracked!
A a
A b
% should fail
a already tracked!
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
created new head
merging a
warning: conflicts during merge.
merging a failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
M a
? a.orig
% should fail
a already tracked!
M a
? a.orig
% issue683
? a.orig
R a
? a.orig
M a
? a.orig
c: No such file or directory
d: No such file or directory
M a
A c
? a.orig
#!/bin/sh
hg init a
cd a
echo a > a
hg add -n
hg st
hg add
hg st
hg forget a
hg add
hg st
$ hg init a
$ cd a
$ echo a > a
$ hg add -n
adding a
$ hg st
? a
$ hg add
adding a
$ hg st
A a
$ hg forget a
$ hg add
adding a
$ hg st
A a
......@@ -13,10 +17,13 @@
echo b > b
hg add -n b
hg st
hg add b || echo "failed to add b"
hg st
echo % should fail
hg add b
hg st
$ echo b > b
$ hg add -n b
$ hg st
A a
? b
$ hg add b || echo "failed to add b"
$ hg st
A a
A b
should fail
......@@ -22,5 +29,14 @@
hg ci -m 0 --traceback
echo % should fail
hg add a
$ hg add b
b already tracked!
$ hg st
A a
A b
$ hg ci -m 0 --traceback
should fail
$ hg add a
a already tracked!
......@@ -26,7 +42,9 @@
echo aa > a
hg ci -m 1
hg up 0
echo aaa > a
hg ci -m 2
$ echo aa > a
$ hg ci -m 1
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo aaa > a
$ hg ci -m 2
created new head
......@@ -32,9 +50,13 @@
hg merge
hg st
echo % should fail
hg add a
hg st
hg resolve -m a
hg ci -m merge
$ hg merge
merging a
warning: conflicts during merge.
merging a failed!
0 files updated, 0 files merged, 0 files removed, 1 files unresolved
use 'hg resolve' to retry unresolved file merges or 'hg update -C' to abandon
$ hg st
M a
? a.orig
should fail
......@@ -40,11 +62,11 @@
echo % issue683
hg forget a
hg add a
hg st
hg rm a
hg st
echo a > a
hg add a
hg st
$ hg add a
a already tracked!
$ hg st
M a
? a.orig
$ hg resolve -m a
$ hg ci -m merge
issue683
......@@ -50,6 +72,15 @@
hg add c && echo "unexpected addition of missing file"
echo c > c
hg add d c && echo "unexpected addition of missing file"
hg st
$ hg forget a
$ hg add a
$ hg st
? a.orig
$ hg rm a
$ hg st
R a
? a.orig
$ echo a > a
$ hg add a
$ hg st
M a
? a.orig
......@@ -55,1 +86,11 @@
$ hg add c && echo "unexpected addition of missing file"
c: No such file or directory
$ echo c > c
$ hg add d c && echo "unexpected addition of missing file"
d: No such file or directory
$ hg st
M a
A c
? a.orig
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment