changeset 11898:7dc8b9e25f19

tests: unify test-mq-safety
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Sun, 15 Aug 2010 22:44:15 +0900
parents 0e4bbe18ff95
children 99cafcae25d9
files tests/test-mq-caches.t tests/test-mq-eol.t tests/test-mq-guards.t tests/test-mq-safety tests/test-mq-safety.out tests/test-mq-safety.t tests/test-mq.t
diffstat 3 files changed, 106 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-mq-safety	Sun Aug 15 22:07:23 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-echo '[extensions]' >> $HGRCPATH
-echo 'mq =' >> $HGRCPATH
-
-hg init repo
-cd repo
-
-echo foo > foo
-hg ci -qAm 'add a file'
-
-hg qinit
-
-hg qnew foo
-echo foo >> foo
-hg qrefresh -m 'append foo'
-
-hg qnew bar
-echo bar >> foo
-hg qrefresh -m 'append bar'
-
-echo '% try to commit on top of a patch'
-echo quux >> foo
-hg ci -m 'append quux'
-
-# cheat a bit...
-mv .hg/patches .hg/patches2
-hg ci -m 'append quux'
-mv .hg/patches2 .hg/patches
-
-echo '% qpop/qrefresh on the wrong revision'
-hg qpop
-hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
-hg qrefresh
-
-hg up -C qtip
-echo '% qpop'
-hg qpop
-
-echo '% qrefresh'
-hg qrefresh
-
-echo '% tip:'
-hg tip --template '{rev} {desc}\n'
-
-echo '% qpush warning branchheads'
-cd ..
-hg init branchy
-cd branchy
-echo q > q
-hg add q
-hg qnew -f qp
-hg qpop
-echo a > a
-hg ci -Ama
-hg up null
-hg branch b
-echo c > c
-hg ci -Amc
-hg merge default
-hg ci -mmerge
-hg up default
-hg log
-hg qpush
--- a/tests/test-mq-safety.out	Sun Aug 15 22:07:23 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-% try to commit on top of a patch
-abort: cannot commit over an applied mq patch
-% qpop/qrefresh on the wrong revision
-abort: popping would remove a revision not managed by this patch queue
-using patch queue:
-abort: popping would remove a revision not managed by this patch queue
-abort: working directory revision is not qtip
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-% qpop
-abort: popping would remove a revision not managed by this patch queue
-% qrefresh
-abort: cannot refresh a revision with children
-% tip:
-3 append quux
-% qpush warning branchheads
-popping qp
-patch queue now empty
-adding a
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-marked working directory as branch b
-adding c
-1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-(branch merge, don't forget to commit)
-0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-changeset:   2:65309210bf4e
-branch:      b
-tag:         tip
-parent:      1:707adb4c8ae1
-parent:      0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     merge
-
-changeset:   1:707adb4c8ae1
-branch:      b
-parent:      -1:000000000000
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     c
-
-changeset:   0:cb9a9f314b8b
-user:        test
-date:        Thu Jan 01 00:00:00 1970 +0000
-summary:     a
-
-applying qp
-now at: qp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-safety.t	Sun Aug 15 22:44:15 2010 +0900
@@ -0,0 +1,106 @@
+  $ echo '[extensions]' >> $HGRCPATH
+  $ echo 'mq =' >> $HGRCPATH
+
+  $ hg init repo
+  $ cd repo
+
+  $ echo foo > foo
+  $ hg ci -qAm 'add a file'
+
+  $ hg qinit
+
+  $ hg qnew foo
+  $ echo foo >> foo
+  $ hg qrefresh -m 'append foo'
+
+  $ hg qnew bar
+  $ echo bar >> foo
+  $ hg qrefresh -m 'append bar'
+
+
+try to commit on top of a patch
+
+  $ echo quux >> foo
+  $ hg ci -m 'append quux'
+  abort: cannot commit over an applied mq patch
+
+
+cheat a bit...
+
+  $ mv .hg/patches .hg/patches2
+  $ hg ci -m 'append quux'
+  $ mv .hg/patches2 .hg/patches
+
+
+qpop/qrefresh on the wrong revision
+
+  $ hg qpop
+  abort: popping would remove a revision not managed by this patch queue
+  $ hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
+  using patch queue:
+  abort: popping would remove a revision not managed by this patch queue
+  $ hg qrefresh
+  abort: working directory revision is not qtip
+
+  $ hg up -C qtip
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg qpop
+  abort: popping would remove a revision not managed by this patch queue
+  $ hg qrefresh
+  abort: cannot refresh a revision with children
+  $ hg tip --template '{rev} {desc}\n'
+  3 append quux
+
+
+qpush warning branchheads
+
+  $ cd ..
+  $ hg init branchy
+  $ cd branchy
+  $ echo q > q
+  $ hg add q
+  $ hg qnew -f qp
+  $ hg qpop
+  popping qp
+  patch queue now empty
+  $ echo a > a
+  $ hg ci -Ama
+  adding a
+  $ hg up null
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg branch b
+  marked working directory as branch b
+  $ echo c > c
+  $ hg ci -Amc
+  adding c
+  $ hg merge default
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -mmerge
+  $ hg up default
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg log
+  changeset:   2:65309210bf4e
+  branch:      b
+  tag:         tip
+  parent:      1:707adb4c8ae1
+  parent:      0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     merge
+  
+  changeset:   1:707adb4c8ae1
+  branch:      b
+  parent:      -1:000000000000
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     c
+  
+  changeset:   0:cb9a9f314b8b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a
+  
+  $ hg qpush
+  applying qp
+  now at: qp