Show More
@@ -0,0 +1,104 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | createrepo() { | |||
|
4 | rm -rf repo | |||
|
5 | hg init repo | |||
|
6 | cd repo | |||
|
7 | ||||
|
8 | echo "a" > a | |||
|
9 | hg commit -d '0 0' -A -m 'A' | |||
|
10 | ||||
|
11 | hg branch branch1 | |||
|
12 | hg commit -d '1 0' -m 'Branch1' | |||
|
13 | ||||
|
14 | echo "b" > b | |||
|
15 | hg commit -A -d '2 0' -m 'B' | |||
|
16 | ||||
|
17 | hg up 0 | |||
|
18 | hg branch branch2 | |||
|
19 | hg commit -d '3 0' -m 'Branch2' | |||
|
20 | ||||
|
21 | echo "c" > C | |||
|
22 | hg commit -A -d '4 0' -m 'C' | |||
|
23 | ||||
|
24 | hg up 2 | |||
|
25 | hg branch -f branch2 | |||
|
26 | echo "d" > d | |||
|
27 | hg commit -A -d '5 0' -m 'D' | |||
|
28 | ||||
|
29 | echo "e" > e | |||
|
30 | hg commit -A -d '6 0' -m 'E' | |||
|
31 | ||||
|
32 | hg update default | |||
|
33 | ||||
|
34 | hg branch branch3 | |||
|
35 | hg commit -d '7 0' -m 'Branch3' | |||
|
36 | ||||
|
37 | echo "f" > f | |||
|
38 | hg commit -A -d '8 0' -m 'F' | |||
|
39 | } | |||
|
40 | ||||
|
41 | echo | |||
|
42 | createrepo > /dev/null 2>&1 | |||
|
43 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
44 | ||||
|
45 | echo | |||
|
46 | echo '% Branches' | |||
|
47 | hg branches | |||
|
48 | ||||
|
49 | echo | |||
|
50 | echo '% Heads' | |||
|
51 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
52 | ||||
|
53 | echo | |||
|
54 | echo '% Rebase part of branch2 (5-6) onto branch3 (8)' | |||
|
55 | hg --config extensions.hgext.rebase= rebase --detach -s 5 -d 8 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |||
|
56 | ||||
|
57 | echo | |||
|
58 | echo '% Branches' | |||
|
59 | hg branches | |||
|
60 | ||||
|
61 | echo | |||
|
62 | echo '% Heads' | |||
|
63 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
64 | ||||
|
65 | echo | |||
|
66 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
67 | ||||
|
68 | echo | |||
|
69 | echo '% Rebase head of branch3 (8) onto branch2 (6)' | |||
|
70 | createrepo > /dev/null 2>&1 | |||
|
71 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
72 | ||||
|
73 | hg --config extensions.hgext.rebase= rebase --detach -s 8 -d 6 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |||
|
74 | ||||
|
75 | echo | |||
|
76 | echo '% Branches' | |||
|
77 | hg branches | |||
|
78 | ||||
|
79 | echo | |||
|
80 | echo '% Heads' | |||
|
81 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
82 | ||||
|
83 | echo | |||
|
84 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
85 | hg verify -q | |||
|
86 | ||||
|
87 | echo | |||
|
88 | echo '% Rebase entire branch3 (7-8) onto branch2 (6)' | |||
|
89 | createrepo > /dev/null 2>&1 | |||
|
90 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
91 | ||||
|
92 | hg --config extensions.hgext.rebase= rebase --detach -s 7 -d 6 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |||
|
93 | ||||
|
94 | echo | |||
|
95 | echo '% Branches' | |||
|
96 | hg branches | |||
|
97 | ||||
|
98 | echo | |||
|
99 | echo '% Heads' | |||
|
100 | hg heads --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
101 | ||||
|
102 | echo | |||
|
103 | hg --config extensions.hgext.graphlog= glog --template '{rev}:{node|short} {desc} branch: {branches}\n' | |||
|
104 | hg verify -q |
@@ -0,0 +1,186 b'' | |||||
|
1 | ||||
|
2 | @ 8:c11d5b3e9c00 F branch: branch3 | |||
|
3 | | | |||
|
4 | o 7:33c9da881988 Branch3 branch: branch3 | |||
|
5 | | | |||
|
6 | | o 6:0e4064ab11a3 E branch: branch2 | |||
|
7 | | | | |||
|
8 | | o 5:5ac035cb5d8f D branch: branch2 | |||
|
9 | | | | |||
|
10 | | | o 4:8e66061486ee C branch: branch2 | |||
|
11 | | | | | |||
|
12 | +---o 3:99567862abbe Branch2 branch: branch2 | |||
|
13 | | | | |||
|
14 | | o 2:65a26a4d12f6 B branch: branch1 | |||
|
15 | | | | |||
|
16 | | o 1:0f3f3010ee16 Branch1 branch: branch1 | |||
|
17 | |/ | |||
|
18 | o 0:1994f17a630e A branch: | |||
|
19 | ||||
|
20 | ||||
|
21 | % Branches | |||
|
22 | branch3 8:c11d5b3e9c00 | |||
|
23 | branch2 6:0e4064ab11a3 | |||
|
24 | branch1 2:65a26a4d12f6 (inactive) | |||
|
25 | default 0:1994f17a630e (inactive) | |||
|
26 | ||||
|
27 | % Heads | |||
|
28 | 8:c11d5b3e9c00 F branch: branch3 | |||
|
29 | 6:0e4064ab11a3 E branch: branch2 | |||
|
30 | 4:8e66061486ee C branch: branch2 | |||
|
31 | 2:65a26a4d12f6 B branch: branch1 | |||
|
32 | 0:1994f17a630e A branch: | |||
|
33 | ||||
|
34 | % Rebase part of branch2 (5-6) onto branch3 (8) | |||
|
35 | saving bundle to | |||
|
36 | adding branch | |||
|
37 | adding changesets | |||
|
38 | adding manifests | |||
|
39 | adding file changes | |||
|
40 | added 4 changesets with 3 changes to 3 files (+1 heads) | |||
|
41 | rebase completed | |||
|
42 | ||||
|
43 | % Branches | |||
|
44 | branch3 8:c9bfa9beb84e | |||
|
45 | branch2 4:8e66061486ee | |||
|
46 | branch1 2:65a26a4d12f6 | |||
|
47 | default 0:1994f17a630e (inactive) | |||
|
48 | ||||
|
49 | % Heads | |||
|
50 | 8:c9bfa9beb84e E branch: branch3 | |||
|
51 | 4:8e66061486ee C branch: branch2 | |||
|
52 | 2:65a26a4d12f6 B branch: branch1 | |||
|
53 | 0:1994f17a630e A branch: | |||
|
54 | ||||
|
55 | @ 8:c9bfa9beb84e E branch: branch3 | |||
|
56 | | | |||
|
57 | o 7:bf9037384081 D branch: branch3 | |||
|
58 | | | |||
|
59 | o 6:c11d5b3e9c00 F branch: branch3 | |||
|
60 | | | |||
|
61 | o 5:33c9da881988 Branch3 branch: branch3 | |||
|
62 | | | |||
|
63 | | o 4:8e66061486ee C branch: branch2 | |||
|
64 | | | | |||
|
65 | | o 3:99567862abbe Branch2 branch: branch2 | |||
|
66 | |/ | |||
|
67 | | o 2:65a26a4d12f6 B branch: branch1 | |||
|
68 | | | | |||
|
69 | | o 1:0f3f3010ee16 Branch1 branch: branch1 | |||
|
70 | |/ | |||
|
71 | o 0:1994f17a630e A branch: | |||
|
72 | ||||
|
73 | ||||
|
74 | % Rebase head of branch3 (8) onto branch2 (6) | |||
|
75 | @ 8:c11d5b3e9c00 F branch: branch3 | |||
|
76 | | | |||
|
77 | o 7:33c9da881988 Branch3 branch: branch3 | |||
|
78 | | | |||
|
79 | | o 6:0e4064ab11a3 E branch: branch2 | |||
|
80 | | | | |||
|
81 | | o 5:5ac035cb5d8f D branch: branch2 | |||
|
82 | | | | |||
|
83 | | | o 4:8e66061486ee C branch: branch2 | |||
|
84 | | | | | |||
|
85 | +---o 3:99567862abbe Branch2 branch: branch2 | |||
|
86 | | | | |||
|
87 | | o 2:65a26a4d12f6 B branch: branch1 | |||
|
88 | | | | |||
|
89 | | o 1:0f3f3010ee16 Branch1 branch: branch1 | |||
|
90 | |/ | |||
|
91 | o 0:1994f17a630e A branch: | |||
|
92 | ||||
|
93 | saving bundle to | |||
|
94 | adding branch | |||
|
95 | adding changesets | |||
|
96 | adding manifests | |||
|
97 | adding file changes | |||
|
98 | added 1 changesets with 1 changes to 1 files | |||
|
99 | rebase completed | |||
|
100 | ||||
|
101 | % Branches | |||
|
102 | branch2 8:b44d3024f247 | |||
|
103 | branch3 7:33c9da881988 | |||
|
104 | branch1 2:65a26a4d12f6 (inactive) | |||
|
105 | default 0:1994f17a630e (inactive) | |||
|
106 | ||||
|
107 | % Heads | |||
|
108 | 8:b44d3024f247 F branch: branch2 | |||
|
109 | 7:33c9da881988 Branch3 branch: branch3 | |||
|
110 | 4:8e66061486ee C branch: branch2 | |||
|
111 | 2:65a26a4d12f6 B branch: branch1 | |||
|
112 | 0:1994f17a630e A branch: | |||
|
113 | ||||
|
114 | @ 8:b44d3024f247 F branch: branch2 | |||
|
115 | | | |||
|
116 | | o 7:33c9da881988 Branch3 branch: branch3 | |||
|
117 | | | | |||
|
118 | o | 6:0e4064ab11a3 E branch: branch2 | |||
|
119 | | | | |||
|
120 | o | 5:5ac035cb5d8f D branch: branch2 | |||
|
121 | | | | |||
|
122 | | | o 4:8e66061486ee C branch: branch2 | |||
|
123 | | | | | |||
|
124 | | | o 3:99567862abbe Branch2 branch: branch2 | |||
|
125 | | |/ | |||
|
126 | o | 2:65a26a4d12f6 B branch: branch1 | |||
|
127 | | | | |||
|
128 | o | 1:0f3f3010ee16 Branch1 branch: branch1 | |||
|
129 | |/ | |||
|
130 | o 0:1994f17a630e A branch: | |||
|
131 | ||||
|
132 | ||||
|
133 | % Rebase entire branch3 (7-8) onto branch2 (6) | |||
|
134 | @ 8:c11d5b3e9c00 F branch: branch3 | |||
|
135 | | | |||
|
136 | o 7:33c9da881988 Branch3 branch: branch3 | |||
|
137 | | | |||
|
138 | | o 6:0e4064ab11a3 E branch: branch2 | |||
|
139 | | | | |||
|
140 | | o 5:5ac035cb5d8f D branch: branch2 | |||
|
141 | | | | |||
|
142 | | | o 4:8e66061486ee C branch: branch2 | |||
|
143 | | | | | |||
|
144 | +---o 3:99567862abbe Branch2 branch: branch2 | |||
|
145 | | | | |||
|
146 | | o 2:65a26a4d12f6 B branch: branch1 | |||
|
147 | | | | |||
|
148 | | o 1:0f3f3010ee16 Branch1 branch: branch1 | |||
|
149 | |/ | |||
|
150 | o 0:1994f17a630e A branch: | |||
|
151 | ||||
|
152 | saving bundle to | |||
|
153 | adding branch | |||
|
154 | adding changesets | |||
|
155 | adding manifests | |||
|
156 | adding file changes | |||
|
157 | added 1 changesets with 1 changes to 1 files | |||
|
158 | rebase completed | |||
|
159 | ||||
|
160 | % Branches | |||
|
161 | branch2 7:b44d3024f247 | |||
|
162 | branch1 2:65a26a4d12f6 (inactive) | |||
|
163 | default 0:1994f17a630e (inactive) | |||
|
164 | ||||
|
165 | % Heads | |||
|
166 | 7:b44d3024f247 F branch: branch2 | |||
|
167 | 4:8e66061486ee C branch: branch2 | |||
|
168 | 2:65a26a4d12f6 B branch: branch1 | |||
|
169 | 0:1994f17a630e A branch: | |||
|
170 | ||||
|
171 | @ 7:b44d3024f247 F branch: branch2 | |||
|
172 | | | |||
|
173 | o 6:0e4064ab11a3 E branch: branch2 | |||
|
174 | | | |||
|
175 | o 5:5ac035cb5d8f D branch: branch2 | |||
|
176 | | | |||
|
177 | | o 4:8e66061486ee C branch: branch2 | |||
|
178 | | | | |||
|
179 | | o 3:99567862abbe Branch2 branch: branch2 | |||
|
180 | | | | |||
|
181 | o | 2:65a26a4d12f6 B branch: branch1 | |||
|
182 | | | | |||
|
183 | o | 1:0f3f3010ee16 Branch1 branch: branch1 | |||
|
184 | |/ | |||
|
185 | o 0:1994f17a630e A branch: | |||
|
186 |
@@ -622,16 +622,19 b' class localrepository(repo.repository):' | |||||
622 | finally: |
|
622 | finally: | |
623 | release(lock, wlock) |
|
623 | release(lock, wlock) | |
624 |
|
624 | |||
625 | def invalidate(self): |
|
625 | def invalidatecaches(self): | |
626 | for a in "changelog manifest".split(): |
|
|||
627 | if a in self.__dict__: |
|
|||
628 | delattr(self, a) |
|
|||
629 | self._tags = None |
|
626 | self._tags = None | |
630 | self._tagtypes = None |
|
627 | self._tagtypes = None | |
631 | self.nodetagscache = None |
|
628 | self.nodetagscache = None | |
632 | self._branchcache = None # in UTF-8 |
|
629 | self._branchcache = None # in UTF-8 | |
633 | self._branchcachetip = None |
|
630 | self._branchcachetip = None | |
634 |
|
631 | |||
|
632 | def invalidate(self): | |||
|
633 | for a in "changelog manifest".split(): | |||
|
634 | if a in self.__dict__: | |||
|
635 | delattr(self, a) | |||
|
636 | self.invalidatecaches() | |||
|
637 | ||||
635 | def _lock(self, lockname, wait, releasefn, acquirefn, desc): |
|
638 | def _lock(self, lockname, wait, releasefn, acquirefn, desc): | |
636 | try: |
|
639 | try: | |
637 | l = lock.lock(lockname, 0, releasefn, desc=desc) |
|
640 | l = lock.lock(lockname, 0, releasefn, desc=desc) | |
@@ -957,7 +960,7 b' class localrepository(repo.repository):' | |||||
957 | # head, refresh the tag cache, then immediately add a new head. |
|
960 | # head, refresh the tag cache, then immediately add a new head. | |
958 | # But I think doing it this way is necessary for the "instant |
|
961 | # But I think doing it this way is necessary for the "instant | |
959 | # tag cache retrieval" case to work. |
|
962 | # tag cache retrieval" case to work. | |
960 | tags_.findglobaltags(self.ui, self, {}, {}) |
|
963 | self.invalidatecaches() | |
961 |
|
964 | |||
962 | def walk(self, match, node=None): |
|
965 | def walk(self, match, node=None): | |
963 | ''' |
|
966 | ''' |
General Comments 0
You need to be logged in to leave comments.
Login now