mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
mq: put qnew tests into own file, fold in qnew-twice
This commit is contained in:
parent
1d62e6146e
commit
636630e1d2
@ -42,17 +42,6 @@ echo % qinit -c
|
||||
hg --cwd c qinit -c
|
||||
hg -R c/.hg/patches st
|
||||
|
||||
echo % qnew should refuse bad patch names
|
||||
hg -R c qnew series
|
||||
hg -R c qnew status
|
||||
hg -R c qnew guards
|
||||
hg -R c qnew .hgignore
|
||||
|
||||
echo % qnew implies add
|
||||
|
||||
hg -R c qnew test.patch
|
||||
hg -R c/.hg/patches st
|
||||
|
||||
echo '% qinit; qinit -c'
|
||||
hg init d
|
||||
cd d
|
||||
@ -90,25 +79,7 @@ cd ..
|
||||
|
||||
cd a
|
||||
|
||||
echo a > somefile
|
||||
hg add somefile
|
||||
|
||||
echo % qnew with uncommitted changes
|
||||
|
||||
hg qnew uncommitted.patch
|
||||
hg st
|
||||
hg qseries
|
||||
|
||||
echo '% qnew missing'
|
||||
hg qnew missing.patch missing
|
||||
|
||||
hg revert --no-backup somefile
|
||||
rm somefile
|
||||
|
||||
echo % qnew -m
|
||||
|
||||
hg qnew -m 'foo bar' test.patch
|
||||
cat .hg/patches/test.patch
|
||||
|
||||
echo % qrefresh
|
||||
|
||||
|
47
tests/test-mq-qnew
Executable file
47
tests/test-mq-qnew
Executable file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "[extensions]" >> $HGRCPATH
|
||||
echo "mq=" >> $HGRCPATH
|
||||
|
||||
hg init mq
|
||||
cd mq
|
||||
|
||||
echo a > a
|
||||
hg ci -Ama
|
||||
|
||||
echo '% qnew should refuse bad patch names'
|
||||
hg qnew series
|
||||
hg qnew status
|
||||
hg qnew guards
|
||||
hg qnew .hgignore
|
||||
|
||||
hg qinit -c
|
||||
|
||||
echo '% qnew with uncommitted changes'
|
||||
echo a > somefile
|
||||
hg add somefile
|
||||
hg qnew uncommitted.patch
|
||||
hg st
|
||||
hg qseries
|
||||
hg revert --no-backup somefile
|
||||
rm somefile
|
||||
|
||||
echo '% qnew implies add'
|
||||
hg qnew test.patch
|
||||
hg -R .hg/patches st
|
||||
|
||||
echo '% qnew missing'
|
||||
hg qnew missing.patch missing
|
||||
|
||||
echo '% qnew -m'
|
||||
hg qnew -m 'foo bar' mtest.patch
|
||||
cat .hg/patches/mtest.patch
|
||||
|
||||
echo '% qnew twice'
|
||||
hg qnew first.patch
|
||||
hg qnew first.patch
|
||||
|
||||
touch ../first.patch
|
||||
hg qimport ../first.patch
|
||||
|
||||
exit 0
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "[extensions]" >> $HGRCPATH
|
||||
echo "mq=" >> $HGRCPATH
|
||||
|
||||
hg init a
|
||||
cd a
|
||||
hg qnew first.patch
|
||||
hg qnew first.patch
|
||||
|
||||
touch ../first.patch
|
||||
hg qimport ../first.patch
|
||||
|
||||
exit 0
|
@ -1,2 +0,0 @@
|
||||
abort: patch "first.patch" already exists
|
||||
abort: patch "first.patch" already exists
|
20
tests/test-mq-qnew.out
Normal file
20
tests/test-mq-qnew.out
Normal file
@ -0,0 +1,20 @@
|
||||
adding a
|
||||
% qnew should refuse bad patch names
|
||||
abort: "series" cannot be used as the name of a patch
|
||||
abort: "status" cannot be used as the name of a patch
|
||||
abort: "guards" cannot be used as the name of a patch
|
||||
abort: ".hgignore" cannot be used as the name of a patch
|
||||
% qnew with uncommitted changes
|
||||
abort: local changes found, refresh first
|
||||
A somefile
|
||||
% qnew implies add
|
||||
A .hgignore
|
||||
A series
|
||||
A test.patch
|
||||
% qnew missing
|
||||
abort: missing: No such file or directory
|
||||
% qnew -m
|
||||
foo bar
|
||||
% qnew twice
|
||||
abort: patch "first.patch" already exists
|
||||
abort: patch "first.patch" already exists
|
@ -65,15 +65,6 @@ adding b/z
|
||||
% qinit -c
|
||||
A .hgignore
|
||||
A series
|
||||
% qnew should refuse bad patch names
|
||||
abort: "series" cannot be used as the name of a patch
|
||||
abort: "status" cannot be used as the name of a patch
|
||||
abort: "guards" cannot be used as the name of a patch
|
||||
abort: ".hgignore" cannot be used as the name of a patch
|
||||
% qnew implies add
|
||||
A .hgignore
|
||||
A series
|
||||
A test.patch
|
||||
% qinit; qinit -c
|
||||
.hgignore:
|
||||
^\.hg
|
||||
@ -96,13 +87,6 @@ bleh
|
||||
series:
|
||||
A
|
||||
B
|
||||
% qnew with uncommitted changes
|
||||
abort: local changes found, refresh first
|
||||
A somefile
|
||||
% qnew missing
|
||||
abort: missing: No such file or directory
|
||||
% qnew -m
|
||||
foo bar
|
||||
% qrefresh
|
||||
foo bar
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user