Mercurial > hg
annotate tests/test-convert-hg-svn.t @ 19636:6bbce5efc67b
mq: look for modified subrepos when checking for local changes
It was possible to apply, unapply, fold, patches (etc) with modified subrepos,
which resulted in surprising behavior. For example it was easy to apply a patch
with a modified subrepo, and then the refresh it and accidentally end up
including the modified subrepo on the refreshed patch.
A test has been added to verify this new check.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1375742979 -7200
# Tue Aug 06 00:49:39 2013 +0200
# Node ID a5c90acff5e61aae714ba6c9457d766c54b4f124
# Parent 6ac206fb6f27492a98f46bbff090407ee1b1de72
mq: look for modified subrepos when checking for local changes
It was possible to apply, unapply, fold, patches (etc) with modified subrepos,
which resulted in surprising behavior. For example it was easy to apply a patch
with a modified subrepo, and then the refresh it and accidentally end up
including the modified subrepo on the refreshed patch.
A test has been added to verify this new check.
author | Angel Ezquerra <angel.ezquerra@gmail.com> |
---|---|
date | Tue, 06 Aug 2013 00:49:39 +0200 |
parents | 0413f68da85c |
children | e61a8395c3c1 |
rev | line source |
---|---|
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
1 |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
2 $ "$TESTDIR/hghave" svn svn-bindings || exit 80 |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
3 $ echo "[extensions]" >> $HGRCPATH |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
4 $ echo "convert = " >> $HGRCPATH |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
5 $ echo "mq = " >> $HGRCPATH |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
6 |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
7 $ SVNREPOPATH=`pwd`/svn-repo |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
8 #if windows |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
9 $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
10 #else |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
11 $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"` |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
12 #endif |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
13 |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
14 $ svnadmin create "$SVNREPOPATH" |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
15 $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
16 > #!/bin/sh |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
17 > |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
18 > REPOS="$1" |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
19 > REV="$2" |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
20 > USER="$3" |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
21 > PROPNAME="$4" |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
22 > ACTION="$5" |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
23 > |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
24 > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
25 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
26 > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
27 > |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
28 > echo "Changing prohibited revision property" >&2 |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
29 > exit 1 |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
30 > EOF |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
31 $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
32 $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
33 Checked out revision 0. |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
34 $ cd "$SVNREPOPATH"-wc |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
35 $ echo a > a |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
36 $ svn add a |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
37 A a |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
38 $ svn ci -m'added a' a |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
39 Adding a |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
40 Transmitting file data . |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
41 Committed revision 1. |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
42 $ cd .. |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
43 |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
44 initial roundtrip |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
45 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
46 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
47 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
48 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
49 converting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
50 0 added a |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
51 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
52 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
53 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
54 converting... |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
55 |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
56 second roundtrip should do nothing |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
57 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
58 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
59 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
60 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
61 converting... |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
62 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
63 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
64 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
65 converting... |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
66 |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
67 new hg rev |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
68 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
69 $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
70 updating to branch default |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
71 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
72 $ cd "$SVNREPOPATH"-work |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
73 $ echo b > b |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
74 $ hg add b |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
75 $ hg ci -mb |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
76 |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
77 adding an empty revision |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
78 |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
79 $ hg qnew -m emtpy empty |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
80 $ hg qfinish -a |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
81 $ cd .. |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
82 |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
83 echo hg to svn |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
84 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
85 $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work |
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
86 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
87 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
88 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
89 converting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
90 1 b |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
91 0 emtpy |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
92 |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
93 svn back to hg should do nothing |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
94 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
95 $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
96 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
97 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
98 converting... |
5554
2147a734dcf9
convert: tell the source repository when a rev has been converted
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
99 |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
100 hg back to svn should do nothing |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
101 |
17033
0413f68da85c
tests: cleanup of svn url handling
Mads Kiilerich <mads@kiilerich.com>
parents:
12527
diff
changeset
|
102 $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc |
12527
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
103 scanning source... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
104 sorting... |
9a0528fd9172
tests: unify test-convert-hg-svn
Matt Mackall <mpm@selenic.com>
parents:
10775
diff
changeset
|
105 converting... |