##// END OF EJS Templates
tests: load with "ext =" instead of "hgext.ext ="
Martin Geisler -
r10119:bb5ea667 default
parent child Browse files
Show More
@@ -1,113 +1,113
1 1 #!/bin/sh
2 2
3 3 do_push()
4 4 {
5 5 user=$1
6 6 shift
7 7
8 8 echo "Pushing as user $user"
9 9 echo 'hgrc = """'
10 10 sed -e 1,2d b/.hg/hgrc
11 11 echo '"""'
12 12 if test -f acl.config; then
13 13 echo 'acl.config = """'
14 14 cat acl.config
15 15 echo '"""'
16 16 fi
17 17 # On AIX /etc/profile sets LOGNAME read-only. So
18 18 # LOGNAME=$user hg --cws a --debug push ../b
19 19 # fails with "This variable is read only."
20 20 # Use env to work around this.
21 21 env LOGNAME=$user hg --cwd a --debug push ../b
22 22 hg --cwd b rollback
23 23 hg --cwd b --quiet tip
24 24 echo
25 25 }
26 26
27 27 hg init a
28 28 cd a
29 29 mkdir foo foo/Bar quux
30 30 echo 'in foo' > foo/file.txt
31 31 echo 'in foo/Bar' > foo/Bar/file.txt
32 32 echo 'in quux' > quux/file.py
33 33 hg add -q
34 34 hg ci -m 'add files' -d '1000000 0'
35 35 echo >> foo/file.txt
36 36 hg ci -m 'change foo/file' -d '1000001 0'
37 37 echo >> foo/Bar/file.txt
38 38 hg ci -m 'change foo/Bar/file' -d '1000002 0'
39 39 echo >> quux/file.py
40 40 hg ci -m 'change quux/file' -d '1000003 0'
41 41 hg tip --quiet
42 42
43 43 cd ..
44 44 hg clone -r 0 a b
45 45
46 46 echo '[extensions]' >> $HGRCPATH
47 echo 'hgext.acl =' >> $HGRCPATH
47 echo 'acl =' >> $HGRCPATH
48 48
49 49 config=b/.hg/hgrc
50 50
51 51 echo
52 52
53 53 echo 'Extension disabled for lack of a hook'
54 54 do_push fred
55 55
56 56 echo '[hooks]' >> $config
57 57 echo 'pretxnchangegroup.acl = python:hgext.acl.hook' >> $config
58 58
59 59 echo 'Extension disabled for lack of acl.sources'
60 60 do_push fred
61 61
62 62 echo 'No [acl.allow]/[acl.deny]'
63 63 echo '[acl]' >> $config
64 64 echo 'sources = push' >> $config
65 65 do_push fred
66 66
67 67 echo 'Empty [acl.allow]'
68 68 echo '[acl.allow]' >> $config
69 69 do_push fred
70 70
71 71 echo 'fred is allowed inside foo/'
72 72 echo 'foo/** = fred' >> $config
73 73 do_push fred
74 74
75 75 echo 'Empty [acl.deny]'
76 76 echo '[acl.deny]' >> $config
77 77 do_push barney
78 78
79 79 echo 'fred is allowed inside foo/, but not foo/bar/ (case matters)'
80 80 echo 'foo/bar/** = fred' >> $config
81 81 do_push fred
82 82
83 83 echo 'fred is allowed inside foo/, but not foo/Bar/'
84 84 echo 'foo/Bar/** = fred' >> $config
85 85 do_push fred
86 86
87 87 echo 'barney is not mentioned => not allowed anywhere'
88 88 do_push barney
89 89
90 90 echo 'barney is allowed everywhere'
91 91 echo '[acl.allow]' >> $config
92 92 echo '** = barney' >> $config
93 93 do_push barney
94 94
95 95 echo 'wilma can change files with a .txt extension'
96 96 echo '**/*.txt = wilma' >> $config
97 97 do_push wilma
98 98
99 99 echo 'file specified by acl.config does not exist'
100 100 echo '[acl]' >> $config
101 101 echo 'config = ../acl.config' >> $config
102 102 do_push barney
103 103
104 104 echo 'betty is allowed inside foo/ by a acl.config file'
105 105 echo '[acl.allow]' >> acl.config
106 106 echo 'foo/** = betty' >> acl.config
107 107 do_push betty
108 108
109 109 echo 'acl.config can set only [acl.allow]/[acl.deny]'
110 110 echo '[hooks]' >> acl.config
111 111 echo 'changegroup.acl = false' >> acl.config
112 112 do_push barney
113 113
@@ -1,59 +1,59
1 1 #!/bin/sh
2 2 # test children command
3 3
4 4 cat <<EOF >> $HGRCPATH
5 5 [extensions]
6 hgext.children=
6 children =
7 7 EOF
8 8
9 9 echo "% init"
10 10 hg init t
11 11 cd t
12 12
13 13 echo "% no working directory"
14 14 hg children
15 15
16 16 echo % setup
17 17 echo 0 > file0
18 18 hg ci -qAm 0 -d '0 0'
19 19
20 20 echo 1 > file1
21 21 hg ci -qAm 1 -d '1 0'
22 22
23 23 echo 2 >> file0
24 24 hg ci -qAm 2 -d '2 0'
25 25
26 26 hg co null
27 27 echo 3 > file3
28 28 hg ci -qAm 3 -d '3 0'
29 29
30 30 echo "% hg children at revision 3 (tip)"
31 31 hg children
32 32
33 33 hg co null
34 34 echo "% hg children at nullrev (should be 0 and 3)"
35 35 hg children
36 36
37 37 hg co 1
38 38 echo "% hg children at revision 1 (should be 2)"
39 39 hg children
40 40
41 41 hg co 2
42 42 echo "% hg children at revision 2 (other head)"
43 43 hg children
44 44
45 45 for i in null 0 1 2 3; do
46 46 echo "% hg children -r $i"
47 47 hg children -r $i
48 48 done
49 49
50 50 echo "% hg children -r 0 file0 (should be 2)"
51 51 hg children -r 0 file0
52 52
53 53 echo "% hg children -r 1 file0 (should be 2)"
54 54 hg children -r 1 file0
55 55
56 56 hg co 0
57 57 echo "% hg children file0 at revision 0 (should be 2)"
58 58 hg children file0
59 59
@@ -1,83 +1,83
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" baz || exit 80
4 4
5 5 mkdir do_not_use_HOME_baz
6 6 cd do_not_use_HOME_baz
7 7 HOME=`pwd`; export HOME
8 8 cd ..
9 9 baz my-id "mercurial <mercurial@selenic.com>"
10 10
11 11 echo "[extensions]" >> $HGRCPATH
12 12 echo "convert=" >> $HGRCPATH
13 echo 'hgext.graphlog =' >> $HGRCPATH
13 echo 'graphlog =' >> $HGRCPATH
14 14
15 15 echo % create baz archive
16 16 baz make-archive baz@mercurial--convert hg-test-convert-baz
17 17
18 18 echo % initialize baz repo
19 19 mkdir baz-repo
20 20 cd baz-repo/
21 21 baz init-tree baz@mercurial--convert/baz--test--0
22 22 baz import
23 23
24 24 echo % create initial files
25 25 echo 'this is a file' > a
26 26 baz add a
27 27 mkdir src
28 28 baz add src
29 29 cd src
30 30 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
31 31 baz add b
32 32 # HACK: hide GNU tar-1.22 "tar: The --preserve option is deprecated, use --preserve-permissions --preserve-order instead"
33 33 baz commit -s "added a file, src and src/b (binary)" 2>&1 | grep -v ^tar
34 34
35 35 echo % create link file and modify a
36 36 ln -s ../a a-link
37 37 baz add a-link
38 38 echo 'this a modification to a' >> ../a
39 39 baz commit -s "added link to a and modify a"
40 40
41 41 echo % create second link and modify b
42 42 ln -s ../a a-link-2
43 43 baz add a-link-2
44 44 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
45 45 baz commit -s "added second link and modify b"
46 46
47 47 echo % b file to link and a-link-2 to regular file
48 48 rm -f a-link-2
49 49 echo 'this is now a regular file' > a-link-2
50 50 ln -sf ../a b
51 51 baz commit -s "file to link and link to file test"
52 52
53 53 echo % move a-link-2 file and src directory
54 54 cd ..
55 55 baz mv src/a-link-2 c
56 56 baz mv src test
57 57 baz commit -s "move and rename a-link-2 file and src directory"
58 58
59 59 echo % move and add the moved file again
60 60 echo e > e
61 61 baz add e
62 62 baz commit -s "add e"
63 63 baz mv e f
64 64 echo ee > e
65 65 baz add e
66 66 baz commit -s "move e and recreate it again"
67 67 cd ..
68 68
69 69 echo % converting baz repo to Mercurial
70 70 hg convert baz-repo baz-repo-hg
71 71
72 72 baz register-archive -d baz@mercurial--convert
73 73
74 74 glog()
75 75 {
76 76 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
77 77 }
78 78
79 79 echo % show graph log
80 80 glog -R baz-repo-hg
81 81 hg up -q -R baz-repo-hg
82 82 hg -R baz-repo-hg manifest --debug
83 83 hg -R baz-repo-hg log -r 5 -r 7 -C --debug | grep copies
@@ -1,54 +1,54
1 1 #!/bin/sh
2 2
3 3 echo "[extensions]" >> $HGRCPATH
4 echo "hgext.convert = " >> $HGRCPATH
4 echo "convert = " >> $HGRCPATH
5 5 echo "[convert]" >> $HGRCPATH
6 6 echo "hg.tagsbranch=0" >> $HGRCPATH
7 7
8 8 hg init source
9 9 cd source
10 10 echo a > a
11 11 hg ci -qAm adda
12 12 # Add a merge with one parent in the same branch
13 13 echo a >> a
14 14 hg ci -qAm changea
15 15 hg up -qC 0
16 16 hg branch branch0
17 17 echo b > b
18 18 hg ci -qAm addb
19 19 hg up -qC
20 20 hg merge default
21 21 hg ci -qm mergeab
22 22 hg tag -ql mergeab
23 23 cd ..
24 24
25 25 # Miss perl... sometimes
26 26 cat > filter.py <<EOF
27 27 import sys, re
28 28
29 29 r = re.compile(r'^(?:\d+|pulling from)')
30 30 sys.stdout.writelines([l for l in sys.stdin if r.search(l)])
31 31 EOF
32 32
33 33 echo % convert
34 34 hg convert -v --config convert.hg.clonebranches=1 source dest |
35 35 python filter.py
36 36
37 37 # Add a merge with both parents and child in different branches
38 38 cd source
39 39 hg branch branch1
40 40 echo a > file1
41 41 hg ci -qAm c1
42 42 hg up -qC mergeab
43 43 hg branch branch2
44 44 echo a > file2
45 45 hg ci -qAm c2
46 46 hg merge branch1
47 47 hg branch branch3
48 48 hg ci -qAm c3
49 49 cd ..
50 50
51 51 echo % incremental conversion
52 52 hg convert -v --config convert.hg.clonebranches=1 source dest |
53 53 python filter.py
54 54
@@ -1,75 +1,75
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" darcs || exit 80
4 4
5 5 echo "[extensions]" >> $HGRCPATH
6 6 echo "convert=" >> $HGRCPATH
7 echo 'hgext.graphlog =' >> $HGRCPATH
7 echo 'graphlog =' >> $HGRCPATH
8 8
9 9 DARCS_EMAIL='test@example.org'; export DARCS_EMAIL
10 10 HOME=`pwd`/do_not_use_HOME_darcs; export HOME
11 11
12 12 # skip if we can't import elementtree
13 13 mkdir dummy
14 14 mkdir dummy/_darcs
15 15 if hg convert dummy 2>&1 | grep ElementTree > /dev/null; then
16 16 echo 'skipped: missing feature: elementtree module'
17 17 exit 80
18 18 fi
19 19
20 20 echo % initialize darcs repo
21 21 mkdir darcs-repo
22 22 cd darcs-repo
23 23 darcs init
24 24 echo a > a
25 25 darcs record -a -l -m p0
26 26 cd ..
27 27
28 28 echo % branch and update
29 29 darcs get darcs-repo darcs-clone >/dev/null
30 30 cd darcs-clone
31 31 echo c >> a
32 32 echo c > c
33 33 darcs record -a -l -m p1.1
34 34 cd ..
35 35
36 36 echo % update source
37 37 cd darcs-repo
38 38 echo b >> a
39 39 echo b > b
40 40 darcs record -a -l -m p1.2
41 41
42 42 echo % merge branch
43 43 darcs pull -a ../darcs-clone
44 44 sleep 1
45 45 echo e > a
46 46 echo f > f
47 47 mkdir dir
48 48 echo d > dir/d
49 49 echo d > dir/d2
50 50 darcs record -a -l -m p2
51 51
52 52 echo % test file and directory move
53 53 darcs mv f ff
54 54 # Test remove + move
55 55 darcs remove dir/d2
56 56 rm dir/d2
57 57 darcs mv dir dir2
58 58 darcs record -a -l -m p3
59 59 cd ..
60 60
61 61 glog()
62 62 {
63 63 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
64 64 }
65 65
66 66 hg convert darcs-repo darcs-repo-hg
67 67 # The converter does not currently handle patch conflicts very well.
68 68 # When they occur, it reverts *all* changes and moves forward,
69 69 # letting the conflict resolving patch fix collisions.
70 70 # Unfortunately, non-conflicting changes, like the addition of the
71 71 # "c" file in p1.1 patch are reverted too.
72 72 # Just to say that manifest not listing "c" here is a bug.
73 73 glog -R darcs-repo-hg
74 74 hg up -q -R darcs-repo-hg
75 75 hg -R darcs-repo-hg manifest --debug
@@ -1,130 +1,130
1 1 #!/bin/sh
2 2
3 3 HGMERGE=true; export HGMERGE
4 4
5 5 echo '[extensions]' >> $HGRCPATH
6 echo 'hgext.graphlog =' >> $HGRCPATH
7 echo 'hgext.convert =' >> $HGRCPATH
6 echo 'graphlog =' >> $HGRCPATH
7 echo 'convert =' >> $HGRCPATH
8 8
9 9 glog()
10 10 {
11 11 hg glog --template '{rev} "{desc}" files: {files}\n' "$@"
12 12 }
13 13
14 14 hg init source
15 15 cd source
16 16
17 17 echo foo > foo
18 18 echo baz > baz
19 19 mkdir -p dir/subdir
20 20 echo dir/file >> dir/file
21 21 echo dir/file2 >> dir/file2
22 22 echo dir/subdir/file3 >> dir/subdir/file3
23 23 echo dir/subdir/file4 >> dir/subdir/file4
24 24 hg ci -d '0 0' -qAm '0: add foo baz dir/'
25 25
26 26 echo bar > bar
27 27 echo quux > quux
28 28 hg copy foo copied
29 29 hg ci -d '1 0' -qAm '1: add bar quux; copy foo to copied'
30 30
31 31 echo >> foo
32 32 hg ci -d '2 0' -m '2: change foo'
33 33
34 34 hg up -qC 1
35 35 echo >> bar
36 36 echo >> quux
37 37 hg ci -d '3 0' -m '3: change bar quux'
38 38
39 39 hg up -qC 2
40 40 hg merge -qr 3
41 41 echo >> bar
42 42 echo >> baz
43 43 hg ci -d '4 0' -m '4: first merge; change bar baz'
44 44
45 45 echo >> bar
46 46 echo 1 >> baz
47 47 echo >> quux
48 48 hg ci -d '5 0' -m '5: change bar baz quux'
49 49
50 50 hg up -qC 4
51 51 echo >> foo
52 52 echo 2 >> baz
53 53 hg ci -d '6 0' -m '6: change foo baz'
54 54
55 55 hg up -qC 5
56 56 hg merge -qr 6
57 57 echo >> bar
58 58 hg ci -d '7 0' -m '7: second merge; change bar'
59 59
60 60 echo >> foo
61 61 hg ci -m '8: change foo'
62 62
63 63 glog
64 64
65 65 echo '% final file versions in this repo:'
66 66 hg manifest --debug
67 67 hg debugrename copied
68 68 echo
69 69
70 70 cd ..
71 71
72 72 splitrepo()
73 73 {
74 74 msg="$1"
75 75 files="$2"
76 76 opts=$3
77 77 echo "% $files: $msg"
78 78 prefix=`echo "$files" | sed -e 's/ /-/g'`
79 79 fmap="$prefix.fmap"
80 80 repo="$prefix.repo"
81 81 for i in $files; do
82 82 echo "include $i" >> "$fmap"
83 83 done
84 84 hg -q convert $opts --filemap "$fmap" --datesort source "$repo"
85 85 hg up -q -R "$repo"
86 86 glog -R "$repo"
87 87 hg -R "$repo" manifest --debug
88 88 }
89 89
90 90 splitrepo 'skip unwanted merges; use 1st parent in 1st merge, 2nd in 2nd' foo
91 91
92 92 splitrepo 'merges are not merges anymore' bar
93 93
94 94 splitrepo '1st merge is not a merge anymore; 2nd still is' baz
95 95
96 96 splitrepo 'we add additional merges when they are interesting' 'foo quux'
97 97
98 98 splitrepo 'partial conversion' 'bar quux' '-r 3'
99 99 splitrepo 'complete the partial conversion' 'bar quux'
100 100
101 101 rm -r foo.repo
102 102 splitrepo 'partial conversion' 'foo' '-r 3'
103 103 splitrepo 'complete the partial conversion' 'foo'
104 104
105 105 splitrepo 'copied file; source not included in new repo' copied
106 106 hg --cwd copied.repo debugrename copied
107 107
108 108 splitrepo 'copied file; source included in new repo' 'foo copied'
109 109 hg --cwd foo-copied.repo debugrename copied
110 110
111 111 cat > renames.fmap <<EOF
112 112 include dir
113 113 exclude dir/file2
114 114 rename dir dir2
115 115 include foo
116 116 include copied
117 117 rename foo foo2
118 118 rename copied copied2
119 119 exclude dir/subdir
120 120 include dir/subdir/file3
121 121 EOF
122 122 hg -q convert --filemap renames.fmap --datesort source renames.repo
123 123 hg up -q -R renames.repo
124 124 glog -R renames.repo
125 125 hg -R renames.repo manifest --debug
126 126 hg --cwd renames.repo debugrename copied2
127 127 echo 'copied:'
128 128 hg --cwd source cat copied
129 129 echo 'copied2:'
130 130 hg --cwd renames.repo cat copied2
@@ -1,61 +1,61
1 1 #!/bin/sh
2 2
3 3 echo '[extensions]' >> $HGRCPATH
4 echo 'hgext.graphlog =' >> $HGRCPATH
5 echo 'hgext.convert =' >> $HGRCPATH
4 echo 'graphlog =' >> $HGRCPATH
5 echo 'convert =' >> $HGRCPATH
6 6
7 7 glog()
8 8 {
9 9 hg -R "$1" glog --template '{rev} "{desc}" files: {files}\n'
10 10 }
11 11
12 12 hg init source
13 13 cd source
14 14
15 15 echo a > a
16 16 echo b > b
17 17 hg ci -d '0 0' -qAm '0: add a b'
18 18 echo c > c
19 19 hg ci -d '1 0' -qAm '1: add c'
20 20 hg copy a e
21 21 echo b >> b
22 22 hg ci -d '2 0' -qAm '2: copy e from a, change b'
23 23 hg up -C 0
24 24 echo a >> a
25 25 hg ci -d '3 0' -qAm '3: change a'
26 26 hg merge
27 27 hg copy b d
28 28 hg ci -d '4 0' -qAm '4: merge 2 and 3, copy d from b'
29 29 echo a >> a
30 30 hg ci -d '5 0' -qAm '5: change a'
31 31 cd ..
32 32
33 33 echo % convert from null revision
34 34 hg convert --config convert.hg.startrev=null source empty
35 35 glog empty
36 36
37 37 echo % convert from zero revision
38 38 hg convert --config convert.hg.startrev=0 source full
39 39 glog full
40 40
41 41 echo % convert from merge parent
42 42 hg convert --config convert.hg.startrev=1 source conv1
43 43 glog conv1
44 44 cd conv1
45 45 echo % check copy preservation
46 46 hg log --follow --copies e
47 47 echo % check copy removal on missing parent
48 48 hg log --follow --copies d
49 49 hg cat -r tip a b
50 50 hg -q verify
51 51 cd ..
52 52
53 53 echo % convert from merge
54 54 hg convert --config convert.hg.startrev=4 source conv4
55 55 glog conv4
56 56 cd conv4
57 57 hg up -C
58 58 hg cat -r tip a b
59 59 hg -q verify
60 60 cd ..
61 61
@@ -1,146 +1,146
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" mtn || exit 80
4 4
5 5 # Monotone directory is called .monotone on *nix and monotone
6 6 # on Windows. Having a variable here ease test patching.
7 7 mtndir=.monotone
8 8 echo "[extensions]" >> $HGRCPATH
9 9 echo "convert=" >> $HGRCPATH
10 echo 'hgext.graphlog =' >> $HGRCPATH
10 echo 'graphlog =' >> $HGRCPATH
11 11
12 12 HOME=`pwd`/do_not_use_HOME_mtn; export HOME
13 13 # Windows version of monotone home
14 14 APPDATA=$HOME; export APPDATA
15 15
16 16 echo % tedious monotone keys configuration
17 17 # The /dev/null redirection is necessary under Windows, or
18 18 # it complains about home directory permissions
19 19 mtn --quiet genkey test@selenic.com 1>/dev/null 2>&1 <<EOF
20 20 passphrase
21 21 passphrase
22 22 EOF
23 23 cat >> $HOME/$mtndir/monotonerc <<EOF
24 24 function get_passphrase(keypair_id)
25 25 return "passphrase"
26 26 end
27 27 EOF
28 28
29 29 echo % create monotone repository
30 30 mtn db init --db=repo.mtn
31 31 mtn --db=repo.mtn --branch=com.selenic.test setup workingdir
32 32 cd workingdir
33 33 echo a > a
34 34 mkdir dir
35 35 echo b > dir/b
36 36 echo d > dir/d
37 37 python -c 'file("bin", "wb").write("a\\x00b")'
38 38 echo c > c
39 39 mtn add a dir/b dir/d c bin
40 40 mtn ci -m initialize
41 41 echo % update monotone working directory
42 42 mtn mv a dir/a
43 43 echo a >> dir/a
44 44 echo b >> dir/b
45 45 mtn drop c
46 46 python -c 'file("bin", "wb").write("b\\x00c")'
47 47 mtn ci -m update1
48 48 cd ..
49 49
50 50 echo % convert once
51 51 hg convert -s mtn repo.mtn
52 52
53 53 cd workingdir
54 54 echo e > e
55 55 mtn add e
56 56 mtn drop dir/b
57 57 mtn mv bin bin2
58 58 mtn ci -m 'update2 "with" quotes'
59 59 echo '% test directory move'
60 60 mkdir -p dir1/subdir1
61 61 mkdir -p dir1/subdir2_other
62 62 echo file1 > dir1/subdir1/file1
63 63 echo file2 > dir1/subdir2_other/file1
64 64 mtn add dir1/subdir1/file1 dir1/subdir2_other/file1
65 65 mtn ci -m createdir1
66 66 mtn rename dir1/subdir1 dir1/subdir2
67 67 mtn ci -m movedir1
68 68 echo '% test subdirectory move'
69 69 mtn mv dir dir2
70 70 echo newfile > dir2/newfile
71 71 mtn drop dir2/d
72 72 mtn add dir2/newfile
73 73 mtn ci -m movedir
74 74 # Test directory removal with empty directory
75 75 mkdir dir2/dir
76 76 mkdir dir2/dir/subdir
77 77 echo f > dir2/dir/subdir/f
78 78 mkdir dir2/dir/emptydir
79 79 mtn add --quiet -R dir2/dir
80 80 mtn ci -m emptydir
81 81 mtn drop -R dir2/dir
82 82 mtn ci -m dropdirectory
83 83 echo '% test directory and file move'
84 84 mkdir -p dir3/d1
85 85 echo a > dir3/a
86 86 mtn add dir3/a dir3/d1
87 87 mtn ci -m dirfilemove
88 88 mtn mv dir3/a dir3/d1/a
89 89 mtn mv dir3/d1 dir3/d2
90 90 mtn ci -m dirfilemove2
91 91 echo '% test directory move into another directory move'
92 92 mkdir dir4
93 93 mkdir dir5
94 94 echo a > dir4/a
95 95 mtn add dir4/a dir5
96 96 mtn ci -m dirdirmove
97 97 mtn mv dir5 dir6
98 98 mtn mv dir4 dir6/dir4
99 99 mtn ci -m dirdirmove2
100 100 echo '% test diverging directory moves'
101 101 mkdir -p dir7/dir9/dir8
102 102 echo a > dir7/dir9/dir8/a
103 103 echo b > dir7/dir9/b
104 104 echo c > dir7/c
105 105 mtn add -R dir7
106 106 mtn ci -m divergentdirmove
107 107 mtn mv dir7 dir7-2
108 108 mtn mv dir7-2/dir9 dir9-2
109 109 mtn mv dir9-2/dir8 dir8-2
110 110 mtn ci -m divergentdirmove2
111 111 cd ..
112 112
113 113 echo % convert incrementally
114 114 hg convert -s mtn repo.mtn
115 115
116 116 glog()
117 117 {
118 118 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
119 119 }
120 120
121 121 cd repo.mtn-hg
122 122 hg up -C
123 123 glog
124 124 echo % manifest
125 125 hg manifest
126 126 echo % contents
127 127 cat dir2/a
128 128 test -d dir2/dir && echo 'removed dir2/dir is still there!'
129 129
130 130 echo % file move
131 131 hg log -v -C -r 1 | grep copies
132 132 echo % check directory move
133 133 hg manifest -r 4
134 134 test -d dir1/subdir2 || echo 'new dir1/subdir2 does not exist!'
135 135 test -d dir1/subdir1 && echo 'renamed dir1/subdir1 is still there!'
136 136 hg log -v -C -r 4 | grep copies
137 137 echo % check file remove with directory move
138 138 hg manifest -r 5
139 139 echo % check file move with directory move
140 140 hg manifest -r 9
141 141 echo % check file directory directory move
142 142 hg manifest -r 11
143 143 echo % check divergent directory moves
144 144 hg manifest -r 13
145 145 exit 0
146 146
@@ -1,51 +1,51
1 1 #!/bin/sh
2 2
3 3 echo "[extensions]" >> $HGRCPATH
4 4 echo "convert=" >> $HGRCPATH
5 echo 'hgext.graphlog =' >> $HGRCPATH
5 echo 'graphlog =' >> $HGRCPATH
6 6
7 7 glog()
8 8 {
9 9 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
10 10 }
11 11
12 12 hg init repo1
13 13 cd repo1
14 14 echo a > a
15 15 hg ci -Am adda
16 16 echo b > b
17 17 echo a >> a
18 18 hg ci -Am addb
19 19 PARENTID1=`hg id --debug -i`
20 20 echo c > c
21 21 hg ci -Am addc
22 22 PARENTID2=`hg id --debug -i`
23 23 cd ..
24 24
25 25 hg init repo2
26 26 cd repo2
27 27 echo b > a
28 28 echo d > d
29 29 hg ci -Am addaandd
30 30 CHILDID1=`hg id --debug -i`
31 31 echo d >> d
32 32 hg ci -Am changed
33 33 CHILDID2=`hg id --debug -i`
34 34 echo e > e
35 35 hg ci -Am adde
36 36 cd ..
37 37
38 38 echo '% test invalid splicemap'
39 39 cat > splicemap <<EOF
40 40 $CHILDID2
41 41 EOF
42 42 hg convert --splicemap splicemap repo2 repo1
43 43
44 44 echo '% splice repo2 on repo1'
45 45 cat > splicemap <<EOF
46 46 $CHILDID1 $PARENTID1
47 47 $CHILDID2 $PARENTID2,$CHILDID1
48 48 EOF
49 49 hg clone repo1 target1
50 50 hg convert --splicemap splicemap repo2 target1
51 51 glog -R target1
@@ -1,34 +1,34
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4 4
5 5 fix_path()
6 6 {
7 7 tr '\\' /
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "graphlog =" >> $HGRCPATH
13 13
14 14 svnadmin create svn-repo
15 15 cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null
16 16
17 17 echo % convert trunk and branches
18 18 cat >branchmap <<EOF
19 19 old3 newbranch
20 20 EOF
21 21 hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
22 22
23 23 echo % convert again
24 24 hg convert --branchmap=branchmap --datesort svn-repo A-hg
25 25
26 26 cd A-hg
27 27 hg glog --template 'branch={branches} {rev} {desc|firstline} files: {files}\n'
28 28 hg branches | sed 's/:.*/:/'
29 29 hg tags -q
30 30 cd ..
31 31
32 32 echo '% test hg failing to call itself'
33 33 HG=foobar hg convert svn-repo B-hg 2>&1 | grep -v foobar
34 34
@@ -1,89 +1,89
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4 4
5 5 fix_path()
6 6 {
7 7 tr '\\' /
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "convert = " >> $HGRCPATH
12 echo 'hgext.graphlog =' >> $HGRCPATH
12 echo 'graphlog =' >> $HGRCPATH
13 13
14 14 svnadmin create svn-repo
15 15
16 16 svnpath=`pwd | fix_path`
17 17 # SVN wants all paths to start with a slash. Unfortunately,
18 18 # Windows ones don't. Handle that.
19 19 expr $svnpath : "\/" > /dev/null
20 20 if [ $? -ne 0 ]; then
21 21 svnpath='/'$svnpath
22 22 fi
23 23
24 24 echo "# now tests that it works with trunk/tags layout, but no branches yet"
25 25 echo
26 26 echo % initial svn import
27 27 mkdir projB
28 28 cd projB
29 29 mkdir trunk
30 30 mkdir tags
31 31 cd ..
32 32
33 33 svnurl=file://$svnpath/svn-repo/proj%20B
34 34 svn import -m "init projB" projB $svnurl | fix_path
35 35
36 36
37 37 echo % update svn repository
38 38 svn co $svnurl/trunk B | fix_path
39 39 cd B
40 40 echo hello > 'letter .txt'
41 41 svn add 'letter .txt'
42 42 svn ci -m hello
43 43
44 44 "$TESTDIR/svn-safe-append.py" world 'letter .txt'
45 45 svn ci -m world
46 46
47 47 svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1
48 48
49 49 "$TESTDIR/svn-safe-append.py" 'nice day today!' 'letter .txt'
50 50 svn ci -m "nice day"
51 51 cd ..
52 52
53 53 echo % convert to hg once
54 54 hg convert $svnurl B-hg
55 55
56 56 echo % update svn repository again
57 57 cd B
58 58 "$TESTDIR/svn-safe-append.py" "see second letter" 'letter .txt'
59 59 echo "nice to meet you" > letter2.txt
60 60 svn add letter2.txt
61 61 svn ci -m "second letter"
62 62
63 63 svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2
64 64
65 65 "$TESTDIR/svn-safe-append.py" "blah-blah-blah" letter2.txt
66 66 svn ci -m "work in progress"
67 67 cd ..
68 68
69 69 ########################################
70 70
71 71 echo % test incremental conversion
72 72 hg convert $svnurl B-hg
73 73
74 74 cd B-hg
75 75 hg glog --template '{rev} {desc|firstline} files: {files}\n'
76 76 hg tags -q
77 77 cd ..
78 78
79 79 echo % test filemap
80 80 echo 'include letter2.txt' > filemap
81 81 hg convert --filemap filemap $svnurl/trunk fmap
82 82 hg glog -R fmap --template '{rev} {desc|firstline} files: {files}\n'
83 83
84 84 echo % test stop revision
85 85 hg convert --rev 1 $svnurl/trunk stoprev
86 86 # Check convert_revision extra-records.
87 87 # This is also the only place testing more than one extra field
88 88 # in a revision.
89 89 hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/'
@@ -1,37 +1,37
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4 4
5 5 fix_path()
6 6 {
7 7 tr '\\' /
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "graphlog =" >> $HGRCPATH
13 13
14 14 svnadmin create svn-repo
15 15 cat "$TESTDIR/svn/startrev.svndump" | svnadmin load svn-repo > /dev/null
16 16
17 17 convert()
18 18 {
19 19 startrev=$1
20 20 repopath=A-r$startrev-hg
21 21 hg convert --config convert.svn.startrev=$startrev \
22 22 --config convert.svn.trunk=branches/branch1 \
23 23 --config convert.svn.branches=" " \
24 24 --config convert.svn.tags= \
25 25 --datesort svn-repo $repopath
26 26 hg -R $repopath glog --template '{rev} {desc|firstline} files: {files}\n'
27 27 echo
28 28 }
29 29
30 30 echo % convert before branching point
31 31 convert 3
32 32 echo % convert before branching point
33 33 convert 4
34 34 echo % convert at branching point
35 35 convert 5
36 36 echo % convert last revision only
37 37 convert 6
@@ -1,28 +1,28
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" svn svn-bindings || exit 80
4 4
5 5 fix_path()
6 6 {
7 7 tr '\\' /
8 8 }
9 9
10 10 echo "[extensions]" >> $HGRCPATH
11 11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH
12 echo "graphlog =" >> $HGRCPATH
13 13
14 14 svnadmin create svn-repo
15 15 cat "$TESTDIR/svn/tags.svndump" | svnadmin load svn-repo > /dev/null
16 16
17 17 echo % convert
18 18 hg convert --datesort svn-repo A-hg
19 19
20 20 cd A-hg
21 21 hg glog --template '{rev} {desc|firstline} tags: {tags}\n'
22 22 hg tags | sed 's/:.*/:/'
23 23 cd ..
24 24
25 25 echo % convert without tags
26 26 hg convert --datesort --config convert.svn.tags= svn-repo A-notags-hg
27 27 hg -R A-notags-hg tags -q
28 28
@@ -1,73 +1,73
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" tla || exit 80
4 4
5 5 mkdir do_not_use_HOME_tla
6 6 cd do_not_use_HOME_tla
7 7 HOME=`pwd`; export HOME
8 8 cd ..
9 9 tla my-id "mercurial <mercurial@selenic.com>"
10 10
11 11 echo "[extensions]" >> $HGRCPATH
12 12 echo "convert=" >> $HGRCPATH
13 echo 'hgext.graphlog =' >> $HGRCPATH
13 echo 'graphlog =' >> $HGRCPATH
14 14
15 15 echo % create tla archive
16 16 tla make-archive tla@mercurial--convert `pwd`/hg-test-convert-tla
17 17
18 18 echo % initialize tla repo
19 19 mkdir tla-repo
20 20 cd tla-repo/
21 21 tla init-tree tla@mercurial--convert/tla--test--0
22 22 tla import
23 23
24 24 echo % create initial files
25 25 echo 'this is a file' > a
26 26 tla add a
27 27 mkdir src
28 28 tla add src
29 29 cd src
30 30 dd count=1 if=/dev/zero of=b > /dev/null 2> /dev/null
31 31 tla add b
32 32 tla commit -s "added a file, src and src/b (binary)"
33 33
34 34 echo % create link file and modify a
35 35 ln -s ../a a-link
36 36 tla add a-link
37 37 echo 'this a modification to a' >> ../a
38 38 tla commit -s "added link to a and modify a"
39 39
40 40 echo % create second link and modify b
41 41 ln -s ../a a-link-2
42 42 tla add a-link-2
43 43 dd count=1 seek=1 if=/dev/zero of=b > /dev/null 2> /dev/null
44 44 tla commit -s "added second link and modify b"
45 45
46 46 echo % b file to link and a-link-2 to regular file
47 47 rm -f a-link-2
48 48 echo 'this is now a regular file' > a-link-2
49 49 ln -sf ../a b
50 50 tla commit -s "file to link and link to file test"
51 51
52 52 echo % move a-link-2 file and src directory
53 53 cd ..
54 54 tla mv src/a-link-2 c
55 55 tla mv src test
56 56 tla commit -s "move and rename a-link-2 file and src directory"
57 57
58 58 cd ..
59 59
60 60 echo % converting tla repo to Mercurial
61 61 hg convert tla-repo tla-repo-hg
62 62
63 63 tla register-archive -d tla@mercurial--convert
64 64
65 65 glog()
66 66 {
67 67 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
68 68 }
69 69
70 70 echo % show graph log
71 71 glog -R tla-repo-hg
72 72 hg up -q -R tla-repo-hg
73 73 hg -R tla-repo-hg manifest --debug
@@ -1,78 +1,78
1 1 #!/bin/sh
2 2
3 3 branches=.hg/branchheads.cache
4 4 echo '[extensions]' >> $HGRCPATH
5 echo 'hgext.mq=' >> $HGRCPATH
5 echo 'mq =' >> $HGRCPATH
6 6
7 7 show_branch_cache()
8 8 {
9 9 # force cache (re)generation
10 10 hg log -r does-not-exist 2> /dev/null
11 11 hg log -r tip --template 'tip: {rev}\n'
12 12 if [ -f $branches ]; then
13 13 sort $branches
14 14 else
15 15 echo No branch cache
16 16 fi
17 17 if [ "$1" = 1 ]; then
18 18 for b in foo bar; do
19 19 hg log -r $b --template "branch $b: "'{rev}\n'
20 20 done
21 21 fi
22 22 }
23 23
24 24 hg init a
25 25 cd a
26 26 hg qinit -c
27 27
28 28 echo '# mq patch on an empty repo'
29 29 hg qnew p1
30 30 show_branch_cache
31 31
32 32 echo > pfile
33 33 hg add pfile
34 34 hg qrefresh -m 'patch 1'
35 35 show_branch_cache
36 36
37 37 echo
38 38 echo '# some regular revisions'
39 39 hg qpop
40 40 echo foo > foo
41 41 hg add foo
42 42 echo foo > .hg/branch
43 43 hg ci -m 'branch foo' -d '1000000 0'
44 44
45 45 echo bar > bar
46 46 hg add bar
47 47 echo bar > .hg/branch
48 48 hg ci -m 'branch bar' -d '1000000 0'
49 49 show_branch_cache
50 50
51 51 echo
52 52 echo '# add some mq patches'
53 53 hg qpush
54 54 show_branch_cache
55 55
56 56 hg qnew p2
57 57 echo foo > .hg/branch
58 58 echo foo2 >> foo
59 59 hg qrefresh -m 'patch 2'
60 60 show_branch_cache 1
61 61
62 62 echo
63 63 echo '# removing the cache'
64 64 rm $branches
65 65 show_branch_cache 1
66 66
67 67 echo
68 68 echo '# importing rev 1 (the cache now ends in one of the patches)'
69 69 hg qimport -r 1 -n p0
70 70 show_branch_cache 1
71 71 hg log -r qbase --template 'qbase: {rev}\n'
72 72
73 73 echo
74 74 echo '# detect an invalid cache'
75 75 hg qpop -a
76 76 hg qpush -a
77 77 show_branch_cache
78 78
@@ -1,73 +1,73
1 1 #!/bin/sh
2 2
3 3 # Test issue 529 - mq aborts when merging patch deleting files
4 4
5 5 rewrite_path()
6 6 {
7 7 sed -e 's:\\:/:g' -e 's:[^ ]*/t/::g'
8 8 }
9 9
10 10 checkundo()
11 11 {
12 12 if [ -f .hg/store/undo ]; then
13 13 echo ".hg/store/undo still exists after $1"
14 14 fi
15 15 }
16 16
17 17 echo "[extensions]" >> $HGRCPATH
18 echo "hgext.mq=" >> $HGRCPATH
18 echo "mq =" >> $HGRCPATH
19 19
20 20 # Commit two dummy files in "init" changeset
21 21 hg init t
22 22 cd t
23 23 echo a > a
24 24 echo b > b
25 25 hg ci -Am init
26 26 hg tag -l init
27 27
28 28 # Create a patch removing a
29 29 hg qnew rm_a
30 30 hg rm a
31 31 hg qrefresh -m "rm a"
32 32
33 33 # Save the patch queue so we can merge it later
34 34 hg qsave -c -e 2>&1 | rewrite_path
35 35 checkundo qsave
36 36
37 37 # Update b and commit in an "update" changeset
38 38 hg up -C init
39 39 echo b >> b
40 40 hg st
41 41 hg ci -m update
42 42
43 43 # Here, qpush used to abort with :
44 44 # The system cannot find the file specified => a
45 45 hg manifest
46 46 hg qpush -a -m 2>&1 | rewrite_path
47 47 checkundo 'qpush -m'
48 48 hg manifest
49 49
50 50 # ensure status is correct after merge
51 51 hg qpop -a
52 52 cd ..
53 53
54 54 # Classic MQ merge sequence *with an explicit named queue*
55 55 echo
56 56 echo % init t2
57 57 hg init t2
58 58 cd t2
59 59 echo a > a
60 60 hg ci -Am init
61 61 echo b >> a
62 62 hg ci -m changea
63 63 hg up -C 0
64 64 echo c >> a
65 65 hg qnew -f -e patcha
66 66 echo % create the reference queue
67 67 hg qsave -c -e -n refqueue 2> /dev/null
68 68 hg up -C 1
69 69 echo % merge
70 70 hg qpush -m -n refqueue 2>&1 | \
71 71 sed 's/merging with queue at.*refqueue/merging with queue at refqueue/'
72 72 cd ..
73 73
@@ -1,44 +1,44
1 1 #!/bin/sh
2 2
3 3 echo '[extensions]' >> $HGRCPATH
4 echo 'hgext.mq =' >> $HGRCPATH
4 echo 'mq =' >> $HGRCPATH
5 5
6 6 hg init repo
7 7 cd repo
8 8
9 9 echo foo > foo
10 10 hg ci -qAm 'add a file'
11 11
12 12 hg qinit
13 13
14 14 hg qnew foo
15 15 echo foo >> foo
16 16 hg qrefresh -m 'append foo'
17 17
18 18 hg qnew bar
19 19 echo bar >> foo
20 20 hg qrefresh -m 'append bar'
21 21
22 22 echo '% try to commit on top of a patch'
23 23 echo quux >> foo
24 24 hg ci -m 'append quux'
25 25
26 26 # cheat a bit...
27 27 mv .hg/patches .hg/patches2
28 28 hg ci -m 'append quux'
29 29 mv .hg/patches2 .hg/patches
30 30
31 31 echo '% qpop/qrefresh on the wrong revision'
32 32 hg qpop
33 33 hg qpop -n patches 2>&1 | sed -e 's/\(using patch queue:\).*/\1/'
34 34 hg qrefresh
35 35
36 36 hg up -C qtip
37 37 echo '% qpop'
38 38 hg qpop
39 39
40 40 echo '% qrefresh'
41 41 hg qrefresh
42 42
43 43 echo '% tip:'
44 44 hg tip --template '{rev} {desc}\n'
@@ -1,69 +1,69
1 1 #!/bin/sh
2 2
3 3 commit()
4 4 {
5 5 msg=$1
6 6 p1=$2
7 7 p2=$3
8 8
9 9 if [ "$p1" ]; then
10 10 hg up -qC $p1
11 11 fi
12 12
13 13 if [ "$p2" ]; then
14 14 HGMERGE=true hg merge -q $p2
15 15 fi
16 16
17 17 echo >> foo
18 18
19 19 hg commit -qAm "$msg"
20 20 }
21 21
22 22 hg init repo
23 23 cd repo
24 24
25 25 echo '[extensions]' > .hg/hgrc
26 echo 'hgext.parentrevspec =' >> .hg/hgrc
26 echo 'parentrevspec =' >> .hg/hgrc
27 27
28 28 commit '0: add foo'
29 29 commit '1: change foo 1'
30 30 commit '2: change foo 2a'
31 31 commit '3: change foo 3a'
32 32 commit '4: change foo 2b' 1
33 33 commit '5: merge' 3 4
34 34 commit '6: change foo again'
35 35
36 36 hg log --template '{rev}:{node|short} {parents}\n'
37 37 echo
38 38
39 39 lookup()
40 40 {
41 41 for rev in "$@"; do
42 42 printf "$rev: "
43 43 hg id -nr $rev
44 44 done
45 45 true
46 46 }
47 47
48 48 tipnode=`hg id -ir tip`
49 49
50 50 echo 'should work with tag/branch/node/rev'
51 51 for r in tip default $tipnode 6; do
52 52 lookup "$r^"
53 53 done
54 54 echo
55 55
56 56 echo 'some random lookups'
57 57 lookup "6^^" "6^^^" "6^^^^" "6^^^^^" "6^^^^^^" "6^1" "6^2" "6^^2" "6^1^2" "6^^3"
58 58 lookup "6~" "6~1" "6~2" "6~3" "6~4" "6~5" "6~42" "6~1^2" "6~1^2~2"
59 59 echo
60 60
61 61 echo 'with a tag "6^" pointing to rev 1'
62 62 hg tag -l -r 1 "6^"
63 63 lookup "6^" "6^1" "6~1" "6^^"
64 64 echo
65 65
66 66 echo 'with a tag "foo^bar" pointing to rev 2'
67 67 hg tag -l -r 2 "foo^bar"
68 68 lookup "foo^bar" "foo^bar^"
69 69
@@ -1,138 +1,138
1 1 #!/bin/sh
2 2
3 3 cat <<EOF >> $HGRCPATH
4 4 [extensions]
5 hgext.purge=
5 purge =
6 6 EOF
7 7
8 8 echo % init
9 9 hg init t
10 10 cd t
11 11
12 12 echo % setup
13 13 echo r1 > r1
14 14 hg ci -qAmr1 -d'0 0'
15 15 mkdir directory
16 16 echo r2 > directory/r2
17 17 hg ci -qAmr2 -d'1 0'
18 18 echo 'ignored' > .hgignore
19 19 hg ci -qAmr3 -d'2 0'
20 20
21 21 echo % delete an empty directory
22 22 mkdir empty_dir
23 23 hg purge -p
24 24 hg purge -v
25 25 ls
26 26
27 27 echo % delete an untracked directory
28 28 mkdir untracked_dir
29 29 touch untracked_dir/untracked_file1
30 30 touch untracked_dir/untracked_file2
31 31 hg purge -p
32 32 hg purge -v
33 33 ls
34 34
35 35 echo % delete an untracked file
36 36 touch untracked_file
37 37 touch untracked_file_readonly
38 38 python <<EOF
39 39 import os, stat
40 40 f= 'untracked_file_readonly'
41 41 os.chmod(f, stat.S_IMODE(os.stat(f).st_mode) & ~stat.S_IWRITE)
42 42 EOF
43 43 hg purge -p
44 44 hg purge -v
45 45 ls
46 46
47 47 echo % delete an untracked file in a tracked directory
48 48 touch directory/untracked_file
49 49 hg purge -p
50 50 hg purge -v
51 51 ls
52 52
53 53 echo % delete nested directories
54 54 mkdir -p untracked_directory/nested_directory
55 55 hg purge -p
56 56 hg purge -v
57 57 ls
58 58
59 59 echo % delete nested directories from a subdir
60 60 mkdir -p untracked_directory/nested_directory
61 61 cd directory
62 62 hg purge -p
63 63 hg purge -v
64 64 cd ..
65 65 ls
66 66
67 67 echo % delete only part of the tree
68 68 mkdir -p untracked_directory/nested_directory
69 69 touch directory/untracked_file
70 70 cd directory
71 71 hg purge -p ../untracked_directory
72 72 hg purge -v ../untracked_directory
73 73 cd ..
74 74 ls
75 75 ls directory/untracked_file
76 76 rm directory/untracked_file
77 77
78 78 echo % skip ignored files if --all not specified
79 79 touch ignored
80 80 hg purge -p
81 81 hg purge -v
82 82 ls
83 83 hg purge -p --all
84 84 hg purge -v --all
85 85 ls
86 86
87 87 echo % abort with missing files until we support name mangling filesystems
88 88 touch untracked_file
89 89 rm r1
90 90 # hide error messages to avoid changing the output when the text changes
91 91 hg purge -p 2> /dev/null
92 92 hg st
93 93
94 94 hg purge -p
95 95 hg purge -v 2> /dev/null
96 96 hg st
97 97
98 98 hg purge -v
99 99 hg revert --all --quiet
100 100 hg st -a
101 101
102 102 echo '% tracked file in ignored directory (issue621)'
103 103 echo directory >> .hgignore
104 104 hg ci -m 'ignore directory'
105 105 touch untracked_file
106 106 hg purge -p
107 107 hg purge -v
108 108
109 109 echo % skip excluded files
110 110 touch excluded_file
111 111 hg purge -p -X excluded_file
112 112 hg purge -v -X excluded_file
113 113 ls
114 114 rm excluded_file
115 115
116 116 echo % skip files in excluded dirs
117 117 mkdir excluded_dir
118 118 touch excluded_dir/file
119 119 hg purge -p -X excluded_dir
120 120 hg purge -v -X excluded_dir
121 121 ls
122 122 ls excluded_dir
123 123 rm -R excluded_dir
124 124
125 125 echo % skip excluded empty dirs
126 126 mkdir excluded_dir
127 127 hg purge -p -X excluded_dir
128 128 hg purge -v -X excluded_dir
129 129 ls
130 130 rmdir excluded_dir
131 131
132 132 echo % skip patterns
133 133 mkdir .svn
134 134 touch .svn/foo
135 135 mkdir directory/.svn
136 136 touch directory/.svn/foo
137 137 hg purge -p -X .svn -X '*/.svn'
138 138 hg purge -p -X re:.*.svn
General Comments 0
You need to be logged in to leave comments. Login now