##// END OF EJS Templates
tests: add globs for Windows
Matt Harbison -
r34693:4c322b95 default
parent child Browse files
Show More
@@ -1,125 +1,125
1 Set up repo
1 Set up repo
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > origbackuppath=.hg/origbackups
5 > origbackuppath=.hg/origbackups
6 > [merge]
6 > [merge]
7 > checkunknown=warn
7 > checkunknown=warn
8 > EOF
8 > EOF
9 $ hg init repo
9 $ hg init repo
10 $ cd repo
10 $ cd repo
11 $ echo base > base
11 $ echo base > base
12 $ hg add base
12 $ hg add base
13 $ hg commit -m "base"
13 $ hg commit -m "base"
14
14
15 Make a dir named b that contains a file
15 Make a dir named b that contains a file
16
16
17 $ mkdir -p b
17 $ mkdir -p b
18 $ echo c1 > b/c
18 $ echo c1 > b/c
19 $ hg add b/c
19 $ hg add b/c
20 $ hg commit -m "c1"
20 $ hg commit -m "c1"
21 $ hg bookmark c1
21 $ hg bookmark c1
22
22
23 Peform an update that causes b/c to be backed up
23 Peform an update that causes b/c to be backed up
24
24
25 $ hg up -q 0
25 $ hg up -q 0
26 $ mkdir -p b
26 $ mkdir -p b
27 $ echo c2 > b/c
27 $ echo c2 > b/c
28 $ hg up --verbose c1
28 $ hg up --verbose c1
29 resolving manifests
29 resolving manifests
30 b/c: replacing untracked file
30 b/c: replacing untracked file
31 getting b/c
31 getting b/c
32 creating directory: $TESTTMP/repo/.hg/origbackups/b
32 creating directory: $TESTTMP/repo/.hg/origbackups/b (glob)
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 (activating bookmark c1)
34 (activating bookmark c1)
35 $ test -f .hg/origbackups/b/c
35 $ test -f .hg/origbackups/b/c
36
36
37 Make a file named b
37 Make a file named b
38
38
39 $ hg up -q 0
39 $ hg up -q 0
40 $ echo b1 > b
40 $ echo b1 > b
41 $ hg add b
41 $ hg add b
42 $ hg commit -m b1
42 $ hg commit -m b1
43 created new head
43 created new head
44 $ hg bookmark b1
44 $ hg bookmark b1
45
45
46 Perform an update that causes b to be backed up - it should replace the backup b dir
46 Perform an update that causes b to be backed up - it should replace the backup b dir
47
47
48 $ hg up -q 0
48 $ hg up -q 0
49 $ echo b2 > b
49 $ echo b2 > b
50 $ hg up --verbose b1
50 $ hg up --verbose b1
51 resolving manifests
51 resolving manifests
52 b: replacing untracked file
52 b: replacing untracked file
53 getting b
53 getting b
54 removing conflicting directory: $TESTTMP/repo/.hg/origbackups/b
54 removing conflicting directory: $TESTTMP/repo/.hg/origbackups/b (glob)
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
56 (activating bookmark b1)
56 (activating bookmark b1)
57 $ test -f .hg/origbackups/b
57 $ test -f .hg/origbackups/b
58
58
59 Perform an update the causes b/c to be backed up again - it should replace the backup b file
59 Perform an update the causes b/c to be backed up again - it should replace the backup b file
60
60
61 $ hg up -q 0
61 $ hg up -q 0
62 $ mkdir b
62 $ mkdir b
63 $ echo c3 > b/c
63 $ echo c3 > b/c
64 $ hg up --verbose c1
64 $ hg up --verbose c1
65 resolving manifests
65 resolving manifests
66 b/c: replacing untracked file
66 b/c: replacing untracked file
67 getting b/c
67 getting b/c
68 creating directory: $TESTTMP/repo/.hg/origbackups/b
68 creating directory: $TESTTMP/repo/.hg/origbackups/b (glob)
69 removing conflicting file: $TESTTMP/repo/.hg/origbackups/b
69 removing conflicting file: $TESTTMP/repo/.hg/origbackups/b (glob)
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 (activating bookmark c1)
71 (activating bookmark c1)
72 $ test -d .hg/origbackups/b
72 $ test -d .hg/origbackups/b
73
73
74 Cause a symlink to be backed up that points to a valid location from the backup dir
74 Cause a symlink to be backed up that points to a valid location from the backup dir
75
75
76 $ hg up -q 0
76 $ hg up -q 0
77 $ mkdir ../sym-link-target
77 $ mkdir ../sym-link-target
78 #if symlink
78 #if symlink
79 $ ln -s ../../../sym-link-target b
79 $ ln -s ../../../sym-link-target b
80 #else
80 #else
81 $ touch b
81 $ touch b
82 #endif
82 #endif
83 $ hg up b1
83 $ hg up b1
84 b: replacing untracked file
84 b: replacing untracked file
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 (activating bookmark b1)
86 (activating bookmark b1)
87 #if symlink
87 #if symlink
88 $ readlink.py .hg/origbackups/b
88 $ readlink.py .hg/origbackups/b
89 .hg/origbackups/b -> ../../../sym-link-target
89 .hg/origbackups/b -> ../../../sym-link-target
90 #endif
90 #endif
91
91
92 Perform an update that causes b/c to be backed up again - it should not go into the target dir
92 Perform an update that causes b/c to be backed up again - it should not go into the target dir
93
93
94 $ hg up -q 0
94 $ hg up -q 0
95 $ mkdir b
95 $ mkdir b
96 $ echo c4 > b/c
96 $ echo c4 > b/c
97 $ hg up --verbose c1
97 $ hg up --verbose c1
98 resolving manifests
98 resolving manifests
99 b/c: replacing untracked file
99 b/c: replacing untracked file
100 getting b/c
100 getting b/c
101 creating directory: $TESTTMP/repo/.hg/origbackups/b
101 creating directory: $TESTTMP/repo/.hg/origbackups/b (glob)
102 removing conflicting file: $TESTTMP/repo/.hg/origbackups/b
102 removing conflicting file: $TESTTMP/repo/.hg/origbackups/b (glob)
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 (activating bookmark c1)
104 (activating bookmark c1)
105 $ cat .hg/origbackups/b/c
105 $ cat .hg/origbackups/b/c
106 c4
106 c4
107 $ ls ../sym-link-target
107 $ ls ../sym-link-target
108
108
109 Incorrectly configure origbackuppath to be under a file
109 Incorrectly configure origbackuppath to be under a file
110
110
111 $ echo data > .hg/badorigbackups
111 $ echo data > .hg/badorigbackups
112 $ hg up -q 0
112 $ hg up -q 0
113 $ mkdir b
113 $ mkdir b
114 $ echo c5 > b/c
114 $ echo c5 > b/c
115 $ hg up --verbose c1 --config ui.origbackuppath=.hg/badorigbackups
115 $ hg up --verbose c1 --config ui.origbackuppath=.hg/badorigbackups
116 resolving manifests
116 resolving manifests
117 b/c: replacing untracked file
117 b/c: replacing untracked file
118 getting b/c
118 getting b/c
119 creating directory: $TESTTMP/repo/.hg/badorigbackups/b
119 creating directory: $TESTTMP/repo/.hg/badorigbackups/b (glob)
120 abort: The system cannot find the path specified: '$TESTTMP/repo/.hg/badorigbackups/b' (glob) (windows !)
120 abort: The system cannot find the path specified: '$TESTTMP/repo/.hg/badorigbackups/b' (glob) (windows !)
121 abort: Not a directory: '$TESTTMP/repo/.hg/badorigbackups/b' (no-windows !)
121 abort: Not a directory: '$TESTTMP/repo/.hg/badorigbackups/b' (no-windows !)
122 [255]
122 [255]
123 $ cat .hg/badorigbackups
123 $ cat .hg/badorigbackups
124 data
124 data
125
125
General Comments 0
You need to be logged in to leave comments. Login now