Mercurial > hg-allpaths
comparison tests/ignore_and_prioritize.t @ 46:e695060c716e
Tests for intended future behaviour of alternative groups and prioritizations
author | Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl> |
---|---|
date | Sun, 25 Sep 2016 09:44:23 +0200 |
parents | a1fb32ff4532 |
children | 00995da9c204 |
comparison
equal
deleted
inserted
replaced
45:237dd8c4fe78 | 46:e695060c716e |
---|---|
1 | 1 |
2 TODO: testing priorities and skips | 2 Let's test all_paths operations. |
3 | |
4 Some locations used during testing: | |
5 | |
6 $ WORK_DIR=${WORK_DIR-`pwd`/work} | |
7 $ rm -rf $WORK_DIR | |
8 | |
9 $ export BASE=$WORK_DIR/base | |
10 $ export REP1=$WORK_DIR/rep1 | |
11 $ export REP2=$WORK_DIR/rep2 | |
12 $ export REP3=$WORK_DIR/rep3 | |
13 | |
14 First we need appropriate Mercurial configuration file (and variable | |
15 which ensures it is used). | |
16 | |
17 $ export HGRCPATH=$WORK_DIR/hgrc | |
18 $ mkdir -p $HGRCPATH | |
19 | |
20 $ cat > $HGRCPATH/basic.rc << EOF | |
21 > [ui] | |
22 > username = Andy Default <default@nowhere.net> | |
23 > [extensions] | |
24 > mercurial_all_paths = | |
25 > [all_paths] | |
26 > ignore = unknown rep2 | |
27 > prioritize = rep3 mystery rep1 | |
28 > EOF | |
29 | |
30 We need some repositories to test. | |
31 | |
32 $ hg init "$BASE" | |
33 $ hg init "$REP1" | |
34 $ hg init "$REP2" | |
35 $ hg init "$REP3" | |
36 | |
37 $ cat > $BASE/.hg/hgrc << EOF | |
38 > [paths] | |
39 > remote1=$REP1 | |
40 > remote2=$REP2 | |
41 > remote3=$REP3 | |
42 > EOF | |
43 | |
44 Let's test pushing | |
45 | |
46 $ cat > $BASE/file.txt << EOF | |
47 > Some text | |
48 > EOF | |
49 | |
50 $ hg --cwd $BASE add | |
51 adding file.txt | |
52 $ hg --cwd $BASE commit -m 'First' | |
53 | |
54 $ hg --cwd $BASE pushall | |
55 pushing to */rep3 (glob) | |
56 searching for changes | |
57 adding changesets | |
58 adding manifests | |
59 adding file changes | |
60 added 1 changesets with 1 changes to 1 files | |
61 | |
62 Skipping ignored rep2 | |
63 | |
64 pushing to */rep1 (glob) | |
65 searching for changes | |
66 adding changesets | |
67 adding manifests | |
68 adding file changes | |
69 added 1 changesets with 1 changes to 1 files | |
70 | |
71 $ hg --cwd $REP1 log -T '{rev}: {desc}\n' | |
72 0: First | |
73 | |
74 $ hg --cwd $REP2 log -T '{rev}: {desc}\n' | |
75 | |
76 $ hg --cwd $REP3 log -T '{rev}: {desc}\n' | |
77 0: First | |
78 | |
79 Let's also test pulling | |
80 | |
81 $ hg --cwd $REP1 update | |
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
83 | |
84 $ cat > $REP1/rep1.txt << EOF | |
85 > Another text | |
86 > EOF | |
87 | |
88 $ hg --cwd $REP1 add | |
89 adding rep1.txt | |
90 $ hg --cwd $REP1 commit -m "In repo1" | |
91 | |
92 | |
93 $ hg --cwd $REP2 update | |
94 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
95 | |
96 $ cat >> $REP2/file.txt << EOF | |
97 > From repo2… | |
98 > EOF | |
99 | |
100 $ hg --cwd $REP2 add | |
101 $ hg --cwd $REP2 commit -m "In repo2" | |
102 | |
103 $ hg --cwd $BASE incomingall | |
104 comparing with */rep3 (glob) | |
105 searching for changes | |
106 no changes found | |
107 | |
108 Skipping ignored rep2 | |
109 | |
110 comparing with */rep1 (glob) | |
111 searching for changes | |
112 changeset: 1:* (glob) | |
113 tag: tip | |
114 user: Andy Default <default@nowhere.net> | |
115 date: .* (re) | |
116 summary: In repo1 | |
117 | |
118 $ hg --cwd $BASE pullall | |
119 pulling from */rep3 (glob) | |
120 searching for changes | |
121 no changes found | |
122 | |
123 Skipping ignored rep2 | |
124 | |
125 pulling from */rep1 (glob) | |
126 searching for changes | |
127 adding changesets | |
128 adding manifests | |
129 adding file changes | |
130 added 1 changesets with 1 changes to 1 files | |
131 (run 'hg update' to get a working copy) | |
132 | |
133 $ hg --cwd $BASE log -T '{rev}: {desc}\n' | |
134 1: In repo1 | |
135 0: First | |
136 | |
137 $ hg --cwd $BASE outgoingall | |
138 comparing with */rep1 (glob) | |
139 searching for changes | |
140 changeset: 2:.* (re) | |
141 tag: tip | |
142 parent: 0:.* (re) | |
143 user: Andy Default <default@nowhere.net> | |
144 date: .* (re) | |
145 summary: In repo2 | |
146 | |
147 Skipping ignored rep2 | |
148 | |
149 comparing with */rep3 (glob) | |
150 searching for changes | |
151 changeset: 1:* (glob) | |
152 user: Andy Default <default@nowhere.net> | |
153 date: .* (re) | |
154 summary: In repo1 | |
155 | |
156 changeset: 2:* (glob) | |
157 tag: tip | |
158 parent: 0:* (glob) | |
159 user: Andy Default <default@nowhere.net> | |
160 date: .* (re) | |
161 summary: In repo2 | |
162 | |
163 |