Show More
@@ -1,163 +1,163 b'' | |||||
1 | #testcases flat tree |
|
1 | #testcases flat tree | |
2 |
|
2 | |||
3 | $ . "$TESTDIR/narrow-library.sh" |
|
3 | $ . "$TESTDIR/narrow-library.sh" | |
4 |
|
4 | |||
5 | #if tree |
|
5 | #if tree | |
6 | $ cat << EOF >> $HGRCPATH |
|
6 | $ cat << EOF >> $HGRCPATH | |
7 | > [experimental] |
|
7 | > [experimental] | |
8 | > treemanifest = 1 |
|
8 | > treemanifest = 1 | |
9 | > EOF |
|
9 | > EOF | |
10 | #endif |
|
10 | #endif | |
11 |
|
11 | |||
12 | create full repo |
|
12 | create full repo | |
13 |
|
13 | |||
14 | $ hg init master |
|
14 | $ hg init master | |
15 | $ cd master |
|
15 | $ cd master | |
16 | $ cat >> .hg/hgrc <<EOF |
|
16 | $ cat >> .hg/hgrc <<EOF | |
17 | > [narrow] |
|
17 | > [narrow] | |
18 | > serveellipses=True |
|
18 | > serveellipses=True | |
19 | > EOF |
|
19 | > EOF | |
20 |
|
20 | |||
21 | $ mkdir inside |
|
21 | $ mkdir inside | |
22 | $ echo inside > inside/f1 |
|
22 | $ echo inside > inside/f1 | |
23 | $ mkdir outside |
|
23 | $ mkdir outside | |
24 | $ echo outside > outside/f1 |
|
24 | $ echo outside > outside/f1 | |
25 | $ hg ci -Aqm 'initial' |
|
25 | $ hg ci -Aqm 'initial' | |
26 |
|
26 | |||
27 | $ echo modified > inside/f1 |
|
27 | $ echo modified > inside/f1 | |
28 | $ hg ci -qm 'modify inside' |
|
28 | $ hg ci -qm 'modify inside' | |
29 |
|
29 | |||
30 | $ hg co -q 0 |
|
30 | $ hg co -q 0 | |
31 | $ echo modified > outside/f1 |
|
31 | $ echo modified > outside/f1 | |
32 | $ hg ci -qm 'modify outside' |
|
32 | $ hg ci -qm 'modify outside' | |
33 |
|
33 | |||
34 | $ echo modified again >> outside/f1 |
|
34 | $ echo modified again >> outside/f1 | |
35 | $ hg ci -qm 'modify outside again' |
|
35 | $ hg ci -qm 'modify outside again' | |
36 |
|
36 | |||
37 | $ cd .. |
|
37 | $ cd .. | |
38 |
|
38 | |||
39 | $ hg clone --narrow ssh://user@dummy/master narrow --include inside |
|
39 | $ hg clone --narrow ssh://user@dummy/master narrow --include inside | |
40 | requesting all changes |
|
40 | requesting all changes | |
41 | adding changesets |
|
41 | adding changesets | |
42 | adding manifests |
|
42 | adding manifests | |
43 | adding file changes |
|
43 | adding file changes | |
44 | added 3 changesets with 2 changes to 1 files (+1 heads) |
|
44 | added 3 changesets with 2 changes to 1 files (+1 heads) | |
45 | new changesets *:* (glob) |
|
45 | new changesets *:* (glob) | |
46 | updating to branch default |
|
46 | updating to branch default | |
47 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
47 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
48 | $ cd narrow |
|
48 | $ cd narrow | |
49 | $ cat >> $HGRCPATH <<EOF |
|
49 | $ cat >> $HGRCPATH <<EOF | |
50 | > [extensions] |
|
50 | > [extensions] | |
51 | > strip= |
|
51 | > strip= | |
52 | > EOF |
|
52 | > EOF | |
53 |
|
53 | |||
54 | Can strip and recover changesets affecting only files within narrow spec |
|
54 | Can strip and recover changesets affecting only files within narrow spec | |
55 |
|
55 | |||
56 | $ hg co -r 'desc("modify inside")' |
|
56 | $ hg co -r 'desc("modify inside")' | |
57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
57 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 |
$ rm -f |
|
58 | $ rm -f .hg/strip-backup/*-backup.hg | |
59 | $ hg strip . |
|
59 | $ hg strip . | |
60 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
60 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
61 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) |
|
61 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) | |
62 | $ hg unbundle .hg/strip-backup/*-backup.hg |
|
62 | $ hg unbundle .hg/strip-backup/*-backup.hg | |
63 | adding changesets |
|
63 | adding changesets | |
64 | adding manifests |
|
64 | adding manifests | |
65 | adding file changes |
|
65 | adding file changes | |
66 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
66 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
67 | new changesets * (glob) |
|
67 | new changesets * (glob) | |
68 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
68 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
69 |
|
69 | |||
70 | Can strip and recover changesets affecting files outside of narrow spec |
|
70 | Can strip and recover changesets affecting files outside of narrow spec | |
71 |
|
71 | |||
72 | $ hg co -r 'desc("modify outside")' |
|
72 | $ hg co -r 'desc("modify outside")' | |
73 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
73 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
74 | $ hg log -G -T '{rev} {desc}\n' |
|
74 | $ hg log -G -T '{rev} {desc}\n' | |
75 | o 2 modify inside |
|
75 | o 2 modify inside | |
76 | | |
|
76 | | | |
77 | | @ 1 modify outside again |
|
77 | | @ 1 modify outside again | |
78 | |/ |
|
78 | |/ | |
79 | o 0 initial |
|
79 | o 0 initial | |
80 |
|
80 | |||
81 | $ hg debugdata -m 1 |
|
81 | $ hg debugdata -m 1 | |
82 | inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !) |
|
82 | inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !) | |
83 | outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !) |
|
83 | outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !) | |
84 | inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !) |
|
84 | inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !) | |
85 | outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !) |
|
85 | outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !) | |
86 |
|
86 | |||
87 |
$ rm -f |
|
87 | $ rm -f .hg/strip-backup/*-backup.hg | |
88 | $ hg strip . |
|
88 | $ hg strip . | |
89 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
89 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
90 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) |
|
90 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) | |
91 | $ hg unbundle .hg/strip-backup/*-backup.hg |
|
91 | $ hg unbundle .hg/strip-backup/*-backup.hg | |
92 | adding changesets |
|
92 | adding changesets | |
93 | adding manifests |
|
93 | adding manifests | |
94 | adding file changes |
|
94 | adding file changes | |
95 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
95 | added 1 changesets with 0 changes to 0 files (+1 heads) | |
96 | new changesets * (glob) |
|
96 | new changesets * (glob) | |
97 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
97 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
98 | $ hg log -G -T '{rev} {desc}\n' |
|
98 | $ hg log -G -T '{rev} {desc}\n' | |
99 | o 2 modify outside again |
|
99 | o 2 modify outside again | |
100 | | |
|
100 | | | |
101 | | o 1 modify inside |
|
101 | | o 1 modify inside | |
102 | |/ |
|
102 | |/ | |
103 | @ 0 initial |
|
103 | @ 0 initial | |
104 |
|
104 | |||
105 | Check that hash of file outside narrow spec got restored |
|
105 | Check that hash of file outside narrow spec got restored | |
106 | $ hg debugdata -m 2 |
|
106 | $ hg debugdata -m 2 | |
107 | inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !) |
|
107 | inside/f1\x004d6a634d5ba06331a60c29ee0db8412490a54fcd (esc) (flat !) | |
108 | outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !) |
|
108 | outside/f1\x0084ba604d54dee1f13310ce3d4ac2e8a36636691a (esc) (flat !) | |
109 | inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !) |
|
109 | inside\x006a8bc41df94075d501f9740587a0c0e13c170dc5t (esc) (tree !) | |
110 | outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !) |
|
110 | outside\x00255c2627ebdd3c7dcaa6945246f9b9f02bd45a09t (esc) (tree !) | |
111 |
|
111 | |||
112 | Also verify we can apply the bundle with 'hg pull': |
|
112 | Also verify we can apply the bundle with 'hg pull': | |
113 | $ hg co -r 'desc("modify inside")' |
|
113 | $ hg co -r 'desc("modify inside")' | |
114 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
114 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
115 | $ rm .hg/strip-backup/*-backup.hg |
|
115 | $ rm .hg/strip-backup/*-backup.hg | |
116 | $ hg strip . |
|
116 | $ hg strip . | |
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) |
|
118 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) | |
119 | $ hg pull .hg/strip-backup/*-backup.hg |
|
119 | $ hg pull .hg/strip-backup/*-backup.hg | |
120 | pulling from .hg/strip-backup/*-backup.hg (glob) |
|
120 | pulling from .hg/strip-backup/*-backup.hg (glob) | |
121 | searching for changes |
|
121 | searching for changes | |
122 | adding changesets |
|
122 | adding changesets | |
123 | adding manifests |
|
123 | adding manifests | |
124 | adding file changes |
|
124 | adding file changes | |
125 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
125 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
126 | new changesets * (glob) |
|
126 | new changesets * (glob) | |
127 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
127 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
128 |
|
128 | |||
129 | $ rm .hg/strip-backup/*-backup.hg |
|
129 | $ rm .hg/strip-backup/*-backup.hg | |
130 | $ hg strip 0 |
|
130 | $ hg strip 0 | |
131 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
131 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
132 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) |
|
132 | saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) | |
133 | $ hg incoming .hg/strip-backup/*-backup.hg |
|
133 | $ hg incoming .hg/strip-backup/*-backup.hg | |
134 | comparing with .hg/strip-backup/*-backup.hg (glob) |
|
134 | comparing with .hg/strip-backup/*-backup.hg (glob) | |
135 | changeset: 0:* (glob) |
|
135 | changeset: 0:* (glob) | |
136 | user: test |
|
136 | user: test | |
137 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
137 | date: Thu Jan 01 00:00:00 1970 +0000 | |
138 | summary: initial |
|
138 | summary: initial | |
139 |
|
139 | |||
140 | changeset: 1:9e48d953700d (flat !) |
|
140 | changeset: 1:9e48d953700d (flat !) | |
141 | changeset: 1:3888164bccf0 (tree !) |
|
141 | changeset: 1:3888164bccf0 (tree !) | |
142 | user: test |
|
142 | user: test | |
143 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
143 | date: Thu Jan 01 00:00:00 1970 +0000 | |
144 | summary: modify outside again |
|
144 | summary: modify outside again | |
145 |
|
145 | |||
146 | changeset: 2:f505d5e96aa8 (flat !) |
|
146 | changeset: 2:f505d5e96aa8 (flat !) | |
147 | changeset: 2:40b66f95a209 (tree !) |
|
147 | changeset: 2:40b66f95a209 (tree !) | |
148 | tag: tip |
|
148 | tag: tip | |
149 | parent: 0:a99f4d53924d (flat !) |
|
149 | parent: 0:a99f4d53924d (flat !) | |
150 | parent: 0:c2a5fabcca3c (tree !) |
|
150 | parent: 0:c2a5fabcca3c (tree !) | |
151 | user: test |
|
151 | user: test | |
152 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
152 | date: Thu Jan 01 00:00:00 1970 +0000 | |
153 | summary: modify inside |
|
153 | summary: modify inside | |
154 |
|
154 | |||
155 | $ hg pull .hg/strip-backup/*-backup.hg |
|
155 | $ hg pull .hg/strip-backup/*-backup.hg | |
156 | pulling from .hg/strip-backup/*-backup.hg (glob) |
|
156 | pulling from .hg/strip-backup/*-backup.hg (glob) | |
157 | requesting all changes |
|
157 | requesting all changes | |
158 | adding changesets |
|
158 | adding changesets | |
159 | adding manifests |
|
159 | adding manifests | |
160 | adding file changes |
|
160 | adding file changes | |
161 | added 3 changesets with 2 changes to 1 files (+1 heads) |
|
161 | added 3 changesets with 2 changes to 1 files (+1 heads) | |
162 | new changesets *:* (glob) |
|
162 | new changesets *:* (glob) | |
163 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
163 | (run 'hg heads' to see heads, 'hg merge' to merge) |
General Comments 0
You need to be logged in to leave comments.
Login now