Show More
@@ -1,207 +1,258 | |||||
1 | # remotenames.py - extension to display remotenames |
|
1 | # remotenames.py - extension to display remotenames | |
2 | # |
|
2 | # | |
3 | # Copyright 2017 Augie Fackler <raf@durin42.com> |
|
3 | # Copyright 2017 Augie Fackler <raf@durin42.com> | |
4 | # Copyright 2017 Sean Farley <sean@farley.io> |
|
4 | # Copyright 2017 Sean Farley <sean@farley.io> | |
5 | # |
|
5 | # | |
6 | # This software may be used and distributed according to the terms of the |
|
6 | # This software may be used and distributed according to the terms of the | |
7 | # GNU General Public License version 2 or any later version. |
|
7 | # GNU General Public License version 2 or any later version. | |
8 |
|
8 | |||
9 | """ showing remotebookmarks and remotebranches in UI |
|
9 | """ showing remotebookmarks and remotebranches in UI | |
10 |
|
10 | |||
11 | By default both remotebookmarks and remotebranches are turned on. Config knob to |
|
11 | By default both remotebookmarks and remotebranches are turned on. Config knob to | |
12 | control the individually are as follows. |
|
12 | control the individually are as follows. | |
13 |
|
13 | |||
14 | Config options to tweak the default behaviour: |
|
14 | Config options to tweak the default behaviour: | |
15 |
|
15 | |||
16 | remotenames.bookmarks |
|
16 | remotenames.bookmarks | |
17 | Boolean value to enable or disable showing of remotebookmarks |
|
17 | Boolean value to enable or disable showing of remotebookmarks | |
18 |
|
18 | |||
19 | remotenames.branches |
|
19 | remotenames.branches | |
20 | Boolean value to enable or disable showing of remotebranches |
|
20 | Boolean value to enable or disable showing of remotebranches | |
21 | """ |
|
21 | """ | |
22 |
|
22 | |||
23 | from __future__ import absolute_import |
|
23 | from __future__ import absolute_import | |
24 |
|
24 | |||
25 | import UserDict |
|
25 | import UserDict | |
26 |
|
26 | |||
27 | from mercurial.node import ( |
|
27 | from mercurial.node import ( | |
28 | bin, |
|
28 | bin, | |
29 | ) |
|
29 | ) | |
30 | from mercurial import ( |
|
30 | from mercurial import ( | |
31 | logexchange, |
|
31 | logexchange, | |
32 | namespaces, |
|
32 | namespaces, | |
|
33 | pycompat, | |||
33 | registrar, |
|
34 | registrar, | |
|
35 | templatekw, | |||
34 | ) |
|
36 | ) | |
35 |
|
37 | |||
36 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
|
38 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | |
37 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
39 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | |
38 | # be specifying the version(s) of Mercurial they are tested with, or |
|
40 | # be specifying the version(s) of Mercurial they are tested with, or | |
39 | # leave the attribute unspecified. |
|
41 | # leave the attribute unspecified. | |
40 | testedwith = 'ships-with-hg-core' |
|
42 | testedwith = 'ships-with-hg-core' | |
41 |
|
43 | |||
42 | configtable = {} |
|
44 | configtable = {} | |
43 | configitem = registrar.configitem(configtable) |
|
45 | configitem = registrar.configitem(configtable) | |
|
46 | templatekeyword = registrar.templatekeyword() | |||
44 |
|
47 | |||
45 | configitem('remotenames', 'bookmarks', |
|
48 | configitem('remotenames', 'bookmarks', | |
46 | default=True, |
|
49 | default=True, | |
47 | ) |
|
50 | ) | |
48 | configitem('remotenames', 'branches', |
|
51 | configitem('remotenames', 'branches', | |
49 | default=True, |
|
52 | default=True, | |
50 | ) |
|
53 | ) | |
51 |
|
54 | |||
52 | class lazyremotenamedict(UserDict.DictMixin): |
|
55 | class lazyremotenamedict(UserDict.DictMixin): | |
53 | """ |
|
56 | """ | |
54 | Read-only dict-like Class to lazily resolve remotename entries |
|
57 | Read-only dict-like Class to lazily resolve remotename entries | |
55 |
|
58 | |||
56 | We are doing that because remotenames startup was slow. |
|
59 | We are doing that because remotenames startup was slow. | |
57 | We lazily read the remotenames file once to figure out the potential entries |
|
60 | We lazily read the remotenames file once to figure out the potential entries | |
58 | and store them in self.potentialentries. Then when asked to resolve an |
|
61 | and store them in self.potentialentries. Then when asked to resolve an | |
59 | entry, if it is not in self.potentialentries, then it isn't there, if it |
|
62 | entry, if it is not in self.potentialentries, then it isn't there, if it | |
60 | is in self.potentialentries we resolve it and store the result in |
|
63 | is in self.potentialentries we resolve it and store the result in | |
61 | self.cache. We cannot be lazy is when asked all the entries (keys). |
|
64 | self.cache. We cannot be lazy is when asked all the entries (keys). | |
62 | """ |
|
65 | """ | |
63 | def __init__(self, kind, repo): |
|
66 | def __init__(self, kind, repo): | |
64 | self.cache = {} |
|
67 | self.cache = {} | |
65 | self.potentialentries = {} |
|
68 | self.potentialentries = {} | |
66 | self._kind = kind # bookmarks or branches |
|
69 | self._kind = kind # bookmarks or branches | |
67 | self._repo = repo |
|
70 | self._repo = repo | |
68 | self.loaded = False |
|
71 | self.loaded = False | |
69 |
|
72 | |||
70 | def _load(self): |
|
73 | def _load(self): | |
71 | """ Read the remotenames file, store entries matching selected kind """ |
|
74 | """ Read the remotenames file, store entries matching selected kind """ | |
72 | self.loaded = True |
|
75 | self.loaded = True | |
73 | repo = self._repo |
|
76 | repo = self._repo | |
74 | for node, rpath, rname in logexchange.readremotenamefile(repo, |
|
77 | for node, rpath, rname in logexchange.readremotenamefile(repo, | |
75 | self._kind): |
|
78 | self._kind): | |
76 | name = rpath + '/' + rname |
|
79 | name = rpath + '/' + rname | |
77 | self.potentialentries[name] = (node, rpath, name) |
|
80 | self.potentialentries[name] = (node, rpath, name) | |
78 |
|
81 | |||
79 | def _resolvedata(self, potentialentry): |
|
82 | def _resolvedata(self, potentialentry): | |
80 | """ Check that the node for potentialentry exists and return it """ |
|
83 | """ Check that the node for potentialentry exists and return it """ | |
81 | if not potentialentry in self.potentialentries: |
|
84 | if not potentialentry in self.potentialentries: | |
82 | return None |
|
85 | return None | |
83 | node, remote, name = self.potentialentries[potentialentry] |
|
86 | node, remote, name = self.potentialentries[potentialentry] | |
84 | repo = self._repo |
|
87 | repo = self._repo | |
85 | binnode = bin(node) |
|
88 | binnode = bin(node) | |
86 | # if the node doesn't exist, skip it |
|
89 | # if the node doesn't exist, skip it | |
87 | try: |
|
90 | try: | |
88 | repo.changelog.rev(binnode) |
|
91 | repo.changelog.rev(binnode) | |
89 | except LookupError: |
|
92 | except LookupError: | |
90 | return None |
|
93 | return None | |
91 | # Skip closed branches |
|
94 | # Skip closed branches | |
92 | if (self._kind == 'branches' and repo[binnode].closesbranch()): |
|
95 | if (self._kind == 'branches' and repo[binnode].closesbranch()): | |
93 | return None |
|
96 | return None | |
94 | return [binnode] |
|
97 | return [binnode] | |
95 |
|
98 | |||
96 | def __getitem__(self, key): |
|
99 | def __getitem__(self, key): | |
97 | if not self.loaded: |
|
100 | if not self.loaded: | |
98 | self._load() |
|
101 | self._load() | |
99 | val = self._fetchandcache(key) |
|
102 | val = self._fetchandcache(key) | |
100 | if val is not None: |
|
103 | if val is not None: | |
101 | return val |
|
104 | return val | |
102 | else: |
|
105 | else: | |
103 | raise KeyError() |
|
106 | raise KeyError() | |
104 |
|
107 | |||
105 | def _fetchandcache(self, key): |
|
108 | def _fetchandcache(self, key): | |
106 | if key in self.cache: |
|
109 | if key in self.cache: | |
107 | return self.cache[key] |
|
110 | return self.cache[key] | |
108 | val = self._resolvedata(key) |
|
111 | val = self._resolvedata(key) | |
109 | if val is not None: |
|
112 | if val is not None: | |
110 | self.cache[key] = val |
|
113 | self.cache[key] = val | |
111 | return val |
|
114 | return val | |
112 | else: |
|
115 | else: | |
113 | return None |
|
116 | return None | |
114 |
|
117 | |||
115 | def keys(self): |
|
118 | def keys(self): | |
116 | """ Get a list of bookmark or branch names """ |
|
119 | """ Get a list of bookmark or branch names """ | |
117 | if not self.loaded: |
|
120 | if not self.loaded: | |
118 | self._load() |
|
121 | self._load() | |
119 | return self.potentialentries.keys() |
|
122 | return self.potentialentries.keys() | |
120 |
|
123 | |||
121 | def iteritems(self): |
|
124 | def iteritems(self): | |
122 | """ Iterate over (name, node) tuples """ |
|
125 | """ Iterate over (name, node) tuples """ | |
123 |
|
126 | |||
124 | if not self.loaded: |
|
127 | if not self.loaded: | |
125 | self._load() |
|
128 | self._load() | |
126 |
|
129 | |||
127 | for k, vtup in self.potentialentries.iteritems(): |
|
130 | for k, vtup in self.potentialentries.iteritems(): | |
128 | yield (k, [bin(vtup[0])]) |
|
131 | yield (k, [bin(vtup[0])]) | |
129 |
|
132 | |||
130 | class remotenames(dict): |
|
133 | class remotenames(dict): | |
131 | """ |
|
134 | """ | |
132 | This class encapsulates all the remotenames state. It also contains |
|
135 | This class encapsulates all the remotenames state. It also contains | |
133 | methods to access that state in convenient ways. Remotenames are lazy |
|
136 | methods to access that state in convenient ways. Remotenames are lazy | |
134 | loaded. Whenever client code needs to ensure the freshest copy of |
|
137 | loaded. Whenever client code needs to ensure the freshest copy of | |
135 | remotenames, use the `clearnames` method to force an eventual load. |
|
138 | remotenames, use the `clearnames` method to force an eventual load. | |
136 | """ |
|
139 | """ | |
137 |
|
140 | |||
138 | def __init__(self, repo, *args): |
|
141 | def __init__(self, repo, *args): | |
139 | dict.__init__(self, *args) |
|
142 | dict.__init__(self, *args) | |
140 | self._repo = repo |
|
143 | self._repo = repo | |
141 | self.clearnames() |
|
144 | self.clearnames() | |
142 |
|
145 | |||
143 | def clearnames(self): |
|
146 | def clearnames(self): | |
144 | """ Clear all remote names state """ |
|
147 | """ Clear all remote names state """ | |
145 | self['bookmarks'] = lazyremotenamedict("bookmarks", self._repo) |
|
148 | self['bookmarks'] = lazyremotenamedict("bookmarks", self._repo) | |
146 | self['branches'] = lazyremotenamedict("branches", self._repo) |
|
149 | self['branches'] = lazyremotenamedict("branches", self._repo) | |
147 | self._invalidatecache() |
|
150 | self._invalidatecache() | |
148 |
|
151 | |||
149 | def _invalidatecache(self): |
|
152 | def _invalidatecache(self): | |
150 | self._nodetobmarks = None |
|
153 | self._nodetobmarks = None | |
151 | self._nodetobranch = None |
|
154 | self._nodetobranch = None | |
152 |
|
155 | |||
153 | def bmarktonodes(self): |
|
156 | def bmarktonodes(self): | |
154 | return self['bookmarks'] |
|
157 | return self['bookmarks'] | |
155 |
|
158 | |||
156 | def nodetobmarks(self): |
|
159 | def nodetobmarks(self): | |
157 | if not self._nodetobmarks: |
|
160 | if not self._nodetobmarks: | |
158 | bmarktonodes = self.bmarktonodes() |
|
161 | bmarktonodes = self.bmarktonodes() | |
159 | self._nodetobmarks = {} |
|
162 | self._nodetobmarks = {} | |
160 | for name, node in bmarktonodes.iteritems(): |
|
163 | for name, node in bmarktonodes.iteritems(): | |
161 | self._nodetobmarks.setdefault(node[0], []).append(name) |
|
164 | self._nodetobmarks.setdefault(node[0], []).append(name) | |
162 | return self._nodetobmarks |
|
165 | return self._nodetobmarks | |
163 |
|
166 | |||
164 | def branchtonodes(self): |
|
167 | def branchtonodes(self): | |
165 | return self['branches'] |
|
168 | return self['branches'] | |
166 |
|
169 | |||
167 | def nodetobranch(self): |
|
170 | def nodetobranch(self): | |
168 | if not self._nodetobranch: |
|
171 | if not self._nodetobranch: | |
169 | branchtonodes = self.branchtonodes() |
|
172 | branchtonodes = self.branchtonodes() | |
170 | self._nodetobranch = {} |
|
173 | self._nodetobranch = {} | |
171 | for name, nodes in branchtonodes.iteritems(): |
|
174 | for name, nodes in branchtonodes.iteritems(): | |
172 | for node in nodes: |
|
175 | for node in nodes: | |
173 | self._nodetobranch.setdefault(node, []).append(name) |
|
176 | self._nodetobranch.setdefault(node, []).append(name) | |
174 | return self._nodetobranch |
|
177 | return self._nodetobranch | |
175 |
|
178 | |||
176 | def reposetup(ui, repo): |
|
179 | def reposetup(ui, repo): | |
177 | if not repo.local(): |
|
180 | if not repo.local(): | |
178 | return |
|
181 | return | |
179 |
|
182 | |||
180 | repo._remotenames = remotenames(repo) |
|
183 | repo._remotenames = remotenames(repo) | |
181 | ns = namespaces.namespace |
|
184 | ns = namespaces.namespace | |
182 |
|
185 | |||
183 | if ui.configbool('remotenames', 'bookmarks'): |
|
186 | if ui.configbool('remotenames', 'bookmarks'): | |
184 | remotebookmarkns = ns( |
|
187 | remotebookmarkns = ns( | |
185 | 'remotebookmarks', |
|
188 | 'remotebookmarks', | |
186 | templatename='remotebookmarks', |
|
189 | templatename='remotebookmarks', | |
187 | logname='remote bookmark', |
|
190 | logname='remote bookmark', | |
188 | colorname='remotebookmark', |
|
191 | colorname='remotebookmark', | |
189 | listnames=lambda repo: repo._remotenames.bmarktonodes().keys(), |
|
192 | listnames=lambda repo: repo._remotenames.bmarktonodes().keys(), | |
190 | namemap=lambda repo, name: |
|
193 | namemap=lambda repo, name: | |
191 | repo._remotenames.bmarktonodes().get(name, []), |
|
194 | repo._remotenames.bmarktonodes().get(name, []), | |
192 | nodemap=lambda repo, node: |
|
195 | nodemap=lambda repo, node: | |
193 | repo._remotenames.nodetobmarks().get(node, [])) |
|
196 | repo._remotenames.nodetobmarks().get(node, [])) | |
194 | repo.names.addnamespace(remotebookmarkns) |
|
197 | repo.names.addnamespace(remotebookmarkns) | |
195 |
|
198 | |||
196 | if ui.configbool('remotenames', 'branches'): |
|
199 | if ui.configbool('remotenames', 'branches'): | |
197 | remotebranchns = ns( |
|
200 | remotebranchns = ns( | |
198 | 'remotebranches', |
|
201 | 'remotebranches', | |
199 | templatename='remotebranches', |
|
202 | templatename='remotebranches', | |
200 | logname='remote branch', |
|
203 | logname='remote branch', | |
201 | colorname='remotebranch', |
|
204 | colorname='remotebranch', | |
202 | listnames = lambda repo: repo._remotenames.branchtonodes().keys(), |
|
205 | listnames = lambda repo: repo._remotenames.branchtonodes().keys(), | |
203 | namemap = lambda repo, name: |
|
206 | namemap = lambda repo, name: | |
204 | repo._remotenames.branchtonodes().get(name, []), |
|
207 | repo._remotenames.branchtonodes().get(name, []), | |
205 | nodemap = lambda repo, node: |
|
208 | nodemap = lambda repo, node: | |
206 | repo._remotenames.nodetobranch().get(node, [])) |
|
209 | repo._remotenames.nodetobranch().get(node, [])) | |
207 | repo.names.addnamespace(remotebranchns) |
|
210 | repo.names.addnamespace(remotebranchns) | |
|
211 | ||||
|
212 | @templatekeyword('remotenames') | |||
|
213 | def remotenameskw(**args): | |||
|
214 | """:remotenames: List of strings. List of remote names associated with the | |||
|
215 | changeset. | |||
|
216 | """ | |||
|
217 | args = pycompat.byteskwargs(args) | |||
|
218 | repo, ctx = args['repo'], args['ctx'] | |||
|
219 | ||||
|
220 | remotenames = [] | |||
|
221 | if 'remotebookmarks' in repo.names: | |||
|
222 | remotenames = repo.names['remotebookmarks'].names(repo, ctx.node()) | |||
|
223 | ||||
|
224 | if 'remotebranches' in repo.names: | |||
|
225 | remotenames += repo.names['remotebranches'].names(repo, ctx.node()) | |||
|
226 | ||||
|
227 | return templatekw.showlist('remotename', remotenames, args, | |||
|
228 | plural='remotenames') | |||
|
229 | ||||
|
230 | @templatekeyword('remotebookmarks') | |||
|
231 | def remotebookmarkskw(**args): | |||
|
232 | """:remotebookmarks: List of strings. List of remote bookmarks associated | |||
|
233 | with the changeset. | |||
|
234 | """ | |||
|
235 | args = pycompat.byteskwargs(args) | |||
|
236 | repo, ctx = args['repo'], args['ctx'] | |||
|
237 | ||||
|
238 | remotebmarks = [] | |||
|
239 | if 'remotebookmarks' in repo.names: | |||
|
240 | remotebmarks = repo.names['remotebookmarks'].names(repo, ctx.node()) | |||
|
241 | ||||
|
242 | return templatekw.showlist('remotebookmark', remotebmarks, args, | |||
|
243 | plural='remotebookmarks') | |||
|
244 | ||||
|
245 | @templatekeyword('remotebranches') | |||
|
246 | def remotebrancheskw(**args): | |||
|
247 | """:remotebranches: List of strings. List of remote branches associated | |||
|
248 | with the changeset. | |||
|
249 | """ | |||
|
250 | args = pycompat.byteskwargs(args) | |||
|
251 | repo, ctx = args['repo'], args['ctx'] | |||
|
252 | ||||
|
253 | remotebranches = [] | |||
|
254 | if 'remotebranches' in repo.names: | |||
|
255 | remotebranches = repo.names['remotebranches'].names(repo, ctx.node()) | |||
|
256 | ||||
|
257 | return templatekw.showlist('remotebranch', remotebranches, args, | |||
|
258 | plural='remotebranches') |
@@ -1,184 +1,228 | |||||
1 | Testing the functionality to pull remotenames |
|
1 | Testing the functionality to pull remotenames | |
2 | ============================================= |
|
2 | ============================================= | |
3 |
|
3 | |||
4 | $ cat >> $HGRCPATH << EOF |
|
4 | $ cat >> $HGRCPATH << EOF | |
5 | > [alias] |
|
5 | > [alias] | |
6 | > glog = log -G -T '{rev}:{node|short} {desc}' |
|
6 | > glog = log -G -T '{rev}:{node|short} {desc}' | |
7 | > [experimental] |
|
7 | > [experimental] | |
8 | > remotenames = True |
|
8 | > remotenames = True | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > remotenames = |
|
10 | > remotenames = | |
11 | > show = |
|
11 | > show = | |
12 | > EOF |
|
12 | > EOF | |
13 |
|
13 | |||
14 | Making a server repo |
|
14 | Making a server repo | |
15 | -------------------- |
|
15 | -------------------- | |
16 |
|
16 | |||
17 | $ hg init server |
|
17 | $ hg init server | |
18 | $ cd server |
|
18 | $ cd server | |
19 | $ for ch in a b c d e f g h; do |
|
19 | $ for ch in a b c d e f g h; do | |
20 | > echo "foo" >> $ch |
|
20 | > echo "foo" >> $ch | |
21 | > hg ci -Aqm "Added "$ch |
|
21 | > hg ci -Aqm "Added "$ch | |
22 | > done |
|
22 | > done | |
23 | $ hg glog |
|
23 | $ hg glog | |
24 | @ 7:ec2426147f0e Added h |
|
24 | @ 7:ec2426147f0e Added h | |
25 | | |
|
25 | | | |
26 | o 6:87d6d6676308 Added g |
|
26 | o 6:87d6d6676308 Added g | |
27 | | |
|
27 | | | |
28 | o 5:825660c69f0c Added f |
|
28 | o 5:825660c69f0c Added f | |
29 | | |
|
29 | | | |
30 | o 4:aa98ab95a928 Added e |
|
30 | o 4:aa98ab95a928 Added e | |
31 | | |
|
31 | | | |
32 | o 3:62615734edd5 Added d |
|
32 | o 3:62615734edd5 Added d | |
33 | | |
|
33 | | | |
34 | o 2:28ad74487de9 Added c |
|
34 | o 2:28ad74487de9 Added c | |
35 | | |
|
35 | | | |
36 | o 1:29becc82797a Added b |
|
36 | o 1:29becc82797a Added b | |
37 | | |
|
37 | | | |
38 | o 0:18d04c59bb5d Added a |
|
38 | o 0:18d04c59bb5d Added a | |
39 |
|
39 | |||
40 | $ hg bookmark -r 3 foo |
|
40 | $ hg bookmark -r 3 foo | |
41 | $ hg bookmark -r 6 bar |
|
41 | $ hg bookmark -r 6 bar | |
42 | $ hg up 4 |
|
42 | $ hg up 4 | |
43 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
43 | 0 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
44 | $ hg branch wat |
|
44 | $ hg branch wat | |
45 | marked working directory as branch wat |
|
45 | marked working directory as branch wat | |
46 | (branches are permanent and global, did you want a bookmark?) |
|
46 | (branches are permanent and global, did you want a bookmark?) | |
47 | $ echo foo >> bar |
|
47 | $ echo foo >> bar | |
48 | $ hg ci -Aqm "added bar" |
|
48 | $ hg ci -Aqm "added bar" | |
49 |
|
49 | |||
50 | Making a client repo |
|
50 | Making a client repo | |
51 | -------------------- |
|
51 | -------------------- | |
52 |
|
52 | |||
53 | $ cd .. |
|
53 | $ cd .. | |
54 |
|
54 | |||
55 | $ hg clone server client |
|
55 | $ hg clone server client | |
56 | updating to branch default |
|
56 | updating to branch default | |
57 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
57 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 |
|
58 | |||
59 | $ cd client |
|
59 | $ cd client | |
60 | $ cat .hg/logexchange/bookmarks |
|
60 | $ cat .hg/logexchange/bookmarks | |
61 | 0 |
|
61 | 0 | |
62 |
|
62 | |||
63 | 87d6d66763085b629e6d7ed56778c79827273022\x00default\x00bar (esc) |
|
63 | 87d6d66763085b629e6d7ed56778c79827273022\x00default\x00bar (esc) | |
64 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00default\x00foo (esc) |
|
64 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00default\x00foo (esc) | |
65 |
|
65 | |||
66 | $ cat .hg/logexchange/branches |
|
66 | $ cat .hg/logexchange/branches | |
67 | 0 |
|
67 | 0 | |
68 |
|
68 | |||
69 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00default\x00default (esc) |
|
69 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00default\x00default (esc) | |
70 | 3e1487808078543b0af6d10dadf5d46943578db0\x00default\x00wat (esc) |
|
70 | 3e1487808078543b0af6d10dadf5d46943578db0\x00default\x00wat (esc) | |
71 |
|
71 | |||
72 | $ hg show work |
|
72 | $ hg show work | |
73 | o 3e14 (wat) (default/wat) added bar |
|
73 | o 3e14 (wat) (default/wat) added bar | |
74 | | |
|
74 | | | |
75 | ~ |
|
75 | ~ | |
76 | @ ec24 (default/default) Added h |
|
76 | @ ec24 (default/default) Added h | |
77 | | |
|
77 | | | |
78 | ~ |
|
78 | ~ | |
79 |
|
79 | |||
80 | $ hg update "default/wat" |
|
80 | $ hg update "default/wat" | |
81 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved |
|
81 | 1 files updated, 0 files merged, 3 files removed, 0 files unresolved | |
82 | $ hg identify |
|
82 | $ hg identify | |
83 | 3e1487808078 (wat) tip |
|
83 | 3e1487808078 (wat) tip | |
84 |
|
84 | |||
85 | Making a new server |
|
85 | Making a new server | |
86 | ------------------- |
|
86 | ------------------- | |
87 |
|
87 | |||
88 | $ cd .. |
|
88 | $ cd .. | |
89 | $ hg init server2 |
|
89 | $ hg init server2 | |
90 | $ cd server2 |
|
90 | $ cd server2 | |
91 | $ hg pull ../server/ |
|
91 | $ hg pull ../server/ | |
92 | pulling from ../server/ |
|
92 | pulling from ../server/ | |
93 | requesting all changes |
|
93 | requesting all changes | |
94 | adding changesets |
|
94 | adding changesets | |
95 | adding manifests |
|
95 | adding manifests | |
96 | adding file changes |
|
96 | adding file changes | |
97 | added 9 changesets with 9 changes to 9 files (+1 heads) |
|
97 | added 9 changesets with 9 changes to 9 files (+1 heads) | |
98 | adding remote bookmark bar |
|
98 | adding remote bookmark bar | |
99 | adding remote bookmark foo |
|
99 | adding remote bookmark foo | |
100 | new changesets 18d04c59bb5d:3e1487808078 |
|
100 | new changesets 18d04c59bb5d:3e1487808078 | |
101 | (run 'hg heads' to see heads) |
|
101 | (run 'hg heads' to see heads) | |
102 |
|
102 | |||
103 | Pulling form the new server |
|
103 | Pulling form the new server | |
104 | --------------------------- |
|
104 | --------------------------- | |
105 | $ cd ../client/ |
|
105 | $ cd ../client/ | |
106 | $ hg pull ../server2/ |
|
106 | $ hg pull ../server2/ | |
107 | pulling from ../server2/ |
|
107 | pulling from ../server2/ | |
108 | searching for changes |
|
108 | searching for changes | |
109 | no changes found |
|
109 | no changes found | |
110 | $ cat .hg/logexchange/bookmarks |
|
110 | $ cat .hg/logexchange/bookmarks | |
111 | 0 |
|
111 | 0 | |
112 |
|
112 | |||
113 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00default\x00foo (esc) |
|
113 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00default\x00foo (esc) | |
114 | 87d6d66763085b629e6d7ed56778c79827273022\x00default\x00bar (esc) |
|
114 | 87d6d66763085b629e6d7ed56778c79827273022\x00default\x00bar (esc) | |
115 | 87d6d66763085b629e6d7ed56778c79827273022\x00$TESTTMP/server2\x00bar (esc) |
|
115 | 87d6d66763085b629e6d7ed56778c79827273022\x00$TESTTMP/server2\x00bar (esc) | |
116 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00$TESTTMP/server2\x00foo (esc) |
|
116 | 62615734edd52f06b6fb9c2beb429e4fe30d57b8\x00$TESTTMP/server2\x00foo (esc) | |
117 |
|
117 | |||
118 | $ cat .hg/logexchange/branches |
|
118 | $ cat .hg/logexchange/branches | |
119 | 0 |
|
119 | 0 | |
120 |
|
120 | |||
121 | 3e1487808078543b0af6d10dadf5d46943578db0\x00default\x00wat (esc) |
|
121 | 3e1487808078543b0af6d10dadf5d46943578db0\x00default\x00wat (esc) | |
122 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00default\x00default (esc) |
|
122 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00default\x00default (esc) | |
123 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00$TESTTMP/server2\x00default (esc) |
|
123 | ec2426147f0e39dbc9cef599b066be6035ce691d\x00$TESTTMP/server2\x00default (esc) | |
124 | 3e1487808078543b0af6d10dadf5d46943578db0\x00$TESTTMP/server2\x00wat (esc) |
|
124 | 3e1487808078543b0af6d10dadf5d46943578db0\x00$TESTTMP/server2\x00wat (esc) | |
125 |
|
125 | |||
126 | $ hg log -G |
|
126 | $ hg log -G | |
127 | @ changeset: 8:3e1487808078 |
|
127 | @ changeset: 8:3e1487808078 | |
128 | | branch: wat |
|
128 | | branch: wat | |
129 | | tag: tip |
|
129 | | tag: tip | |
130 | | remote branch:$TESTTMP/server2/wat |
|
130 | | remote branch:$TESTTMP/server2/wat | |
131 | | remote branch:default/wat |
|
131 | | remote branch:default/wat | |
132 | | parent: 4:aa98ab95a928 |
|
132 | | parent: 4:aa98ab95a928 | |
133 | | user: test |
|
133 | | user: test | |
134 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
134 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
135 | | summary: added bar |
|
135 | | summary: added bar | |
136 | | |
|
136 | | | |
137 | | o changeset: 7:ec2426147f0e |
|
137 | | o changeset: 7:ec2426147f0e | |
138 | | | remote branch:$TESTTMP/server2/default |
|
138 | | | remote branch:$TESTTMP/server2/default | |
139 | | | remote branch:default/default |
|
139 | | | remote branch:default/default | |
140 | | | user: test |
|
140 | | | user: test | |
141 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
141 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
142 | | | summary: Added h |
|
142 | | | summary: Added h | |
143 | | | |
|
143 | | | | |
144 | | o changeset: 6:87d6d6676308 |
|
144 | | o changeset: 6:87d6d6676308 | |
145 | | | bookmark: bar |
|
145 | | | bookmark: bar | |
146 | | | remote bookmark:$TESTTMP/server2/bar |
|
146 | | | remote bookmark:$TESTTMP/server2/bar | |
147 | | | remote bookmark:default/bar |
|
147 | | | remote bookmark:default/bar | |
148 | | | user: test |
|
148 | | | user: test | |
149 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
149 | | | date: Thu Jan 01 00:00:00 1970 +0000 | |
150 | | | summary: Added g |
|
150 | | | summary: Added g | |
151 | | | |
|
151 | | | | |
152 | | o changeset: 5:825660c69f0c |
|
152 | | o changeset: 5:825660c69f0c | |
153 | |/ user: test |
|
153 | |/ user: test | |
154 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
154 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
155 | | summary: Added f |
|
155 | | summary: Added f | |
156 | | |
|
156 | | | |
157 | o changeset: 4:aa98ab95a928 |
|
157 | o changeset: 4:aa98ab95a928 | |
158 | | user: test |
|
158 | | user: test | |
159 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
159 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
160 | | summary: Added e |
|
160 | | summary: Added e | |
161 | | |
|
161 | | | |
162 | o changeset: 3:62615734edd5 |
|
162 | o changeset: 3:62615734edd5 | |
163 | | bookmark: foo |
|
163 | | bookmark: foo | |
164 | | remote bookmark:$TESTTMP/server2/foo |
|
164 | | remote bookmark:$TESTTMP/server2/foo | |
165 | | remote bookmark:default/foo |
|
165 | | remote bookmark:default/foo | |
166 | | user: test |
|
166 | | user: test | |
167 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
167 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
168 | | summary: Added d |
|
168 | | summary: Added d | |
169 | | |
|
169 | | | |
170 | o changeset: 2:28ad74487de9 |
|
170 | o changeset: 2:28ad74487de9 | |
171 | | user: test |
|
171 | | user: test | |
172 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
172 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
173 | | summary: Added c |
|
173 | | summary: Added c | |
174 | | |
|
174 | | | |
175 | o changeset: 1:29becc82797a |
|
175 | o changeset: 1:29becc82797a | |
176 | | user: test |
|
176 | | user: test | |
177 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
177 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
178 | | summary: Added b |
|
178 | | summary: Added b | |
179 | | |
|
179 | | | |
180 | o changeset: 0:18d04c59bb5d |
|
180 | o changeset: 0:18d04c59bb5d | |
181 | user: test |
|
181 | user: test | |
182 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
182 | date: Thu Jan 01 00:00:00 1970 +0000 | |
183 | summary: Added a |
|
183 | summary: Added a | |
184 |
|
184 | |||
|
185 | Testing the templates provided by remotenames extension | |||
|
186 | ||||
|
187 | `remotenames` keyword | |||
|
188 | ||||
|
189 | $ hg log -G -T "{rev}:{node|short} {remotenames}\n" | |||
|
190 | @ 8:3e1487808078 $TESTTMP/server2/wat default/wat | |||
|
191 | | | |||
|
192 | | o 7:ec2426147f0e $TESTTMP/server2/default default/default | |||
|
193 | | | | |||
|
194 | | o 6:87d6d6676308 $TESTTMP/server2/bar default/bar | |||
|
195 | | | | |||
|
196 | | o 5:825660c69f0c | |||
|
197 | |/ | |||
|
198 | o 4:aa98ab95a928 | |||
|
199 | | | |||
|
200 | o 3:62615734edd5 $TESTTMP/server2/foo default/foo | |||
|
201 | | | |||
|
202 | o 2:28ad74487de9 | |||
|
203 | | | |||
|
204 | o 1:29becc82797a | |||
|
205 | | | |||
|
206 | o 0:18d04c59bb5d | |||
|
207 | ||||
|
208 | `remotebookmarks` and `remotebranches` keywords | |||
|
209 | ||||
|
210 | $ hg log -G -T "{rev}:{node|short} [{remotebookmarks}] ({remotebranches})" | |||
|
211 | @ 8:3e1487808078 [] ($TESTTMP/server2/wat default/wat) | |||
|
212 | | | |||
|
213 | | o 7:ec2426147f0e [] ($TESTTMP/server2/default default/default) | |||
|
214 | | | | |||
|
215 | | o 6:87d6d6676308 [$TESTTMP/server2/bar default/bar] () | |||
|
216 | | | | |||
|
217 | | o 5:825660c69f0c [] () | |||
|
218 | |/ | |||
|
219 | o 4:aa98ab95a928 [] () | |||
|
220 | | | |||
|
221 | o 3:62615734edd5 [$TESTTMP/server2/foo default/foo] () | |||
|
222 | | | |||
|
223 | o 2:28ad74487de9 [] () | |||
|
224 | | | |||
|
225 | o 1:29becc82797a [] () | |||
|
226 | | | |||
|
227 | o 0:18d04c59bb5d [] () | |||
|
228 |
General Comments 0
You need to be logged in to leave comments.
Login now