##// END OF EJS Templates
revlog: fix a regression with null revision...
Alexander Plavin -
r19060:c010cb6f default
parent child Browse files
Show More
@@ -1,1344 +1,1340 b''
1 # revlog.py - storage back-end for mercurial
1 # revlog.py - storage back-end for mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 """Storage back-end for Mercurial.
8 """Storage back-end for Mercurial.
9
9
10 This provides efficient delta storage with O(1) retrieve and append
10 This provides efficient delta storage with O(1) retrieve and append
11 and O(changes) merge between branches.
11 and O(changes) merge between branches.
12 """
12 """
13
13
14 # import stuff from node for others to import from revlog
14 # import stuff from node for others to import from revlog
15 from node import bin, hex, nullid, nullrev
15 from node import bin, hex, nullid, nullrev
16 from i18n import _
16 from i18n import _
17 import ancestor, mdiff, parsers, error, util, dagutil
17 import ancestor, mdiff, parsers, error, util, dagutil
18 import struct, zlib, errno
18 import struct, zlib, errno
19
19
20 _pack = struct.pack
20 _pack = struct.pack
21 _unpack = struct.unpack
21 _unpack = struct.unpack
22 _compress = zlib.compress
22 _compress = zlib.compress
23 _decompress = zlib.decompress
23 _decompress = zlib.decompress
24 _sha = util.sha1
24 _sha = util.sha1
25
25
26 # revlog header flags
26 # revlog header flags
27 REVLOGV0 = 0
27 REVLOGV0 = 0
28 REVLOGNG = 1
28 REVLOGNG = 1
29 REVLOGNGINLINEDATA = (1 << 16)
29 REVLOGNGINLINEDATA = (1 << 16)
30 REVLOGGENERALDELTA = (1 << 17)
30 REVLOGGENERALDELTA = (1 << 17)
31 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
31 REVLOG_DEFAULT_FLAGS = REVLOGNGINLINEDATA
32 REVLOG_DEFAULT_FORMAT = REVLOGNG
32 REVLOG_DEFAULT_FORMAT = REVLOGNG
33 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
33 REVLOG_DEFAULT_VERSION = REVLOG_DEFAULT_FORMAT | REVLOG_DEFAULT_FLAGS
34 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGGENERALDELTA
34 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGGENERALDELTA
35
35
36 # revlog index flags
36 # revlog index flags
37 REVIDX_KNOWN_FLAGS = 0
37 REVIDX_KNOWN_FLAGS = 0
38
38
39 # max size of revlog with inline data
39 # max size of revlog with inline data
40 _maxinline = 131072
40 _maxinline = 131072
41 _chunksize = 1048576
41 _chunksize = 1048576
42
42
43 RevlogError = error.RevlogError
43 RevlogError = error.RevlogError
44 LookupError = error.LookupError
44 LookupError = error.LookupError
45
45
46 def getoffset(q):
46 def getoffset(q):
47 return int(q >> 16)
47 return int(q >> 16)
48
48
49 def gettype(q):
49 def gettype(q):
50 return int(q & 0xFFFF)
50 return int(q & 0xFFFF)
51
51
52 def offset_type(offset, type):
52 def offset_type(offset, type):
53 return long(long(offset) << 16 | type)
53 return long(long(offset) << 16 | type)
54
54
55 nullhash = _sha(nullid)
55 nullhash = _sha(nullid)
56
56
57 def hash(text, p1, p2):
57 def hash(text, p1, p2):
58 """generate a hash from the given text and its parent hashes
58 """generate a hash from the given text and its parent hashes
59
59
60 This hash combines both the current file contents and its history
60 This hash combines both the current file contents and its history
61 in a manner that makes it easy to distinguish nodes with the same
61 in a manner that makes it easy to distinguish nodes with the same
62 content in the revision graph.
62 content in the revision graph.
63 """
63 """
64 # As of now, if one of the parent node is null, p2 is null
64 # As of now, if one of the parent node is null, p2 is null
65 if p2 == nullid:
65 if p2 == nullid:
66 # deep copy of a hash is faster than creating one
66 # deep copy of a hash is faster than creating one
67 s = nullhash.copy()
67 s = nullhash.copy()
68 s.update(p1)
68 s.update(p1)
69 else:
69 else:
70 # none of the parent nodes are nullid
70 # none of the parent nodes are nullid
71 l = [p1, p2]
71 l = [p1, p2]
72 l.sort()
72 l.sort()
73 s = _sha(l[0])
73 s = _sha(l[0])
74 s.update(l[1])
74 s.update(l[1])
75 s.update(text)
75 s.update(text)
76 return s.digest()
76 return s.digest()
77
77
78 def decompress(bin):
78 def decompress(bin):
79 """ decompress the given input """
79 """ decompress the given input """
80 if not bin:
80 if not bin:
81 return bin
81 return bin
82 t = bin[0]
82 t = bin[0]
83 if t == '\0':
83 if t == '\0':
84 return bin
84 return bin
85 if t == 'x':
85 if t == 'x':
86 try:
86 try:
87 return _decompress(bin)
87 return _decompress(bin)
88 except zlib.error, e:
88 except zlib.error, e:
89 raise RevlogError(_("revlog decompress error: %s") % str(e))
89 raise RevlogError(_("revlog decompress error: %s") % str(e))
90 if t == 'u':
90 if t == 'u':
91 return bin[1:]
91 return bin[1:]
92 raise RevlogError(_("unknown compression type %r") % t)
92 raise RevlogError(_("unknown compression type %r") % t)
93
93
94 # index v0:
94 # index v0:
95 # 4 bytes: offset
95 # 4 bytes: offset
96 # 4 bytes: compressed length
96 # 4 bytes: compressed length
97 # 4 bytes: base rev
97 # 4 bytes: base rev
98 # 4 bytes: link rev
98 # 4 bytes: link rev
99 # 32 bytes: parent 1 nodeid
99 # 32 bytes: parent 1 nodeid
100 # 32 bytes: parent 2 nodeid
100 # 32 bytes: parent 2 nodeid
101 # 32 bytes: nodeid
101 # 32 bytes: nodeid
102 indexformatv0 = ">4l20s20s20s"
102 indexformatv0 = ">4l20s20s20s"
103 v0shaoffset = 56
103 v0shaoffset = 56
104
104
105 class revlogoldio(object):
105 class revlogoldio(object):
106 def __init__(self):
106 def __init__(self):
107 self.size = struct.calcsize(indexformatv0)
107 self.size = struct.calcsize(indexformatv0)
108
108
109 def parseindex(self, data, inline):
109 def parseindex(self, data, inline):
110 s = self.size
110 s = self.size
111 index = []
111 index = []
112 nodemap = {nullid: nullrev}
112 nodemap = {nullid: nullrev}
113 n = off = 0
113 n = off = 0
114 l = len(data)
114 l = len(data)
115 while off + s <= l:
115 while off + s <= l:
116 cur = data[off:off + s]
116 cur = data[off:off + s]
117 off += s
117 off += s
118 e = _unpack(indexformatv0, cur)
118 e = _unpack(indexformatv0, cur)
119 # transform to revlogv1 format
119 # transform to revlogv1 format
120 e2 = (offset_type(e[0], 0), e[1], -1, e[2], e[3],
120 e2 = (offset_type(e[0], 0), e[1], -1, e[2], e[3],
121 nodemap.get(e[4], nullrev), nodemap.get(e[5], nullrev), e[6])
121 nodemap.get(e[4], nullrev), nodemap.get(e[5], nullrev), e[6])
122 index.append(e2)
122 index.append(e2)
123 nodemap[e[6]] = n
123 nodemap[e[6]] = n
124 n += 1
124 n += 1
125
125
126 # add the magic null revision at -1
126 # add the magic null revision at -1
127 index.append((0, 0, 0, -1, -1, -1, -1, nullid))
127 index.append((0, 0, 0, -1, -1, -1, -1, nullid))
128
128
129 return index, nodemap, None
129 return index, nodemap, None
130
130
131 def packentry(self, entry, node, version, rev):
131 def packentry(self, entry, node, version, rev):
132 if gettype(entry[0]):
132 if gettype(entry[0]):
133 raise RevlogError(_("index entry flags need RevlogNG"))
133 raise RevlogError(_("index entry flags need RevlogNG"))
134 e2 = (getoffset(entry[0]), entry[1], entry[3], entry[4],
134 e2 = (getoffset(entry[0]), entry[1], entry[3], entry[4],
135 node(entry[5]), node(entry[6]), entry[7])
135 node(entry[5]), node(entry[6]), entry[7])
136 return _pack(indexformatv0, *e2)
136 return _pack(indexformatv0, *e2)
137
137
138 # index ng:
138 # index ng:
139 # 6 bytes: offset
139 # 6 bytes: offset
140 # 2 bytes: flags
140 # 2 bytes: flags
141 # 4 bytes: compressed length
141 # 4 bytes: compressed length
142 # 4 bytes: uncompressed length
142 # 4 bytes: uncompressed length
143 # 4 bytes: base rev
143 # 4 bytes: base rev
144 # 4 bytes: link rev
144 # 4 bytes: link rev
145 # 4 bytes: parent 1 rev
145 # 4 bytes: parent 1 rev
146 # 4 bytes: parent 2 rev
146 # 4 bytes: parent 2 rev
147 # 32 bytes: nodeid
147 # 32 bytes: nodeid
148 indexformatng = ">Qiiiiii20s12x"
148 indexformatng = ">Qiiiiii20s12x"
149 ngshaoffset = 32
149 ngshaoffset = 32
150 versionformat = ">I"
150 versionformat = ">I"
151
151
152 class revlogio(object):
152 class revlogio(object):
153 def __init__(self):
153 def __init__(self):
154 self.size = struct.calcsize(indexformatng)
154 self.size = struct.calcsize(indexformatng)
155
155
156 def parseindex(self, data, inline):
156 def parseindex(self, data, inline):
157 # call the C implementation to parse the index data
157 # call the C implementation to parse the index data
158 index, cache = parsers.parse_index2(data, inline)
158 index, cache = parsers.parse_index2(data, inline)
159 return index, getattr(index, 'nodemap', None), cache
159 return index, getattr(index, 'nodemap', None), cache
160
160
161 def packentry(self, entry, node, version, rev):
161 def packentry(self, entry, node, version, rev):
162 p = _pack(indexformatng, *entry)
162 p = _pack(indexformatng, *entry)
163 if rev == 0:
163 if rev == 0:
164 p = _pack(versionformat, version) + p[4:]
164 p = _pack(versionformat, version) + p[4:]
165 return p
165 return p
166
166
167 class revlog(object):
167 class revlog(object):
168 """
168 """
169 the underlying revision storage object
169 the underlying revision storage object
170
170
171 A revlog consists of two parts, an index and the revision data.
171 A revlog consists of two parts, an index and the revision data.
172
172
173 The index is a file with a fixed record size containing
173 The index is a file with a fixed record size containing
174 information on each revision, including its nodeid (hash), the
174 information on each revision, including its nodeid (hash), the
175 nodeids of its parents, the position and offset of its data within
175 nodeids of its parents, the position and offset of its data within
176 the data file, and the revision it's based on. Finally, each entry
176 the data file, and the revision it's based on. Finally, each entry
177 contains a linkrev entry that can serve as a pointer to external
177 contains a linkrev entry that can serve as a pointer to external
178 data.
178 data.
179
179
180 The revision data itself is a linear collection of data chunks.
180 The revision data itself is a linear collection of data chunks.
181 Each chunk represents a revision and is usually represented as a
181 Each chunk represents a revision and is usually represented as a
182 delta against the previous chunk. To bound lookup time, runs of
182 delta against the previous chunk. To bound lookup time, runs of
183 deltas are limited to about 2 times the length of the original
183 deltas are limited to about 2 times the length of the original
184 version data. This makes retrieval of a version proportional to
184 version data. This makes retrieval of a version proportional to
185 its size, or O(1) relative to the number of revisions.
185 its size, or O(1) relative to the number of revisions.
186
186
187 Both pieces of the revlog are written to in an append-only
187 Both pieces of the revlog are written to in an append-only
188 fashion, which means we never need to rewrite a file to insert or
188 fashion, which means we never need to rewrite a file to insert or
189 remove data, and can use some simple techniques to avoid the need
189 remove data, and can use some simple techniques to avoid the need
190 for locking while reading.
190 for locking while reading.
191 """
191 """
192 def __init__(self, opener, indexfile):
192 def __init__(self, opener, indexfile):
193 """
193 """
194 create a revlog object
194 create a revlog object
195
195
196 opener is a function that abstracts the file opening operation
196 opener is a function that abstracts the file opening operation
197 and can be used to implement COW semantics or the like.
197 and can be used to implement COW semantics or the like.
198 """
198 """
199 self.indexfile = indexfile
199 self.indexfile = indexfile
200 self.datafile = indexfile[:-2] + ".d"
200 self.datafile = indexfile[:-2] + ".d"
201 self.opener = opener
201 self.opener = opener
202 self._cache = None
202 self._cache = None
203 self._basecache = (0, 0)
203 self._basecache = (0, 0)
204 self._chunkcache = (0, '')
204 self._chunkcache = (0, '')
205 self.index = []
205 self.index = []
206 self._pcache = {}
206 self._pcache = {}
207 self._nodecache = {nullid: nullrev}
207 self._nodecache = {nullid: nullrev}
208 self._nodepos = None
208 self._nodepos = None
209
209
210 v = REVLOG_DEFAULT_VERSION
210 v = REVLOG_DEFAULT_VERSION
211 opts = getattr(opener, 'options', None)
211 opts = getattr(opener, 'options', None)
212 if opts is not None:
212 if opts is not None:
213 if 'revlogv1' in opts:
213 if 'revlogv1' in opts:
214 if 'generaldelta' in opts:
214 if 'generaldelta' in opts:
215 v |= REVLOGGENERALDELTA
215 v |= REVLOGGENERALDELTA
216 else:
216 else:
217 v = 0
217 v = 0
218
218
219 i = ''
219 i = ''
220 self._initempty = True
220 self._initempty = True
221 try:
221 try:
222 f = self.opener(self.indexfile)
222 f = self.opener(self.indexfile)
223 i = f.read()
223 i = f.read()
224 f.close()
224 f.close()
225 if len(i) > 0:
225 if len(i) > 0:
226 v = struct.unpack(versionformat, i[:4])[0]
226 v = struct.unpack(versionformat, i[:4])[0]
227 self._initempty = False
227 self._initempty = False
228 except IOError, inst:
228 except IOError, inst:
229 if inst.errno != errno.ENOENT:
229 if inst.errno != errno.ENOENT:
230 raise
230 raise
231
231
232 self.version = v
232 self.version = v
233 self._inline = v & REVLOGNGINLINEDATA
233 self._inline = v & REVLOGNGINLINEDATA
234 self._generaldelta = v & REVLOGGENERALDELTA
234 self._generaldelta = v & REVLOGGENERALDELTA
235 flags = v & ~0xFFFF
235 flags = v & ~0xFFFF
236 fmt = v & 0xFFFF
236 fmt = v & 0xFFFF
237 if fmt == REVLOGV0 and flags:
237 if fmt == REVLOGV0 and flags:
238 raise RevlogError(_("index %s unknown flags %#04x for format v0")
238 raise RevlogError(_("index %s unknown flags %#04x for format v0")
239 % (self.indexfile, flags >> 16))
239 % (self.indexfile, flags >> 16))
240 elif fmt == REVLOGNG and flags & ~REVLOGNG_FLAGS:
240 elif fmt == REVLOGNG and flags & ~REVLOGNG_FLAGS:
241 raise RevlogError(_("index %s unknown flags %#04x for revlogng")
241 raise RevlogError(_("index %s unknown flags %#04x for revlogng")
242 % (self.indexfile, flags >> 16))
242 % (self.indexfile, flags >> 16))
243 elif fmt > REVLOGNG:
243 elif fmt > REVLOGNG:
244 raise RevlogError(_("index %s unknown format %d")
244 raise RevlogError(_("index %s unknown format %d")
245 % (self.indexfile, fmt))
245 % (self.indexfile, fmt))
246
246
247 self._io = revlogio()
247 self._io = revlogio()
248 if self.version == REVLOGV0:
248 if self.version == REVLOGV0:
249 self._io = revlogoldio()
249 self._io = revlogoldio()
250 try:
250 try:
251 d = self._io.parseindex(i, self._inline)
251 d = self._io.parseindex(i, self._inline)
252 except (ValueError, IndexError):
252 except (ValueError, IndexError):
253 raise RevlogError(_("index %s is corrupted") % (self.indexfile))
253 raise RevlogError(_("index %s is corrupted") % (self.indexfile))
254 self.index, nodemap, self._chunkcache = d
254 self.index, nodemap, self._chunkcache = d
255 if nodemap is not None:
255 if nodemap is not None:
256 self.nodemap = self._nodecache = nodemap
256 self.nodemap = self._nodecache = nodemap
257 if not self._chunkcache:
257 if not self._chunkcache:
258 self._chunkclear()
258 self._chunkclear()
259
259
260 def tip(self):
260 def tip(self):
261 return self.node(len(self.index) - 2)
261 return self.node(len(self.index) - 2)
262 def __len__(self):
262 def __len__(self):
263 return len(self.index) - 1
263 return len(self.index) - 1
264 def __iter__(self):
264 def __iter__(self):
265 return iter(xrange(len(self)))
265 return iter(xrange(len(self)))
266 def revs(self, start=0, stop=None):
266 def revs(self, start=0, stop=None):
267 """iterate over all rev in this revlog (from start to stop)"""
267 """iterate over all rev in this revlog (from start to stop)"""
268 step = 1
268 step = 1
269 if stop is not None:
269 if stop is not None:
270 if start > stop:
270 if start > stop:
271 step = -1
271 step = -1
272 stop += step
272 stop += step
273 else:
273 else:
274 stop = len(self)
274 stop = len(self)
275 return xrange(start, stop, step)
275 return xrange(start, stop, step)
276
276
277 @util.propertycache
277 @util.propertycache
278 def nodemap(self):
278 def nodemap(self):
279 self.rev(self.node(0))
279 self.rev(self.node(0))
280 return self._nodecache
280 return self._nodecache
281
281
282 def hasnode(self, node):
282 def hasnode(self, node):
283 try:
283 try:
284 self.rev(node)
284 self.rev(node)
285 return True
285 return True
286 except KeyError:
286 except KeyError:
287 return False
287 return False
288
288
289 def clearcaches(self):
289 def clearcaches(self):
290 try:
290 try:
291 self._nodecache.clearcaches()
291 self._nodecache.clearcaches()
292 except AttributeError:
292 except AttributeError:
293 self._nodecache = {nullid: nullrev}
293 self._nodecache = {nullid: nullrev}
294 self._nodepos = None
294 self._nodepos = None
295
295
296 def rev(self, node):
296 def rev(self, node):
297 try:
297 try:
298 return self._nodecache[node]
298 return self._nodecache[node]
299 except RevlogError:
299 except RevlogError:
300 # parsers.c radix tree lookup failed
300 # parsers.c radix tree lookup failed
301 raise LookupError(node, self.indexfile, _('no node'))
301 raise LookupError(node, self.indexfile, _('no node'))
302 except KeyError:
302 except KeyError:
303 # pure python cache lookup failed
303 # pure python cache lookup failed
304 n = self._nodecache
304 n = self._nodecache
305 i = self.index
305 i = self.index
306 p = self._nodepos
306 p = self._nodepos
307 if p is None:
307 if p is None:
308 p = len(i) - 2
308 p = len(i) - 2
309 for r in xrange(p, -1, -1):
309 for r in xrange(p, -1, -1):
310 v = i[r][7]
310 v = i[r][7]
311 n[v] = r
311 n[v] = r
312 if v == node:
312 if v == node:
313 self._nodepos = r - 1
313 self._nodepos = r - 1
314 return r
314 return r
315 raise LookupError(node, self.indexfile, _('no node'))
315 raise LookupError(node, self.indexfile, _('no node'))
316
316
317 def node(self, rev):
317 def node(self, rev):
318 return self.index[rev][7]
318 return self.index[rev][7]
319 def linkrev(self, rev):
319 def linkrev(self, rev):
320 return self.index[rev][4]
320 return self.index[rev][4]
321 def parents(self, node):
321 def parents(self, node):
322 i = self.index
322 i = self.index
323 d = i[self.rev(node)]
323 d = i[self.rev(node)]
324 return i[d[5]][7], i[d[6]][7] # map revisions to nodes inline
324 return i[d[5]][7], i[d[6]][7] # map revisions to nodes inline
325 def parentrevs(self, rev):
325 def parentrevs(self, rev):
326 return self.index[rev][5:7]
326 return self.index[rev][5:7]
327 def start(self, rev):
327 def start(self, rev):
328 return int(self.index[rev][0] >> 16)
328 return int(self.index[rev][0] >> 16)
329 def end(self, rev):
329 def end(self, rev):
330 return self.start(rev) + self.length(rev)
330 return self.start(rev) + self.length(rev)
331 def length(self, rev):
331 def length(self, rev):
332 return self.index[rev][1]
332 return self.index[rev][1]
333 def chainbase(self, rev):
333 def chainbase(self, rev):
334 index = self.index
334 index = self.index
335 base = index[rev][3]
335 base = index[rev][3]
336 while base != rev:
336 while base != rev:
337 rev = base
337 rev = base
338 base = index[rev][3]
338 base = index[rev][3]
339 return base
339 return base
340 def flags(self, rev):
340 def flags(self, rev):
341 return self.index[rev][0] & 0xFFFF
341 return self.index[rev][0] & 0xFFFF
342 def rawsize(self, rev):
342 def rawsize(self, rev):
343 """return the length of the uncompressed text for a given revision"""
343 """return the length of the uncompressed text for a given revision"""
344 l = self.index[rev][2]
344 l = self.index[rev][2]
345 if l >= 0:
345 if l >= 0:
346 return l
346 return l
347
347
348 t = self.revision(self.node(rev))
348 t = self.revision(self.node(rev))
349 return len(t)
349 return len(t)
350 size = rawsize
350 size = rawsize
351
351
352 def ancestors(self, revs, stoprev=0, inclusive=False):
352 def ancestors(self, revs, stoprev=0, inclusive=False):
353 """Generate the ancestors of 'revs' in reverse topological order.
353 """Generate the ancestors of 'revs' in reverse topological order.
354 Does not generate revs lower than stoprev.
354 Does not generate revs lower than stoprev.
355
355
356 See the documentation for ancestor.lazyancestors for more details."""
356 See the documentation for ancestor.lazyancestors for more details."""
357
357
358 return ancestor.lazyancestors(self, revs, stoprev=stoprev,
358 return ancestor.lazyancestors(self, revs, stoprev=stoprev,
359 inclusive=inclusive)
359 inclusive=inclusive)
360
360
361 def descendants(self, revs):
361 def descendants(self, revs):
362 """Generate the descendants of 'revs' in revision order.
362 """Generate the descendants of 'revs' in revision order.
363
363
364 Yield a sequence of revision numbers starting with a child of
364 Yield a sequence of revision numbers starting with a child of
365 some rev in revs, i.e., each revision is *not* considered a
365 some rev in revs, i.e., each revision is *not* considered a
366 descendant of itself. Results are ordered by revision number (a
366 descendant of itself. Results are ordered by revision number (a
367 topological sort)."""
367 topological sort)."""
368 first = min(revs)
368 first = min(revs)
369 if first == nullrev:
369 if first == nullrev:
370 for i in self:
370 for i in self:
371 yield i
371 yield i
372 return
372 return
373
373
374 seen = set(revs)
374 seen = set(revs)
375 for i in self.revs(start=first + 1):
375 for i in self.revs(start=first + 1):
376 for x in self.parentrevs(i):
376 for x in self.parentrevs(i):
377 if x != nullrev and x in seen:
377 if x != nullrev and x in seen:
378 seen.add(i)
378 seen.add(i)
379 yield i
379 yield i
380 break
380 break
381
381
382 def findcommonmissing(self, common=None, heads=None):
382 def findcommonmissing(self, common=None, heads=None):
383 """Return a tuple of the ancestors of common and the ancestors of heads
383 """Return a tuple of the ancestors of common and the ancestors of heads
384 that are not ancestors of common. In revset terminology, we return the
384 that are not ancestors of common. In revset terminology, we return the
385 tuple:
385 tuple:
386
386
387 ::common, (::heads) - (::common)
387 ::common, (::heads) - (::common)
388
388
389 The list is sorted by revision number, meaning it is
389 The list is sorted by revision number, meaning it is
390 topologically sorted.
390 topologically sorted.
391
391
392 'heads' and 'common' are both lists of node IDs. If heads is
392 'heads' and 'common' are both lists of node IDs. If heads is
393 not supplied, uses all of the revlog's heads. If common is not
393 not supplied, uses all of the revlog's heads. If common is not
394 supplied, uses nullid."""
394 supplied, uses nullid."""
395 if common is None:
395 if common is None:
396 common = [nullid]
396 common = [nullid]
397 if heads is None:
397 if heads is None:
398 heads = self.heads()
398 heads = self.heads()
399
399
400 common = [self.rev(n) for n in common]
400 common = [self.rev(n) for n in common]
401 heads = [self.rev(n) for n in heads]
401 heads = [self.rev(n) for n in heads]
402
402
403 # we want the ancestors, but inclusive
403 # we want the ancestors, but inclusive
404 has = set(self.ancestors(common))
404 has = set(self.ancestors(common))
405 has.add(nullrev)
405 has.add(nullrev)
406 has.update(common)
406 has.update(common)
407
407
408 # take all ancestors from heads that aren't in has
408 # take all ancestors from heads that aren't in has
409 missing = set()
409 missing = set()
410 visit = util.deque(r for r in heads if r not in has)
410 visit = util.deque(r for r in heads if r not in has)
411 while visit:
411 while visit:
412 r = visit.popleft()
412 r = visit.popleft()
413 if r in missing:
413 if r in missing:
414 continue
414 continue
415 else:
415 else:
416 missing.add(r)
416 missing.add(r)
417 for p in self.parentrevs(r):
417 for p in self.parentrevs(r):
418 if p not in has:
418 if p not in has:
419 visit.append(p)
419 visit.append(p)
420 missing = list(missing)
420 missing = list(missing)
421 missing.sort()
421 missing.sort()
422 return has, [self.node(r) for r in missing]
422 return has, [self.node(r) for r in missing]
423
423
424 def findmissingrevs(self, common=None, heads=None):
424 def findmissingrevs(self, common=None, heads=None):
425 """Return the revision numbers of the ancestors of heads that
425 """Return the revision numbers of the ancestors of heads that
426 are not ancestors of common.
426 are not ancestors of common.
427
427
428 More specifically, return a list of revision numbers corresponding to
428 More specifically, return a list of revision numbers corresponding to
429 nodes N such that every N satisfies the following constraints:
429 nodes N such that every N satisfies the following constraints:
430
430
431 1. N is an ancestor of some node in 'heads'
431 1. N is an ancestor of some node in 'heads'
432 2. N is not an ancestor of any node in 'common'
432 2. N is not an ancestor of any node in 'common'
433
433
434 The list is sorted by revision number, meaning it is
434 The list is sorted by revision number, meaning it is
435 topologically sorted.
435 topologically sorted.
436
436
437 'heads' and 'common' are both lists of revision numbers. If heads is
437 'heads' and 'common' are both lists of revision numbers. If heads is
438 not supplied, uses all of the revlog's heads. If common is not
438 not supplied, uses all of the revlog's heads. If common is not
439 supplied, uses nullid."""
439 supplied, uses nullid."""
440 if common is None:
440 if common is None:
441 common = [nullrev]
441 common = [nullrev]
442 if heads is None:
442 if heads is None:
443 heads = self.headrevs()
443 heads = self.headrevs()
444
444
445 return ancestor.missingancestors(heads, common, self.parentrevs)
445 return ancestor.missingancestors(heads, common, self.parentrevs)
446
446
447 def findmissing(self, common=None, heads=None):
447 def findmissing(self, common=None, heads=None):
448 """Return the ancestors of heads that are not ancestors of common.
448 """Return the ancestors of heads that are not ancestors of common.
449
449
450 More specifically, return a list of nodes N such that every N
450 More specifically, return a list of nodes N such that every N
451 satisfies the following constraints:
451 satisfies the following constraints:
452
452
453 1. N is an ancestor of some node in 'heads'
453 1. N is an ancestor of some node in 'heads'
454 2. N is not an ancestor of any node in 'common'
454 2. N is not an ancestor of any node in 'common'
455
455
456 The list is sorted by revision number, meaning it is
456 The list is sorted by revision number, meaning it is
457 topologically sorted.
457 topologically sorted.
458
458
459 'heads' and 'common' are both lists of node IDs. If heads is
459 'heads' and 'common' are both lists of node IDs. If heads is
460 not supplied, uses all of the revlog's heads. If common is not
460 not supplied, uses all of the revlog's heads. If common is not
461 supplied, uses nullid."""
461 supplied, uses nullid."""
462 if common is None:
462 if common is None:
463 common = [nullid]
463 common = [nullid]
464 if heads is None:
464 if heads is None:
465 heads = self.heads()
465 heads = self.heads()
466
466
467 common = [self.rev(n) for n in common]
467 common = [self.rev(n) for n in common]
468 heads = [self.rev(n) for n in heads]
468 heads = [self.rev(n) for n in heads]
469
469
470 return [self.node(r) for r in
470 return [self.node(r) for r in
471 ancestor.missingancestors(heads, common, self.parentrevs)]
471 ancestor.missingancestors(heads, common, self.parentrevs)]
472
472
473 def nodesbetween(self, roots=None, heads=None):
473 def nodesbetween(self, roots=None, heads=None):
474 """Return a topological path from 'roots' to 'heads'.
474 """Return a topological path from 'roots' to 'heads'.
475
475
476 Return a tuple (nodes, outroots, outheads) where 'nodes' is a
476 Return a tuple (nodes, outroots, outheads) where 'nodes' is a
477 topologically sorted list of all nodes N that satisfy both of
477 topologically sorted list of all nodes N that satisfy both of
478 these constraints:
478 these constraints:
479
479
480 1. N is a descendant of some node in 'roots'
480 1. N is a descendant of some node in 'roots'
481 2. N is an ancestor of some node in 'heads'
481 2. N is an ancestor of some node in 'heads'
482
482
483 Every node is considered to be both a descendant and an ancestor
483 Every node is considered to be both a descendant and an ancestor
484 of itself, so every reachable node in 'roots' and 'heads' will be
484 of itself, so every reachable node in 'roots' and 'heads' will be
485 included in 'nodes'.
485 included in 'nodes'.
486
486
487 'outroots' is the list of reachable nodes in 'roots', i.e., the
487 'outroots' is the list of reachable nodes in 'roots', i.e., the
488 subset of 'roots' that is returned in 'nodes'. Likewise,
488 subset of 'roots' that is returned in 'nodes'. Likewise,
489 'outheads' is the subset of 'heads' that is also in 'nodes'.
489 'outheads' is the subset of 'heads' that is also in 'nodes'.
490
490
491 'roots' and 'heads' are both lists of node IDs. If 'roots' is
491 'roots' and 'heads' are both lists of node IDs. If 'roots' is
492 unspecified, uses nullid as the only root. If 'heads' is
492 unspecified, uses nullid as the only root. If 'heads' is
493 unspecified, uses list of all of the revlog's heads."""
493 unspecified, uses list of all of the revlog's heads."""
494 nonodes = ([], [], [])
494 nonodes = ([], [], [])
495 if roots is not None:
495 if roots is not None:
496 roots = list(roots)
496 roots = list(roots)
497 if not roots:
497 if not roots:
498 return nonodes
498 return nonodes
499 lowestrev = min([self.rev(n) for n in roots])
499 lowestrev = min([self.rev(n) for n in roots])
500 else:
500 else:
501 roots = [nullid] # Everybody's a descendant of nullid
501 roots = [nullid] # Everybody's a descendant of nullid
502 lowestrev = nullrev
502 lowestrev = nullrev
503 if (lowestrev == nullrev) and (heads is None):
503 if (lowestrev == nullrev) and (heads is None):
504 # We want _all_ the nodes!
504 # We want _all_ the nodes!
505 return ([self.node(r) for r in self], [nullid], list(self.heads()))
505 return ([self.node(r) for r in self], [nullid], list(self.heads()))
506 if heads is None:
506 if heads is None:
507 # All nodes are ancestors, so the latest ancestor is the last
507 # All nodes are ancestors, so the latest ancestor is the last
508 # node.
508 # node.
509 highestrev = len(self) - 1
509 highestrev = len(self) - 1
510 # Set ancestors to None to signal that every node is an ancestor.
510 # Set ancestors to None to signal that every node is an ancestor.
511 ancestors = None
511 ancestors = None
512 # Set heads to an empty dictionary for later discovery of heads
512 # Set heads to an empty dictionary for later discovery of heads
513 heads = {}
513 heads = {}
514 else:
514 else:
515 heads = list(heads)
515 heads = list(heads)
516 if not heads:
516 if not heads:
517 return nonodes
517 return nonodes
518 ancestors = set()
518 ancestors = set()
519 # Turn heads into a dictionary so we can remove 'fake' heads.
519 # Turn heads into a dictionary so we can remove 'fake' heads.
520 # Also, later we will be using it to filter out the heads we can't
520 # Also, later we will be using it to filter out the heads we can't
521 # find from roots.
521 # find from roots.
522 heads = dict.fromkeys(heads, False)
522 heads = dict.fromkeys(heads, False)
523 # Start at the top and keep marking parents until we're done.
523 # Start at the top and keep marking parents until we're done.
524 nodestotag = set(heads)
524 nodestotag = set(heads)
525 # Remember where the top was so we can use it as a limit later.
525 # Remember where the top was so we can use it as a limit later.
526 highestrev = max([self.rev(n) for n in nodestotag])
526 highestrev = max([self.rev(n) for n in nodestotag])
527 while nodestotag:
527 while nodestotag:
528 # grab a node to tag
528 # grab a node to tag
529 n = nodestotag.pop()
529 n = nodestotag.pop()
530 # Never tag nullid
530 # Never tag nullid
531 if n == nullid:
531 if n == nullid:
532 continue
532 continue
533 # A node's revision number represents its place in a
533 # A node's revision number represents its place in a
534 # topologically sorted list of nodes.
534 # topologically sorted list of nodes.
535 r = self.rev(n)
535 r = self.rev(n)
536 if r >= lowestrev:
536 if r >= lowestrev:
537 if n not in ancestors:
537 if n not in ancestors:
538 # If we are possibly a descendant of one of the roots
538 # If we are possibly a descendant of one of the roots
539 # and we haven't already been marked as an ancestor
539 # and we haven't already been marked as an ancestor
540 ancestors.add(n) # Mark as ancestor
540 ancestors.add(n) # Mark as ancestor
541 # Add non-nullid parents to list of nodes to tag.
541 # Add non-nullid parents to list of nodes to tag.
542 nodestotag.update([p for p in self.parents(n) if
542 nodestotag.update([p for p in self.parents(n) if
543 p != nullid])
543 p != nullid])
544 elif n in heads: # We've seen it before, is it a fake head?
544 elif n in heads: # We've seen it before, is it a fake head?
545 # So it is, real heads should not be the ancestors of
545 # So it is, real heads should not be the ancestors of
546 # any other heads.
546 # any other heads.
547 heads.pop(n)
547 heads.pop(n)
548 if not ancestors:
548 if not ancestors:
549 return nonodes
549 return nonodes
550 # Now that we have our set of ancestors, we want to remove any
550 # Now that we have our set of ancestors, we want to remove any
551 # roots that are not ancestors.
551 # roots that are not ancestors.
552
552
553 # If one of the roots was nullid, everything is included anyway.
553 # If one of the roots was nullid, everything is included anyway.
554 if lowestrev > nullrev:
554 if lowestrev > nullrev:
555 # But, since we weren't, let's recompute the lowest rev to not
555 # But, since we weren't, let's recompute the lowest rev to not
556 # include roots that aren't ancestors.
556 # include roots that aren't ancestors.
557
557
558 # Filter out roots that aren't ancestors of heads
558 # Filter out roots that aren't ancestors of heads
559 roots = [n for n in roots if n in ancestors]
559 roots = [n for n in roots if n in ancestors]
560 # Recompute the lowest revision
560 # Recompute the lowest revision
561 if roots:
561 if roots:
562 lowestrev = min([self.rev(n) for n in roots])
562 lowestrev = min([self.rev(n) for n in roots])
563 else:
563 else:
564 # No more roots? Return empty list
564 # No more roots? Return empty list
565 return nonodes
565 return nonodes
566 else:
566 else:
567 # We are descending from nullid, and don't need to care about
567 # We are descending from nullid, and don't need to care about
568 # any other roots.
568 # any other roots.
569 lowestrev = nullrev
569 lowestrev = nullrev
570 roots = [nullid]
570 roots = [nullid]
571 # Transform our roots list into a set.
571 # Transform our roots list into a set.
572 descendants = set(roots)
572 descendants = set(roots)
573 # Also, keep the original roots so we can filter out roots that aren't
573 # Also, keep the original roots so we can filter out roots that aren't
574 # 'real' roots (i.e. are descended from other roots).
574 # 'real' roots (i.e. are descended from other roots).
575 roots = descendants.copy()
575 roots = descendants.copy()
576 # Our topologically sorted list of output nodes.
576 # Our topologically sorted list of output nodes.
577 orderedout = []
577 orderedout = []
578 # Don't start at nullid since we don't want nullid in our output list,
578 # Don't start at nullid since we don't want nullid in our output list,
579 # and if nullid shows up in descendants, empty parents will look like
579 # and if nullid shows up in descendants, empty parents will look like
580 # they're descendants.
580 # they're descendants.
581 for r in self.revs(start=max(lowestrev, 0), stop=highestrev + 1):
581 for r in self.revs(start=max(lowestrev, 0), stop=highestrev + 1):
582 n = self.node(r)
582 n = self.node(r)
583 isdescendant = False
583 isdescendant = False
584 if lowestrev == nullrev: # Everybody is a descendant of nullid
584 if lowestrev == nullrev: # Everybody is a descendant of nullid
585 isdescendant = True
585 isdescendant = True
586 elif n in descendants:
586 elif n in descendants:
587 # n is already a descendant
587 # n is already a descendant
588 isdescendant = True
588 isdescendant = True
589 # This check only needs to be done here because all the roots
589 # This check only needs to be done here because all the roots
590 # will start being marked is descendants before the loop.
590 # will start being marked is descendants before the loop.
591 if n in roots:
591 if n in roots:
592 # If n was a root, check if it's a 'real' root.
592 # If n was a root, check if it's a 'real' root.
593 p = tuple(self.parents(n))
593 p = tuple(self.parents(n))
594 # If any of its parents are descendants, it's not a root.
594 # If any of its parents are descendants, it's not a root.
595 if (p[0] in descendants) or (p[1] in descendants):
595 if (p[0] in descendants) or (p[1] in descendants):
596 roots.remove(n)
596 roots.remove(n)
597 else:
597 else:
598 p = tuple(self.parents(n))
598 p = tuple(self.parents(n))
599 # A node is a descendant if either of its parents are
599 # A node is a descendant if either of its parents are
600 # descendants. (We seeded the dependents list with the roots
600 # descendants. (We seeded the dependents list with the roots
601 # up there, remember?)
601 # up there, remember?)
602 if (p[0] in descendants) or (p[1] in descendants):
602 if (p[0] in descendants) or (p[1] in descendants):
603 descendants.add(n)
603 descendants.add(n)
604 isdescendant = True
604 isdescendant = True
605 if isdescendant and ((ancestors is None) or (n in ancestors)):
605 if isdescendant and ((ancestors is None) or (n in ancestors)):
606 # Only include nodes that are both descendants and ancestors.
606 # Only include nodes that are both descendants and ancestors.
607 orderedout.append(n)
607 orderedout.append(n)
608 if (ancestors is not None) and (n in heads):
608 if (ancestors is not None) and (n in heads):
609 # We're trying to figure out which heads are reachable
609 # We're trying to figure out which heads are reachable
610 # from roots.
610 # from roots.
611 # Mark this head as having been reached
611 # Mark this head as having been reached
612 heads[n] = True
612 heads[n] = True
613 elif ancestors is None:
613 elif ancestors is None:
614 # Otherwise, we're trying to discover the heads.
614 # Otherwise, we're trying to discover the heads.
615 # Assume this is a head because if it isn't, the next step
615 # Assume this is a head because if it isn't, the next step
616 # will eventually remove it.
616 # will eventually remove it.
617 heads[n] = True
617 heads[n] = True
618 # But, obviously its parents aren't.
618 # But, obviously its parents aren't.
619 for p in self.parents(n):
619 for p in self.parents(n):
620 heads.pop(p, None)
620 heads.pop(p, None)
621 heads = [n for n, flag in heads.iteritems() if flag]
621 heads = [n for n, flag in heads.iteritems() if flag]
622 roots = list(roots)
622 roots = list(roots)
623 assert orderedout
623 assert orderedout
624 assert roots
624 assert roots
625 assert heads
625 assert heads
626 return (orderedout, roots, heads)
626 return (orderedout, roots, heads)
627
627
628 def headrevs(self):
628 def headrevs(self):
629 try:
629 try:
630 return self.index.headrevs()
630 return self.index.headrevs()
631 except AttributeError:
631 except AttributeError:
632 return self._headrevs()
632 return self._headrevs()
633
633
634 def _headrevs(self):
634 def _headrevs(self):
635 count = len(self)
635 count = len(self)
636 if not count:
636 if not count:
637 return [nullrev]
637 return [nullrev]
638 # we won't iter over filtered rev so nobody is a head at start
638 # we won't iter over filtered rev so nobody is a head at start
639 ishead = [0] * (count + 1)
639 ishead = [0] * (count + 1)
640 index = self.index
640 index = self.index
641 for r in self:
641 for r in self:
642 ishead[r] = 1 # I may be an head
642 ishead[r] = 1 # I may be an head
643 e = index[r]
643 e = index[r]
644 ishead[e[5]] = ishead[e[6]] = 0 # my parent are not
644 ishead[e[5]] = ishead[e[6]] = 0 # my parent are not
645 return [r for r, val in enumerate(ishead) if val]
645 return [r for r, val in enumerate(ishead) if val]
646
646
647 def heads(self, start=None, stop=None):
647 def heads(self, start=None, stop=None):
648 """return the list of all nodes that have no children
648 """return the list of all nodes that have no children
649
649
650 if start is specified, only heads that are descendants of
650 if start is specified, only heads that are descendants of
651 start will be returned
651 start will be returned
652 if stop is specified, it will consider all the revs from stop
652 if stop is specified, it will consider all the revs from stop
653 as if they had no children
653 as if they had no children
654 """
654 """
655 if start is None and stop is None:
655 if start is None and stop is None:
656 if not len(self):
656 if not len(self):
657 return [nullid]
657 return [nullid]
658 return [self.node(r) for r in self.headrevs()]
658 return [self.node(r) for r in self.headrevs()]
659
659
660 if start is None:
660 if start is None:
661 start = nullid
661 start = nullid
662 if stop is None:
662 if stop is None:
663 stop = []
663 stop = []
664 stoprevs = set([self.rev(n) for n in stop])
664 stoprevs = set([self.rev(n) for n in stop])
665 startrev = self.rev(start)
665 startrev = self.rev(start)
666 reachable = set((startrev,))
666 reachable = set((startrev,))
667 heads = set((startrev,))
667 heads = set((startrev,))
668
668
669 parentrevs = self.parentrevs
669 parentrevs = self.parentrevs
670 for r in self.revs(start=startrev + 1):
670 for r in self.revs(start=startrev + 1):
671 for p in parentrevs(r):
671 for p in parentrevs(r):
672 if p in reachable:
672 if p in reachable:
673 if r not in stoprevs:
673 if r not in stoprevs:
674 reachable.add(r)
674 reachable.add(r)
675 heads.add(r)
675 heads.add(r)
676 if p in heads and p not in stoprevs:
676 if p in heads and p not in stoprevs:
677 heads.remove(p)
677 heads.remove(p)
678
678
679 return [self.node(r) for r in heads]
679 return [self.node(r) for r in heads]
680
680
681 def children(self, node):
681 def children(self, node):
682 """find the children of a given node"""
682 """find the children of a given node"""
683 c = []
683 c = []
684 p = self.rev(node)
684 p = self.rev(node)
685 for r in self.revs(start=p + 1):
685 for r in self.revs(start=p + 1):
686 prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
686 prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
687 if prevs:
687 if prevs:
688 for pr in prevs:
688 for pr in prevs:
689 if pr == p:
689 if pr == p:
690 c.append(self.node(r))
690 c.append(self.node(r))
691 elif p == nullrev:
691 elif p == nullrev:
692 c.append(self.node(r))
692 c.append(self.node(r))
693 return c
693 return c
694
694
695 def descendant(self, start, end):
695 def descendant(self, start, end):
696 if start == nullrev:
696 if start == nullrev:
697 return True
697 return True
698 for i in self.descendants([start]):
698 for i in self.descendants([start]):
699 if i == end:
699 if i == end:
700 return True
700 return True
701 elif i > end:
701 elif i > end:
702 break
702 break
703 return False
703 return False
704
704
705 def ancestor(self, a, b):
705 def ancestor(self, a, b):
706 """calculate the least common ancestor of nodes a and b"""
706 """calculate the least common ancestor of nodes a and b"""
707
707
708 a, b = self.rev(a), self.rev(b)
708 a, b = self.rev(a), self.rev(b)
709 try:
709 try:
710 ancs = self.index.ancestors(a, b)
710 ancs = self.index.ancestors(a, b)
711 except (AttributeError, OverflowError):
711 except (AttributeError, OverflowError):
712 ancs = ancestor.ancestors(self.parentrevs, a, b)
712 ancs = ancestor.ancestors(self.parentrevs, a, b)
713 if ancs:
713 if ancs:
714 # choose a consistent winner when there's a tie
714 # choose a consistent winner when there's a tie
715 return min(map(self.node, ancs))
715 return min(map(self.node, ancs))
716 return nullid
716 return nullid
717
717
718 def _match(self, id):
718 def _match(self, id):
719 if isinstance(id, int):
719 if isinstance(id, int):
720 # rev
720 # rev
721 return self.node(id)
721 return self.node(id)
722 if len(id) == 20:
722 if len(id) == 20:
723 # possibly a binary node
723 # possibly a binary node
724 # odds of a binary node being all hex in ASCII are 1 in 10**25
724 # odds of a binary node being all hex in ASCII are 1 in 10**25
725 try:
725 try:
726 node = id
726 node = id
727 self.rev(node) # quick search the index
727 self.rev(node) # quick search the index
728 return node
728 return node
729 except LookupError:
729 except LookupError:
730 pass # may be partial hex id
730 pass # may be partial hex id
731 try:
731 try:
732 # str(rev)
732 # str(rev)
733 rev = int(id)
733 rev = int(id)
734 if str(rev) != id:
734 if str(rev) != id:
735 raise ValueError
735 raise ValueError
736 if rev < 0:
736 if rev < 0:
737 rev = len(self) + rev
737 rev = len(self) + rev
738 if rev < 0 or rev >= len(self):
738 if rev < 0 or rev >= len(self):
739 raise ValueError
739 raise ValueError
740 return self.node(rev)
740 return self.node(rev)
741 except (ValueError, OverflowError):
741 except (ValueError, OverflowError):
742 pass
742 pass
743 if len(id) == 40:
743 if len(id) == 40:
744 try:
744 try:
745 # a full hex nodeid?
745 # a full hex nodeid?
746 node = bin(id)
746 node = bin(id)
747 self.rev(node)
747 self.rev(node)
748 return node
748 return node
749 except (TypeError, LookupError):
749 except (TypeError, LookupError):
750 pass
750 pass
751
751
752 def _partialmatch(self, id):
752 def _partialmatch(self, id):
753 try:
753 try:
754 return self.index.partialmatch(id)
754 return self.index.partialmatch(id)
755 except RevlogError:
755 except RevlogError:
756 # parsers.c radix tree lookup gave multiple matches
756 # parsers.c radix tree lookup gave multiple matches
757 raise LookupError(id, self.indexfile, _("ambiguous identifier"))
757 raise LookupError(id, self.indexfile, _("ambiguous identifier"))
758 except (AttributeError, ValueError):
758 except (AttributeError, ValueError):
759 # we are pure python, or key was too short to search radix tree
759 # we are pure python, or key was too short to search radix tree
760 pass
760 pass
761
761
762 if id in self._pcache:
762 if id in self._pcache:
763 return self._pcache[id]
763 return self._pcache[id]
764
764
765 if len(id) < 40:
765 if len(id) < 40:
766 try:
766 try:
767 # hex(node)[:...]
767 # hex(node)[:...]
768 l = len(id) // 2 # grab an even number of digits
768 l = len(id) // 2 # grab an even number of digits
769 prefix = bin(id[:l * 2])
769 prefix = bin(id[:l * 2])
770 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
770 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
771 nl = [n for n in nl if hex(n).startswith(id)]
771 nl = [n for n in nl if hex(n).startswith(id)]
772 if len(nl) > 0:
772 if len(nl) > 0:
773 if len(nl) == 1:
773 if len(nl) == 1:
774 if nl[0] == nullid:
775 # dummy null revision always exists,
776 # it shouldn't be returned here
777 return None
778 self._pcache[id] = nl[0]
774 self._pcache[id] = nl[0]
779 return nl[0]
775 return nl[0]
780 raise LookupError(id, self.indexfile,
776 raise LookupError(id, self.indexfile,
781 _('ambiguous identifier'))
777 _('ambiguous identifier'))
782 return None
778 return None
783 except TypeError:
779 except TypeError:
784 pass
780 pass
785
781
786 def lookup(self, id):
782 def lookup(self, id):
787 """locate a node based on:
783 """locate a node based on:
788 - revision number or str(revision number)
784 - revision number or str(revision number)
789 - nodeid or subset of hex nodeid
785 - nodeid or subset of hex nodeid
790 """
786 """
791 n = self._match(id)
787 n = self._match(id)
792 if n is not None:
788 if n is not None:
793 return n
789 return n
794 n = self._partialmatch(id)
790 n = self._partialmatch(id)
795 if n:
791 if n:
796 return n
792 return n
797
793
798 raise LookupError(id, self.indexfile, _('no match found'))
794 raise LookupError(id, self.indexfile, _('no match found'))
799
795
800 def cmp(self, node, text):
796 def cmp(self, node, text):
801 """compare text with a given file revision
797 """compare text with a given file revision
802
798
803 returns True if text is different than what is stored.
799 returns True if text is different than what is stored.
804 """
800 """
805 p1, p2 = self.parents(node)
801 p1, p2 = self.parents(node)
806 return hash(text, p1, p2) != node
802 return hash(text, p1, p2) != node
807
803
808 def _addchunk(self, offset, data):
804 def _addchunk(self, offset, data):
809 o, d = self._chunkcache
805 o, d = self._chunkcache
810 # try to add to existing cache
806 # try to add to existing cache
811 if o + len(d) == offset and len(d) + len(data) < _chunksize:
807 if o + len(d) == offset and len(d) + len(data) < _chunksize:
812 self._chunkcache = o, d + data
808 self._chunkcache = o, d + data
813 else:
809 else:
814 self._chunkcache = offset, data
810 self._chunkcache = offset, data
815
811
816 def _loadchunk(self, offset, length):
812 def _loadchunk(self, offset, length):
817 if self._inline:
813 if self._inline:
818 df = self.opener(self.indexfile)
814 df = self.opener(self.indexfile)
819 else:
815 else:
820 df = self.opener(self.datafile)
816 df = self.opener(self.datafile)
821
817
822 readahead = max(65536, length)
818 readahead = max(65536, length)
823 df.seek(offset)
819 df.seek(offset)
824 d = df.read(readahead)
820 d = df.read(readahead)
825 df.close()
821 df.close()
826 self._addchunk(offset, d)
822 self._addchunk(offset, d)
827 if readahead > length:
823 if readahead > length:
828 return util.buffer(d, 0, length)
824 return util.buffer(d, 0, length)
829 return d
825 return d
830
826
831 def _getchunk(self, offset, length):
827 def _getchunk(self, offset, length):
832 o, d = self._chunkcache
828 o, d = self._chunkcache
833 l = len(d)
829 l = len(d)
834
830
835 # is it in the cache?
831 # is it in the cache?
836 cachestart = offset - o
832 cachestart = offset - o
837 cacheend = cachestart + length
833 cacheend = cachestart + length
838 if cachestart >= 0 and cacheend <= l:
834 if cachestart >= 0 and cacheend <= l:
839 if cachestart == 0 and cacheend == l:
835 if cachestart == 0 and cacheend == l:
840 return d # avoid a copy
836 return d # avoid a copy
841 return util.buffer(d, cachestart, cacheend - cachestart)
837 return util.buffer(d, cachestart, cacheend - cachestart)
842
838
843 return self._loadchunk(offset, length)
839 return self._loadchunk(offset, length)
844
840
845 def _chunkraw(self, startrev, endrev):
841 def _chunkraw(self, startrev, endrev):
846 start = self.start(startrev)
842 start = self.start(startrev)
847 length = self.end(endrev) - start
843 length = self.end(endrev) - start
848 if self._inline:
844 if self._inline:
849 start += (startrev + 1) * self._io.size
845 start += (startrev + 1) * self._io.size
850 return self._getchunk(start, length)
846 return self._getchunk(start, length)
851
847
852 def _chunk(self, rev):
848 def _chunk(self, rev):
853 return decompress(self._chunkraw(rev, rev))
849 return decompress(self._chunkraw(rev, rev))
854
850
855 def _chunkbase(self, rev):
851 def _chunkbase(self, rev):
856 return self._chunk(rev)
852 return self._chunk(rev)
857
853
858 def _chunkclear(self):
854 def _chunkclear(self):
859 self._chunkcache = (0, '')
855 self._chunkcache = (0, '')
860
856
861 def deltaparent(self, rev):
857 def deltaparent(self, rev):
862 """return deltaparent of the given revision"""
858 """return deltaparent of the given revision"""
863 base = self.index[rev][3]
859 base = self.index[rev][3]
864 if base == rev:
860 if base == rev:
865 return nullrev
861 return nullrev
866 elif self._generaldelta:
862 elif self._generaldelta:
867 return base
863 return base
868 else:
864 else:
869 return rev - 1
865 return rev - 1
870
866
871 def revdiff(self, rev1, rev2):
867 def revdiff(self, rev1, rev2):
872 """return or calculate a delta between two revisions"""
868 """return or calculate a delta between two revisions"""
873 if rev1 != nullrev and self.deltaparent(rev2) == rev1:
869 if rev1 != nullrev and self.deltaparent(rev2) == rev1:
874 return str(self._chunk(rev2))
870 return str(self._chunk(rev2))
875
871
876 return mdiff.textdiff(self.revision(rev1),
872 return mdiff.textdiff(self.revision(rev1),
877 self.revision(rev2))
873 self.revision(rev2))
878
874
879 def revision(self, nodeorrev):
875 def revision(self, nodeorrev):
880 """return an uncompressed revision of a given node or revision
876 """return an uncompressed revision of a given node or revision
881 number.
877 number.
882 """
878 """
883 if isinstance(nodeorrev, int):
879 if isinstance(nodeorrev, int):
884 rev = nodeorrev
880 rev = nodeorrev
885 node = self.node(rev)
881 node = self.node(rev)
886 else:
882 else:
887 node = nodeorrev
883 node = nodeorrev
888 rev = None
884 rev = None
889
885
890 cachedrev = None
886 cachedrev = None
891 if node == nullid:
887 if node == nullid:
892 return ""
888 return ""
893 if self._cache:
889 if self._cache:
894 if self._cache[0] == node:
890 if self._cache[0] == node:
895 return self._cache[2]
891 return self._cache[2]
896 cachedrev = self._cache[1]
892 cachedrev = self._cache[1]
897
893
898 # look up what we need to read
894 # look up what we need to read
899 text = None
895 text = None
900 if rev is None:
896 if rev is None:
901 rev = self.rev(node)
897 rev = self.rev(node)
902
898
903 # check rev flags
899 # check rev flags
904 if self.flags(rev) & ~REVIDX_KNOWN_FLAGS:
900 if self.flags(rev) & ~REVIDX_KNOWN_FLAGS:
905 raise RevlogError(_('incompatible revision flag %x') %
901 raise RevlogError(_('incompatible revision flag %x') %
906 (self.flags(rev) & ~REVIDX_KNOWN_FLAGS))
902 (self.flags(rev) & ~REVIDX_KNOWN_FLAGS))
907
903
908 # build delta chain
904 # build delta chain
909 chain = []
905 chain = []
910 index = self.index # for performance
906 index = self.index # for performance
911 generaldelta = self._generaldelta
907 generaldelta = self._generaldelta
912 iterrev = rev
908 iterrev = rev
913 e = index[iterrev]
909 e = index[iterrev]
914 while iterrev != e[3] and iterrev != cachedrev:
910 while iterrev != e[3] and iterrev != cachedrev:
915 chain.append(iterrev)
911 chain.append(iterrev)
916 if generaldelta:
912 if generaldelta:
917 iterrev = e[3]
913 iterrev = e[3]
918 else:
914 else:
919 iterrev -= 1
915 iterrev -= 1
920 e = index[iterrev]
916 e = index[iterrev]
921 chain.reverse()
917 chain.reverse()
922 base = iterrev
918 base = iterrev
923
919
924 if iterrev == cachedrev:
920 if iterrev == cachedrev:
925 # cache hit
921 # cache hit
926 text = self._cache[2]
922 text = self._cache[2]
927
923
928 # drop cache to save memory
924 # drop cache to save memory
929 self._cache = None
925 self._cache = None
930
926
931 self._chunkraw(base, rev)
927 self._chunkraw(base, rev)
932 if text is None:
928 if text is None:
933 text = str(self._chunkbase(base))
929 text = str(self._chunkbase(base))
934
930
935 bins = [self._chunk(r) for r in chain]
931 bins = [self._chunk(r) for r in chain]
936 text = mdiff.patches(text, bins)
932 text = mdiff.patches(text, bins)
937
933
938 text = self._checkhash(text, node, rev)
934 text = self._checkhash(text, node, rev)
939
935
940 self._cache = (node, rev, text)
936 self._cache = (node, rev, text)
941 return text
937 return text
942
938
943 def _checkhash(self, text, node, rev):
939 def _checkhash(self, text, node, rev):
944 p1, p2 = self.parents(node)
940 p1, p2 = self.parents(node)
945 if node != hash(text, p1, p2):
941 if node != hash(text, p1, p2):
946 raise RevlogError(_("integrity check failed on %s:%d")
942 raise RevlogError(_("integrity check failed on %s:%d")
947 % (self.indexfile, rev))
943 % (self.indexfile, rev))
948 return text
944 return text
949
945
950 def checkinlinesize(self, tr, fp=None):
946 def checkinlinesize(self, tr, fp=None):
951 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline:
947 if not self._inline or (self.start(-2) + self.length(-2)) < _maxinline:
952 return
948 return
953
949
954 trinfo = tr.find(self.indexfile)
950 trinfo = tr.find(self.indexfile)
955 if trinfo is None:
951 if trinfo is None:
956 raise RevlogError(_("%s not found in the transaction")
952 raise RevlogError(_("%s not found in the transaction")
957 % self.indexfile)
953 % self.indexfile)
958
954
959 trindex = trinfo[2]
955 trindex = trinfo[2]
960 dataoff = self.start(trindex)
956 dataoff = self.start(trindex)
961
957
962 tr.add(self.datafile, dataoff)
958 tr.add(self.datafile, dataoff)
963
959
964 if fp:
960 if fp:
965 fp.flush()
961 fp.flush()
966 fp.close()
962 fp.close()
967
963
968 df = self.opener(self.datafile, 'w')
964 df = self.opener(self.datafile, 'w')
969 try:
965 try:
970 for r in self:
966 for r in self:
971 df.write(self._chunkraw(r, r))
967 df.write(self._chunkraw(r, r))
972 finally:
968 finally:
973 df.close()
969 df.close()
974
970
975 fp = self.opener(self.indexfile, 'w', atomictemp=True)
971 fp = self.opener(self.indexfile, 'w', atomictemp=True)
976 self.version &= ~(REVLOGNGINLINEDATA)
972 self.version &= ~(REVLOGNGINLINEDATA)
977 self._inline = False
973 self._inline = False
978 for i in self:
974 for i in self:
979 e = self._io.packentry(self.index[i], self.node, self.version, i)
975 e = self._io.packentry(self.index[i], self.node, self.version, i)
980 fp.write(e)
976 fp.write(e)
981
977
982 # if we don't call close, the temp file will never replace the
978 # if we don't call close, the temp file will never replace the
983 # real index
979 # real index
984 fp.close()
980 fp.close()
985
981
986 tr.replace(self.indexfile, trindex * self._io.size)
982 tr.replace(self.indexfile, trindex * self._io.size)
987 self._chunkclear()
983 self._chunkclear()
988
984
989 def addrevision(self, text, transaction, link, p1, p2, cachedelta=None):
985 def addrevision(self, text, transaction, link, p1, p2, cachedelta=None):
990 """add a revision to the log
986 """add a revision to the log
991
987
992 text - the revision data to add
988 text - the revision data to add
993 transaction - the transaction object used for rollback
989 transaction - the transaction object used for rollback
994 link - the linkrev data to add
990 link - the linkrev data to add
995 p1, p2 - the parent nodeids of the revision
991 p1, p2 - the parent nodeids of the revision
996 cachedelta - an optional precomputed delta
992 cachedelta - an optional precomputed delta
997 """
993 """
998 node = hash(text, p1, p2)
994 node = hash(text, p1, p2)
999 if node in self.nodemap:
995 if node in self.nodemap:
1000 return node
996 return node
1001
997
1002 dfh = None
998 dfh = None
1003 if not self._inline:
999 if not self._inline:
1004 dfh = self.opener(self.datafile, "a")
1000 dfh = self.opener(self.datafile, "a")
1005 ifh = self.opener(self.indexfile, "a+")
1001 ifh = self.opener(self.indexfile, "a+")
1006 try:
1002 try:
1007 return self._addrevision(node, text, transaction, link, p1, p2,
1003 return self._addrevision(node, text, transaction, link, p1, p2,
1008 cachedelta, ifh, dfh)
1004 cachedelta, ifh, dfh)
1009 finally:
1005 finally:
1010 if dfh:
1006 if dfh:
1011 dfh.close()
1007 dfh.close()
1012 ifh.close()
1008 ifh.close()
1013
1009
1014 def compress(self, text):
1010 def compress(self, text):
1015 """ generate a possibly-compressed representation of text """
1011 """ generate a possibly-compressed representation of text """
1016 if not text:
1012 if not text:
1017 return ("", text)
1013 return ("", text)
1018 l = len(text)
1014 l = len(text)
1019 bin = None
1015 bin = None
1020 if l < 44:
1016 if l < 44:
1021 pass
1017 pass
1022 elif l > 1000000:
1018 elif l > 1000000:
1023 # zlib makes an internal copy, thus doubling memory usage for
1019 # zlib makes an internal copy, thus doubling memory usage for
1024 # large files, so lets do this in pieces
1020 # large files, so lets do this in pieces
1025 z = zlib.compressobj()
1021 z = zlib.compressobj()
1026 p = []
1022 p = []
1027 pos = 0
1023 pos = 0
1028 while pos < l:
1024 while pos < l:
1029 pos2 = pos + 2**20
1025 pos2 = pos + 2**20
1030 p.append(z.compress(text[pos:pos2]))
1026 p.append(z.compress(text[pos:pos2]))
1031 pos = pos2
1027 pos = pos2
1032 p.append(z.flush())
1028 p.append(z.flush())
1033 if sum(map(len, p)) < l:
1029 if sum(map(len, p)) < l:
1034 bin = "".join(p)
1030 bin = "".join(p)
1035 else:
1031 else:
1036 bin = _compress(text)
1032 bin = _compress(text)
1037 if bin is None or len(bin) > l:
1033 if bin is None or len(bin) > l:
1038 if text[0] == '\0':
1034 if text[0] == '\0':
1039 return ("", text)
1035 return ("", text)
1040 return ('u', text)
1036 return ('u', text)
1041 return ("", bin)
1037 return ("", bin)
1042
1038
1043 def _addrevision(self, node, text, transaction, link, p1, p2,
1039 def _addrevision(self, node, text, transaction, link, p1, p2,
1044 cachedelta, ifh, dfh):
1040 cachedelta, ifh, dfh):
1045 """internal function to add revisions to the log
1041 """internal function to add revisions to the log
1046
1042
1047 see addrevision for argument descriptions.
1043 see addrevision for argument descriptions.
1048 invariants:
1044 invariants:
1049 - text is optional (can be None); if not set, cachedelta must be set.
1045 - text is optional (can be None); if not set, cachedelta must be set.
1050 if both are set, they must correspond to each other.
1046 if both are set, they must correspond to each other.
1051 """
1047 """
1052 btext = [text]
1048 btext = [text]
1053 def buildtext():
1049 def buildtext():
1054 if btext[0] is not None:
1050 if btext[0] is not None:
1055 return btext[0]
1051 return btext[0]
1056 # flush any pending writes here so we can read it in revision
1052 # flush any pending writes here so we can read it in revision
1057 if dfh:
1053 if dfh:
1058 dfh.flush()
1054 dfh.flush()
1059 ifh.flush()
1055 ifh.flush()
1060 basetext = self.revision(self.node(cachedelta[0]))
1056 basetext = self.revision(self.node(cachedelta[0]))
1061 btext[0] = mdiff.patch(basetext, cachedelta[1])
1057 btext[0] = mdiff.patch(basetext, cachedelta[1])
1062 chk = hash(btext[0], p1, p2)
1058 chk = hash(btext[0], p1, p2)
1063 if chk != node:
1059 if chk != node:
1064 raise RevlogError(_("consistency error in delta"))
1060 raise RevlogError(_("consistency error in delta"))
1065 return btext[0]
1061 return btext[0]
1066
1062
1067 def builddelta(rev):
1063 def builddelta(rev):
1068 # can we use the cached delta?
1064 # can we use the cached delta?
1069 if cachedelta and cachedelta[0] == rev:
1065 if cachedelta and cachedelta[0] == rev:
1070 delta = cachedelta[1]
1066 delta = cachedelta[1]
1071 else:
1067 else:
1072 t = buildtext()
1068 t = buildtext()
1073 ptext = self.revision(self.node(rev))
1069 ptext = self.revision(self.node(rev))
1074 delta = mdiff.textdiff(ptext, t)
1070 delta = mdiff.textdiff(ptext, t)
1075 data = self.compress(delta)
1071 data = self.compress(delta)
1076 l = len(data[1]) + len(data[0])
1072 l = len(data[1]) + len(data[0])
1077 if basecache[0] == rev:
1073 if basecache[0] == rev:
1078 chainbase = basecache[1]
1074 chainbase = basecache[1]
1079 else:
1075 else:
1080 chainbase = self.chainbase(rev)
1076 chainbase = self.chainbase(rev)
1081 dist = l + offset - self.start(chainbase)
1077 dist = l + offset - self.start(chainbase)
1082 if self._generaldelta:
1078 if self._generaldelta:
1083 base = rev
1079 base = rev
1084 else:
1080 else:
1085 base = chainbase
1081 base = chainbase
1086 return dist, l, data, base, chainbase
1082 return dist, l, data, base, chainbase
1087
1083
1088 curr = len(self)
1084 curr = len(self)
1089 prev = curr - 1
1085 prev = curr - 1
1090 base = chainbase = curr
1086 base = chainbase = curr
1091 offset = self.end(prev)
1087 offset = self.end(prev)
1092 flags = 0
1088 flags = 0
1093 d = None
1089 d = None
1094 basecache = self._basecache
1090 basecache = self._basecache
1095 p1r, p2r = self.rev(p1), self.rev(p2)
1091 p1r, p2r = self.rev(p1), self.rev(p2)
1096
1092
1097 # should we try to build a delta?
1093 # should we try to build a delta?
1098 if prev != nullrev:
1094 if prev != nullrev:
1099 if self._generaldelta:
1095 if self._generaldelta:
1100 if p1r >= basecache[1]:
1096 if p1r >= basecache[1]:
1101 d = builddelta(p1r)
1097 d = builddelta(p1r)
1102 elif p2r >= basecache[1]:
1098 elif p2r >= basecache[1]:
1103 d = builddelta(p2r)
1099 d = builddelta(p2r)
1104 else:
1100 else:
1105 d = builddelta(prev)
1101 d = builddelta(prev)
1106 else:
1102 else:
1107 d = builddelta(prev)
1103 d = builddelta(prev)
1108 dist, l, data, base, chainbase = d
1104 dist, l, data, base, chainbase = d
1109
1105
1110 # full versions are inserted when the needed deltas
1106 # full versions are inserted when the needed deltas
1111 # become comparable to the uncompressed text
1107 # become comparable to the uncompressed text
1112 if text is None:
1108 if text is None:
1113 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
1109 textlen = mdiff.patchedsize(self.rawsize(cachedelta[0]),
1114 cachedelta[1])
1110 cachedelta[1])
1115 else:
1111 else:
1116 textlen = len(text)
1112 textlen = len(text)
1117 if d is None or dist > textlen * 2:
1113 if d is None or dist > textlen * 2:
1118 text = buildtext()
1114 text = buildtext()
1119 data = self.compress(text)
1115 data = self.compress(text)
1120 l = len(data[1]) + len(data[0])
1116 l = len(data[1]) + len(data[0])
1121 base = chainbase = curr
1117 base = chainbase = curr
1122
1118
1123 e = (offset_type(offset, flags), l, textlen,
1119 e = (offset_type(offset, flags), l, textlen,
1124 base, link, p1r, p2r, node)
1120 base, link, p1r, p2r, node)
1125 self.index.insert(-1, e)
1121 self.index.insert(-1, e)
1126 self.nodemap[node] = curr
1122 self.nodemap[node] = curr
1127
1123
1128 entry = self._io.packentry(e, self.node, self.version, curr)
1124 entry = self._io.packentry(e, self.node, self.version, curr)
1129 if not self._inline:
1125 if not self._inline:
1130 transaction.add(self.datafile, offset)
1126 transaction.add(self.datafile, offset)
1131 transaction.add(self.indexfile, curr * len(entry))
1127 transaction.add(self.indexfile, curr * len(entry))
1132 if data[0]:
1128 if data[0]:
1133 dfh.write(data[0])
1129 dfh.write(data[0])
1134 dfh.write(data[1])
1130 dfh.write(data[1])
1135 dfh.flush()
1131 dfh.flush()
1136 ifh.write(entry)
1132 ifh.write(entry)
1137 else:
1133 else:
1138 offset += curr * self._io.size
1134 offset += curr * self._io.size
1139 transaction.add(self.indexfile, offset, curr)
1135 transaction.add(self.indexfile, offset, curr)
1140 ifh.write(entry)
1136 ifh.write(entry)
1141 ifh.write(data[0])
1137 ifh.write(data[0])
1142 ifh.write(data[1])
1138 ifh.write(data[1])
1143 self.checkinlinesize(transaction, ifh)
1139 self.checkinlinesize(transaction, ifh)
1144
1140
1145 if type(text) == str: # only accept immutable objects
1141 if type(text) == str: # only accept immutable objects
1146 self._cache = (node, curr, text)
1142 self._cache = (node, curr, text)
1147 self._basecache = (curr, chainbase)
1143 self._basecache = (curr, chainbase)
1148 return node
1144 return node
1149
1145
1150 def group(self, nodelist, bundler, reorder=None):
1146 def group(self, nodelist, bundler, reorder=None):
1151 """Calculate a delta group, yielding a sequence of changegroup chunks
1147 """Calculate a delta group, yielding a sequence of changegroup chunks
1152 (strings).
1148 (strings).
1153
1149
1154 Given a list of changeset revs, return a set of deltas and
1150 Given a list of changeset revs, return a set of deltas and
1155 metadata corresponding to nodes. The first delta is
1151 metadata corresponding to nodes. The first delta is
1156 first parent(nodelist[0]) -> nodelist[0], the receiver is
1152 first parent(nodelist[0]) -> nodelist[0], the receiver is
1157 guaranteed to have this parent as it has all history before
1153 guaranteed to have this parent as it has all history before
1158 these changesets. In the case firstparent is nullrev the
1154 these changesets. In the case firstparent is nullrev the
1159 changegroup starts with a full revision.
1155 changegroup starts with a full revision.
1160 """
1156 """
1161
1157
1162 # if we don't have any revisions touched by these changesets, bail
1158 # if we don't have any revisions touched by these changesets, bail
1163 if len(nodelist) == 0:
1159 if len(nodelist) == 0:
1164 yield bundler.close()
1160 yield bundler.close()
1165 return
1161 return
1166
1162
1167 # for generaldelta revlogs, we linearize the revs; this will both be
1163 # for generaldelta revlogs, we linearize the revs; this will both be
1168 # much quicker and generate a much smaller bundle
1164 # much quicker and generate a much smaller bundle
1169 if (self._generaldelta and reorder is not False) or reorder:
1165 if (self._generaldelta and reorder is not False) or reorder:
1170 dag = dagutil.revlogdag(self)
1166 dag = dagutil.revlogdag(self)
1171 revs = set(self.rev(n) for n in nodelist)
1167 revs = set(self.rev(n) for n in nodelist)
1172 revs = dag.linearize(revs)
1168 revs = dag.linearize(revs)
1173 else:
1169 else:
1174 revs = sorted([self.rev(n) for n in nodelist])
1170 revs = sorted([self.rev(n) for n in nodelist])
1175
1171
1176 # add the parent of the first rev
1172 # add the parent of the first rev
1177 p = self.parentrevs(revs[0])[0]
1173 p = self.parentrevs(revs[0])[0]
1178 revs.insert(0, p)
1174 revs.insert(0, p)
1179
1175
1180 # build deltas
1176 # build deltas
1181 for r in xrange(len(revs) - 1):
1177 for r in xrange(len(revs) - 1):
1182 prev, curr = revs[r], revs[r + 1]
1178 prev, curr = revs[r], revs[r + 1]
1183 for c in bundler.revchunk(self, curr, prev):
1179 for c in bundler.revchunk(self, curr, prev):
1184 yield c
1180 yield c
1185
1181
1186 yield bundler.close()
1182 yield bundler.close()
1187
1183
1188 def addgroup(self, bundle, linkmapper, transaction):
1184 def addgroup(self, bundle, linkmapper, transaction):
1189 """
1185 """
1190 add a delta group
1186 add a delta group
1191
1187
1192 given a set of deltas, add them to the revision log. the
1188 given a set of deltas, add them to the revision log. the
1193 first delta is against its parent, which should be in our
1189 first delta is against its parent, which should be in our
1194 log, the rest are against the previous delta.
1190 log, the rest are against the previous delta.
1195 """
1191 """
1196
1192
1197 # track the base of the current delta log
1193 # track the base of the current delta log
1198 content = []
1194 content = []
1199 node = None
1195 node = None
1200
1196
1201 r = len(self)
1197 r = len(self)
1202 end = 0
1198 end = 0
1203 if r:
1199 if r:
1204 end = self.end(r - 1)
1200 end = self.end(r - 1)
1205 ifh = self.opener(self.indexfile, "a+")
1201 ifh = self.opener(self.indexfile, "a+")
1206 isize = r * self._io.size
1202 isize = r * self._io.size
1207 if self._inline:
1203 if self._inline:
1208 transaction.add(self.indexfile, end + isize, r)
1204 transaction.add(self.indexfile, end + isize, r)
1209 dfh = None
1205 dfh = None
1210 else:
1206 else:
1211 transaction.add(self.indexfile, isize, r)
1207 transaction.add(self.indexfile, isize, r)
1212 transaction.add(self.datafile, end)
1208 transaction.add(self.datafile, end)
1213 dfh = self.opener(self.datafile, "a")
1209 dfh = self.opener(self.datafile, "a")
1214
1210
1215 try:
1211 try:
1216 # loop through our set of deltas
1212 # loop through our set of deltas
1217 chain = None
1213 chain = None
1218 while True:
1214 while True:
1219 chunkdata = bundle.deltachunk(chain)
1215 chunkdata = bundle.deltachunk(chain)
1220 if not chunkdata:
1216 if not chunkdata:
1221 break
1217 break
1222 node = chunkdata['node']
1218 node = chunkdata['node']
1223 p1 = chunkdata['p1']
1219 p1 = chunkdata['p1']
1224 p2 = chunkdata['p2']
1220 p2 = chunkdata['p2']
1225 cs = chunkdata['cs']
1221 cs = chunkdata['cs']
1226 deltabase = chunkdata['deltabase']
1222 deltabase = chunkdata['deltabase']
1227 delta = chunkdata['delta']
1223 delta = chunkdata['delta']
1228
1224
1229 content.append(node)
1225 content.append(node)
1230
1226
1231 link = linkmapper(cs)
1227 link = linkmapper(cs)
1232 if node in self.nodemap:
1228 if node in self.nodemap:
1233 # this can happen if two branches make the same change
1229 # this can happen if two branches make the same change
1234 chain = node
1230 chain = node
1235 continue
1231 continue
1236
1232
1237 for p in (p1, p2):
1233 for p in (p1, p2):
1238 if p not in self.nodemap:
1234 if p not in self.nodemap:
1239 raise LookupError(p, self.indexfile,
1235 raise LookupError(p, self.indexfile,
1240 _('unknown parent'))
1236 _('unknown parent'))
1241
1237
1242 if deltabase not in self.nodemap:
1238 if deltabase not in self.nodemap:
1243 raise LookupError(deltabase, self.indexfile,
1239 raise LookupError(deltabase, self.indexfile,
1244 _('unknown delta base'))
1240 _('unknown delta base'))
1245
1241
1246 baserev = self.rev(deltabase)
1242 baserev = self.rev(deltabase)
1247 chain = self._addrevision(node, None, transaction, link,
1243 chain = self._addrevision(node, None, transaction, link,
1248 p1, p2, (baserev, delta), ifh, dfh)
1244 p1, p2, (baserev, delta), ifh, dfh)
1249 if not dfh and not self._inline:
1245 if not dfh and not self._inline:
1250 # addrevision switched from inline to conventional
1246 # addrevision switched from inline to conventional
1251 # reopen the index
1247 # reopen the index
1252 ifh.close()
1248 ifh.close()
1253 dfh = self.opener(self.datafile, "a")
1249 dfh = self.opener(self.datafile, "a")
1254 ifh = self.opener(self.indexfile, "a")
1250 ifh = self.opener(self.indexfile, "a")
1255 finally:
1251 finally:
1256 if dfh:
1252 if dfh:
1257 dfh.close()
1253 dfh.close()
1258 ifh.close()
1254 ifh.close()
1259
1255
1260 return content
1256 return content
1261
1257
1262 def strip(self, minlink, transaction):
1258 def strip(self, minlink, transaction):
1263 """truncate the revlog on the first revision with a linkrev >= minlink
1259 """truncate the revlog on the first revision with a linkrev >= minlink
1264
1260
1265 This function is called when we're stripping revision minlink and
1261 This function is called when we're stripping revision minlink and
1266 its descendants from the repository.
1262 its descendants from the repository.
1267
1263
1268 We have to remove all revisions with linkrev >= minlink, because
1264 We have to remove all revisions with linkrev >= minlink, because
1269 the equivalent changelog revisions will be renumbered after the
1265 the equivalent changelog revisions will be renumbered after the
1270 strip.
1266 strip.
1271
1267
1272 So we truncate the revlog on the first of these revisions, and
1268 So we truncate the revlog on the first of these revisions, and
1273 trust that the caller has saved the revisions that shouldn't be
1269 trust that the caller has saved the revisions that shouldn't be
1274 removed and that it'll re-add them after this truncation.
1270 removed and that it'll re-add them after this truncation.
1275 """
1271 """
1276 if len(self) == 0:
1272 if len(self) == 0:
1277 return
1273 return
1278
1274
1279 for rev in self:
1275 for rev in self:
1280 if self.index[rev][4] >= minlink:
1276 if self.index[rev][4] >= minlink:
1281 break
1277 break
1282 else:
1278 else:
1283 return
1279 return
1284
1280
1285 # first truncate the files on disk
1281 # first truncate the files on disk
1286 end = self.start(rev)
1282 end = self.start(rev)
1287 if not self._inline:
1283 if not self._inline:
1288 transaction.add(self.datafile, end)
1284 transaction.add(self.datafile, end)
1289 end = rev * self._io.size
1285 end = rev * self._io.size
1290 else:
1286 else:
1291 end += rev * self._io.size
1287 end += rev * self._io.size
1292
1288
1293 transaction.add(self.indexfile, end)
1289 transaction.add(self.indexfile, end)
1294
1290
1295 # then reset internal state in memory to forget those revisions
1291 # then reset internal state in memory to forget those revisions
1296 self._cache = None
1292 self._cache = None
1297 self._chunkclear()
1293 self._chunkclear()
1298 for x in xrange(rev, len(self)):
1294 for x in xrange(rev, len(self)):
1299 del self.nodemap[self.node(x)]
1295 del self.nodemap[self.node(x)]
1300
1296
1301 del self.index[rev:-1]
1297 del self.index[rev:-1]
1302
1298
1303 def checksize(self):
1299 def checksize(self):
1304 expected = 0
1300 expected = 0
1305 if len(self):
1301 if len(self):
1306 expected = max(0, self.end(len(self) - 1))
1302 expected = max(0, self.end(len(self) - 1))
1307
1303
1308 try:
1304 try:
1309 f = self.opener(self.datafile)
1305 f = self.opener(self.datafile)
1310 f.seek(0, 2)
1306 f.seek(0, 2)
1311 actual = f.tell()
1307 actual = f.tell()
1312 f.close()
1308 f.close()
1313 dd = actual - expected
1309 dd = actual - expected
1314 except IOError, inst:
1310 except IOError, inst:
1315 if inst.errno != errno.ENOENT:
1311 if inst.errno != errno.ENOENT:
1316 raise
1312 raise
1317 dd = 0
1313 dd = 0
1318
1314
1319 try:
1315 try:
1320 f = self.opener(self.indexfile)
1316 f = self.opener(self.indexfile)
1321 f.seek(0, 2)
1317 f.seek(0, 2)
1322 actual = f.tell()
1318 actual = f.tell()
1323 f.close()
1319 f.close()
1324 s = self._io.size
1320 s = self._io.size
1325 i = max(0, actual // s)
1321 i = max(0, actual // s)
1326 di = actual - (i * s)
1322 di = actual - (i * s)
1327 if self._inline:
1323 if self._inline:
1328 databytes = 0
1324 databytes = 0
1329 for r in self:
1325 for r in self:
1330 databytes += max(0, self.length(r))
1326 databytes += max(0, self.length(r))
1331 dd = 0
1327 dd = 0
1332 di = actual - len(self) * s - databytes
1328 di = actual - len(self) * s - databytes
1333 except IOError, inst:
1329 except IOError, inst:
1334 if inst.errno != errno.ENOENT:
1330 if inst.errno != errno.ENOENT:
1335 raise
1331 raise
1336 di = 0
1332 di = 0
1337
1333
1338 return (dd, di)
1334 return (dd, di)
1339
1335
1340 def files(self):
1336 def files(self):
1341 res = [self.indexfile]
1337 res = [self.indexfile]
1342 if not self._inline:
1338 if not self._inline:
1343 res.append(self.datafile)
1339 res.append(self.datafile)
1344 return res
1340 return res
@@ -1,2126 +1,2125 b''
1 @ (34) head
1 @ (34) head
2 |
2 |
3 | o (33) head
3 | o (33) head
4 | |
4 | |
5 o | (32) expand
5 o | (32) expand
6 |\ \
6 |\ \
7 | o \ (31) expand
7 | o \ (31) expand
8 | |\ \
8 | |\ \
9 | | o \ (30) expand
9 | | o \ (30) expand
10 | | |\ \
10 | | |\ \
11 | | | o | (29) regular commit
11 | | | o | (29) regular commit
12 | | | | |
12 | | | | |
13 | | o | | (28) merge zero known
13 | | o | | (28) merge zero known
14 | | |\ \ \
14 | | |\ \ \
15 o | | | | | (27) collapse
15 o | | | | | (27) collapse
16 |/ / / / /
16 |/ / / / /
17 | | o---+ (26) merge one known; far right
17 | | o---+ (26) merge one known; far right
18 | | | | |
18 | | | | |
19 +---o | | (25) merge one known; far left
19 +---o | | (25) merge one known; far left
20 | | | | |
20 | | | | |
21 | | o | | (24) merge one known; immediate right
21 | | o | | (24) merge one known; immediate right
22 | | |\| |
22 | | |\| |
23 | | o | | (23) merge one known; immediate left
23 | | o | | (23) merge one known; immediate left
24 | |/| | |
24 | |/| | |
25 +---o---+ (22) merge two known; one far left, one far right
25 +---o---+ (22) merge two known; one far left, one far right
26 | | / /
26 | | / /
27 o | | | (21) expand
27 o | | | (21) expand
28 |\ \ \ \
28 |\ \ \ \
29 | o---+-+ (20) merge two known; two far right
29 | o---+-+ (20) merge two known; two far right
30 | / / /
30 | / / /
31 o | | | (19) expand
31 o | | | (19) expand
32 |\ \ \ \
32 |\ \ \ \
33 +---+---o (18) merge two known; two far left
33 +---+---o (18) merge two known; two far left
34 | | | |
34 | | | |
35 | o | | (17) expand
35 | o | | (17) expand
36 | |\ \ \
36 | |\ \ \
37 | | o---+ (16) merge two known; one immediate right, one near right
37 | | o---+ (16) merge two known; one immediate right, one near right
38 | | |/ /
38 | | |/ /
39 o | | | (15) expand
39 o | | | (15) expand
40 |\ \ \ \
40 |\ \ \ \
41 | o-----+ (14) merge two known; one immediate right, one far right
41 | o-----+ (14) merge two known; one immediate right, one far right
42 | |/ / /
42 | |/ / /
43 o | | | (13) expand
43 o | | | (13) expand
44 |\ \ \ \
44 |\ \ \ \
45 +---o | | (12) merge two known; one immediate right, one far left
45 +---o | | (12) merge two known; one immediate right, one far left
46 | | |/ /
46 | | |/ /
47 | o | | (11) expand
47 | o | | (11) expand
48 | |\ \ \
48 | |\ \ \
49 | | o---+ (10) merge two known; one immediate left, one near right
49 | | o---+ (10) merge two known; one immediate left, one near right
50 | |/ / /
50 | |/ / /
51 o | | | (9) expand
51 o | | | (9) expand
52 |\ \ \ \
52 |\ \ \ \
53 | o-----+ (8) merge two known; one immediate left, one far right
53 | o-----+ (8) merge two known; one immediate left, one far right
54 |/ / / /
54 |/ / / /
55 o | | | (7) expand
55 o | | | (7) expand
56 |\ \ \ \
56 |\ \ \ \
57 +---o | | (6) merge two known; one immediate left, one far left
57 +---o | | (6) merge two known; one immediate left, one far left
58 | |/ / /
58 | |/ / /
59 | o | | (5) expand
59 | o | | (5) expand
60 | |\ \ \
60 | |\ \ \
61 | | o | | (4) merge two known; one immediate left, one immediate right
61 | | o | | (4) merge two known; one immediate left, one immediate right
62 | |/|/ /
62 | |/|/ /
63 | o / / (3) collapse
63 | o / / (3) collapse
64 |/ / /
64 |/ / /
65 o / / (2) collapse
65 o / / (2) collapse
66 |/ /
66 |/ /
67 o / (1) collapse
67 o / (1) collapse
68 |/
68 |/
69 o (0) root
69 o (0) root
70
70
71
71
72 $ commit()
72 $ commit()
73 > {
73 > {
74 > rev=$1
74 > rev=$1
75 > msg=$2
75 > msg=$2
76 > shift 2
76 > shift 2
77 > if [ "$#" -gt 0 ]; then
77 > if [ "$#" -gt 0 ]; then
78 > hg debugsetparents "$@"
78 > hg debugsetparents "$@"
79 > fi
79 > fi
80 > echo $rev > a
80 > echo $rev > a
81 > hg commit -Aqd "$rev 0" -m "($rev) $msg"
81 > hg commit -Aqd "$rev 0" -m "($rev) $msg"
82 > }
82 > }
83
83
84 $ cat > printrevset.py <<EOF
84 $ cat > printrevset.py <<EOF
85 > from mercurial import extensions, revset, commands, cmdutil
85 > from mercurial import extensions, revset, commands, cmdutil
86 >
86 >
87 > def uisetup(ui):
87 > def uisetup(ui):
88 > def printrevset(orig, ui, repo, *pats, **opts):
88 > def printrevset(orig, ui, repo, *pats, **opts):
89 > if opts.get('print_revset'):
89 > if opts.get('print_revset'):
90 > expr = cmdutil.getgraphlogrevs(repo, pats, opts)[1]
90 > expr = cmdutil.getgraphlogrevs(repo, pats, opts)[1]
91 > if expr:
91 > if expr:
92 > tree = revset.parse(expr)[0]
92 > tree = revset.parse(expr)[0]
93 > else:
93 > else:
94 > tree = []
94 > tree = []
95 > ui.write('%r\n' % (opts.get('rev', []),))
95 > ui.write('%r\n' % (opts.get('rev', []),))
96 > ui.write(revset.prettyformat(tree) + '\n')
96 > ui.write(revset.prettyformat(tree) + '\n')
97 > return 0
97 > return 0
98 > return orig(ui, repo, *pats, **opts)
98 > return orig(ui, repo, *pats, **opts)
99 > entry = extensions.wrapcommand(commands.table, 'log', printrevset)
99 > entry = extensions.wrapcommand(commands.table, 'log', printrevset)
100 > entry[1].append(('', 'print-revset', False,
100 > entry[1].append(('', 'print-revset', False,
101 > 'print generated revset and exit (DEPRECATED)'))
101 > 'print generated revset and exit (DEPRECATED)'))
102 > EOF
102 > EOF
103
103
104 $ echo "[extensions]" >> $HGRCPATH
104 $ echo "[extensions]" >> $HGRCPATH
105 $ echo "graphlog=" >> $HGRCPATH
105 $ echo "graphlog=" >> $HGRCPATH
106 $ echo "printrevset=`pwd`/printrevset.py" >> $HGRCPATH
106 $ echo "printrevset=`pwd`/printrevset.py" >> $HGRCPATH
107
107
108 $ hg init repo
108 $ hg init repo
109 $ cd repo
109 $ cd repo
110
110
111 Empty repo:
111 Empty repo:
112
112
113 $ hg glog
113 $ hg glog
114
114
115
115
116 Building DAG:
116 Building DAG:
117
117
118 $ commit 0 "root"
118 $ commit 0 "root"
119 $ commit 1 "collapse" 0
119 $ commit 1 "collapse" 0
120 $ commit 2 "collapse" 1
120 $ commit 2 "collapse" 1
121 $ commit 3 "collapse" 2
121 $ commit 3 "collapse" 2
122 $ commit 4 "merge two known; one immediate left, one immediate right" 1 3
122 $ commit 4 "merge two known; one immediate left, one immediate right" 1 3
123 $ commit 5 "expand" 3 4
123 $ commit 5 "expand" 3 4
124 $ commit 6 "merge two known; one immediate left, one far left" 2 5
124 $ commit 6 "merge two known; one immediate left, one far left" 2 5
125 $ commit 7 "expand" 2 5
125 $ commit 7 "expand" 2 5
126 $ commit 8 "merge two known; one immediate left, one far right" 0 7
126 $ commit 8 "merge two known; one immediate left, one far right" 0 7
127 $ commit 9 "expand" 7 8
127 $ commit 9 "expand" 7 8
128 $ commit 10 "merge two known; one immediate left, one near right" 0 6
128 $ commit 10 "merge two known; one immediate left, one near right" 0 6
129 $ commit 11 "expand" 6 10
129 $ commit 11 "expand" 6 10
130 $ commit 12 "merge two known; one immediate right, one far left" 1 9
130 $ commit 12 "merge two known; one immediate right, one far left" 1 9
131 $ commit 13 "expand" 9 11
131 $ commit 13 "expand" 9 11
132 $ commit 14 "merge two known; one immediate right, one far right" 0 12
132 $ commit 14 "merge two known; one immediate right, one far right" 0 12
133 $ commit 15 "expand" 13 14
133 $ commit 15 "expand" 13 14
134 $ commit 16 "merge two known; one immediate right, one near right" 0 1
134 $ commit 16 "merge two known; one immediate right, one near right" 0 1
135 $ commit 17 "expand" 12 16
135 $ commit 17 "expand" 12 16
136 $ commit 18 "merge two known; two far left" 1 15
136 $ commit 18 "merge two known; two far left" 1 15
137 $ commit 19 "expand" 15 17
137 $ commit 19 "expand" 15 17
138 $ commit 20 "merge two known; two far right" 0 18
138 $ commit 20 "merge two known; two far right" 0 18
139 $ commit 21 "expand" 19 20
139 $ commit 21 "expand" 19 20
140 $ commit 22 "merge two known; one far left, one far right" 18 21
140 $ commit 22 "merge two known; one far left, one far right" 18 21
141 $ commit 23 "merge one known; immediate left" 1 22
141 $ commit 23 "merge one known; immediate left" 1 22
142 $ commit 24 "merge one known; immediate right" 0 23
142 $ commit 24 "merge one known; immediate right" 0 23
143 $ commit 25 "merge one known; far left" 21 24
143 $ commit 25 "merge one known; far left" 21 24
144 $ commit 26 "merge one known; far right" 18 25
144 $ commit 26 "merge one known; far right" 18 25
145 $ commit 27 "collapse" 21
145 $ commit 27 "collapse" 21
146 $ commit 28 "merge zero known" 1 26
146 $ commit 28 "merge zero known" 1 26
147 $ commit 29 "regular commit" 0
147 $ commit 29 "regular commit" 0
148 $ commit 30 "expand" 28 29
148 $ commit 30 "expand" 28 29
149 $ commit 31 "expand" 21 30
149 $ commit 31 "expand" 21 30
150 $ commit 32 "expand" 27 31
150 $ commit 32 "expand" 27 31
151 $ commit 33 "head" 18
151 $ commit 33 "head" 18
152 $ commit 34 "head" 32
152 $ commit 34 "head" 32
153
153
154
154
155 $ hg glog -q
155 $ hg glog -q
156 @ 34:fea3ac5810e0
156 @ 34:fea3ac5810e0
157 |
157 |
158 | o 33:68608f5145f9
158 | o 33:68608f5145f9
159 | |
159 | |
160 o | 32:d06dffa21a31
160 o | 32:d06dffa21a31
161 |\ \
161 |\ \
162 | o \ 31:621d83e11f67
162 | o \ 31:621d83e11f67
163 | |\ \
163 | |\ \
164 | | o \ 30:6e11cd4b648f
164 | | o \ 30:6e11cd4b648f
165 | | |\ \
165 | | |\ \
166 | | | o | 29:cd9bb2be7593
166 | | | o | 29:cd9bb2be7593
167 | | | | |
167 | | | | |
168 | | o | | 28:44ecd0b9ae99
168 | | o | | 28:44ecd0b9ae99
169 | | |\ \ \
169 | | |\ \ \
170 o | | | | | 27:886ed638191b
170 o | | | | | 27:886ed638191b
171 |/ / / / /
171 |/ / / / /
172 | | o---+ 26:7f25b6c2f0b9
172 | | o---+ 26:7f25b6c2f0b9
173 | | | | |
173 | | | | |
174 +---o | | 25:91da8ed57247
174 +---o | | 25:91da8ed57247
175 | | | | |
175 | | | | |
176 | | o | | 24:a9c19a3d96b7
176 | | o | | 24:a9c19a3d96b7
177 | | |\| |
177 | | |\| |
178 | | o | | 23:a01cddf0766d
178 | | o | | 23:a01cddf0766d
179 | |/| | |
179 | |/| | |
180 +---o---+ 22:e0d9cccacb5d
180 +---o---+ 22:e0d9cccacb5d
181 | | / /
181 | | / /
182 o | | | 21:d42a756af44d
182 o | | | 21:d42a756af44d
183 |\ \ \ \
183 |\ \ \ \
184 | o---+-+ 20:d30ed6450e32
184 | o---+-+ 20:d30ed6450e32
185 | / / /
185 | / / /
186 o | | | 19:31ddc2c1573b
186 o | | | 19:31ddc2c1573b
187 |\ \ \ \
187 |\ \ \ \
188 +---+---o 18:1aa84d96232a
188 +---+---o 18:1aa84d96232a
189 | | | |
189 | | | |
190 | o | | 17:44765d7c06e0
190 | o | | 17:44765d7c06e0
191 | |\ \ \
191 | |\ \ \
192 | | o---+ 16:3677d192927d
192 | | o---+ 16:3677d192927d
193 | | |/ /
193 | | |/ /
194 o | | | 15:1dda3f72782d
194 o | | | 15:1dda3f72782d
195 |\ \ \ \
195 |\ \ \ \
196 | o-----+ 14:8eac370358ef
196 | o-----+ 14:8eac370358ef
197 | |/ / /
197 | |/ / /
198 o | | | 13:22d8966a97e3
198 o | | | 13:22d8966a97e3
199 |\ \ \ \
199 |\ \ \ \
200 +---o | | 12:86b91144a6e9
200 +---o | | 12:86b91144a6e9
201 | | |/ /
201 | | |/ /
202 | o | | 11:832d76e6bdf2
202 | o | | 11:832d76e6bdf2
203 | |\ \ \
203 | |\ \ \
204 | | o---+ 10:74c64d036d72
204 | | o---+ 10:74c64d036d72
205 | |/ / /
205 | |/ / /
206 o | | | 9:7010c0af0a35
206 o | | | 9:7010c0af0a35
207 |\ \ \ \
207 |\ \ \ \
208 | o-----+ 8:7a0b11f71937
208 | o-----+ 8:7a0b11f71937
209 |/ / / /
209 |/ / / /
210 o | | | 7:b632bb1b1224
210 o | | | 7:b632bb1b1224
211 |\ \ \ \
211 |\ \ \ \
212 +---o | | 6:b105a072e251
212 +---o | | 6:b105a072e251
213 | |/ / /
213 | |/ / /
214 | o | | 5:4409d547b708
214 | o | | 5:4409d547b708
215 | |\ \ \
215 | |\ \ \
216 | | o | | 4:26a8bac39d9f
216 | | o | | 4:26a8bac39d9f
217 | |/|/ /
217 | |/|/ /
218 | o / / 3:27eef8ed80b4
218 | o / / 3:27eef8ed80b4
219 |/ / /
219 |/ / /
220 o / / 2:3d9a33b8d1e1
220 o / / 2:3d9a33b8d1e1
221 |/ /
221 |/ /
222 o / 1:6db2ef61d156
222 o / 1:6db2ef61d156
223 |/
223 |/
224 o 0:e6eb3150255d
224 o 0:e6eb3150255d
225
225
226
226
227 $ hg glog
227 $ hg glog
228 @ changeset: 34:fea3ac5810e0
228 @ changeset: 34:fea3ac5810e0
229 | tag: tip
229 | tag: tip
230 | parent: 32:d06dffa21a31
230 | parent: 32:d06dffa21a31
231 | user: test
231 | user: test
232 | date: Thu Jan 01 00:00:34 1970 +0000
232 | date: Thu Jan 01 00:00:34 1970 +0000
233 | summary: (34) head
233 | summary: (34) head
234 |
234 |
235 | o changeset: 33:68608f5145f9
235 | o changeset: 33:68608f5145f9
236 | | parent: 18:1aa84d96232a
236 | | parent: 18:1aa84d96232a
237 | | user: test
237 | | user: test
238 | | date: Thu Jan 01 00:00:33 1970 +0000
238 | | date: Thu Jan 01 00:00:33 1970 +0000
239 | | summary: (33) head
239 | | summary: (33) head
240 | |
240 | |
241 o | changeset: 32:d06dffa21a31
241 o | changeset: 32:d06dffa21a31
242 |\ \ parent: 27:886ed638191b
242 |\ \ parent: 27:886ed638191b
243 | | | parent: 31:621d83e11f67
243 | | | parent: 31:621d83e11f67
244 | | | user: test
244 | | | user: test
245 | | | date: Thu Jan 01 00:00:32 1970 +0000
245 | | | date: Thu Jan 01 00:00:32 1970 +0000
246 | | | summary: (32) expand
246 | | | summary: (32) expand
247 | | |
247 | | |
248 | o | changeset: 31:621d83e11f67
248 | o | changeset: 31:621d83e11f67
249 | |\ \ parent: 21:d42a756af44d
249 | |\ \ parent: 21:d42a756af44d
250 | | | | parent: 30:6e11cd4b648f
250 | | | | parent: 30:6e11cd4b648f
251 | | | | user: test
251 | | | | user: test
252 | | | | date: Thu Jan 01 00:00:31 1970 +0000
252 | | | | date: Thu Jan 01 00:00:31 1970 +0000
253 | | | | summary: (31) expand
253 | | | | summary: (31) expand
254 | | | |
254 | | | |
255 | | o | changeset: 30:6e11cd4b648f
255 | | o | changeset: 30:6e11cd4b648f
256 | | |\ \ parent: 28:44ecd0b9ae99
256 | | |\ \ parent: 28:44ecd0b9ae99
257 | | | | | parent: 29:cd9bb2be7593
257 | | | | | parent: 29:cd9bb2be7593
258 | | | | | user: test
258 | | | | | user: test
259 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
259 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
260 | | | | | summary: (30) expand
260 | | | | | summary: (30) expand
261 | | | | |
261 | | | | |
262 | | | o | changeset: 29:cd9bb2be7593
262 | | | o | changeset: 29:cd9bb2be7593
263 | | | | | parent: 0:e6eb3150255d
263 | | | | | parent: 0:e6eb3150255d
264 | | | | | user: test
264 | | | | | user: test
265 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
265 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
266 | | | | | summary: (29) regular commit
266 | | | | | summary: (29) regular commit
267 | | | | |
267 | | | | |
268 | | o | | changeset: 28:44ecd0b9ae99
268 | | o | | changeset: 28:44ecd0b9ae99
269 | | |\ \ \ parent: 1:6db2ef61d156
269 | | |\ \ \ parent: 1:6db2ef61d156
270 | | | | | | parent: 26:7f25b6c2f0b9
270 | | | | | | parent: 26:7f25b6c2f0b9
271 | | | | | | user: test
271 | | | | | | user: test
272 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
272 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
273 | | | | | | summary: (28) merge zero known
273 | | | | | | summary: (28) merge zero known
274 | | | | | |
274 | | | | | |
275 o | | | | | changeset: 27:886ed638191b
275 o | | | | | changeset: 27:886ed638191b
276 |/ / / / / parent: 21:d42a756af44d
276 |/ / / / / parent: 21:d42a756af44d
277 | | | | | user: test
277 | | | | | user: test
278 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
278 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
279 | | | | | summary: (27) collapse
279 | | | | | summary: (27) collapse
280 | | | | |
280 | | | | |
281 | | o---+ changeset: 26:7f25b6c2f0b9
281 | | o---+ changeset: 26:7f25b6c2f0b9
282 | | | | | parent: 18:1aa84d96232a
282 | | | | | parent: 18:1aa84d96232a
283 | | | | | parent: 25:91da8ed57247
283 | | | | | parent: 25:91da8ed57247
284 | | | | | user: test
284 | | | | | user: test
285 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
285 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
286 | | | | | summary: (26) merge one known; far right
286 | | | | | summary: (26) merge one known; far right
287 | | | | |
287 | | | | |
288 +---o | | changeset: 25:91da8ed57247
288 +---o | | changeset: 25:91da8ed57247
289 | | | | | parent: 21:d42a756af44d
289 | | | | | parent: 21:d42a756af44d
290 | | | | | parent: 24:a9c19a3d96b7
290 | | | | | parent: 24:a9c19a3d96b7
291 | | | | | user: test
291 | | | | | user: test
292 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
292 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
293 | | | | | summary: (25) merge one known; far left
293 | | | | | summary: (25) merge one known; far left
294 | | | | |
294 | | | | |
295 | | o | | changeset: 24:a9c19a3d96b7
295 | | o | | changeset: 24:a9c19a3d96b7
296 | | |\| | parent: 0:e6eb3150255d
296 | | |\| | parent: 0:e6eb3150255d
297 | | | | | parent: 23:a01cddf0766d
297 | | | | | parent: 23:a01cddf0766d
298 | | | | | user: test
298 | | | | | user: test
299 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
299 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
300 | | | | | summary: (24) merge one known; immediate right
300 | | | | | summary: (24) merge one known; immediate right
301 | | | | |
301 | | | | |
302 | | o | | changeset: 23:a01cddf0766d
302 | | o | | changeset: 23:a01cddf0766d
303 | |/| | | parent: 1:6db2ef61d156
303 | |/| | | parent: 1:6db2ef61d156
304 | | | | | parent: 22:e0d9cccacb5d
304 | | | | | parent: 22:e0d9cccacb5d
305 | | | | | user: test
305 | | | | | user: test
306 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
306 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
307 | | | | | summary: (23) merge one known; immediate left
307 | | | | | summary: (23) merge one known; immediate left
308 | | | | |
308 | | | | |
309 +---o---+ changeset: 22:e0d9cccacb5d
309 +---o---+ changeset: 22:e0d9cccacb5d
310 | | | | parent: 18:1aa84d96232a
310 | | | | parent: 18:1aa84d96232a
311 | | / / parent: 21:d42a756af44d
311 | | / / parent: 21:d42a756af44d
312 | | | | user: test
312 | | | | user: test
313 | | | | date: Thu Jan 01 00:00:22 1970 +0000
313 | | | | date: Thu Jan 01 00:00:22 1970 +0000
314 | | | | summary: (22) merge two known; one far left, one far right
314 | | | | summary: (22) merge two known; one far left, one far right
315 | | | |
315 | | | |
316 o | | | changeset: 21:d42a756af44d
316 o | | | changeset: 21:d42a756af44d
317 |\ \ \ \ parent: 19:31ddc2c1573b
317 |\ \ \ \ parent: 19:31ddc2c1573b
318 | | | | | parent: 20:d30ed6450e32
318 | | | | | parent: 20:d30ed6450e32
319 | | | | | user: test
319 | | | | | user: test
320 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
320 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
321 | | | | | summary: (21) expand
321 | | | | | summary: (21) expand
322 | | | | |
322 | | | | |
323 | o---+-+ changeset: 20:d30ed6450e32
323 | o---+-+ changeset: 20:d30ed6450e32
324 | | | | parent: 0:e6eb3150255d
324 | | | | parent: 0:e6eb3150255d
325 | / / / parent: 18:1aa84d96232a
325 | / / / parent: 18:1aa84d96232a
326 | | | | user: test
326 | | | | user: test
327 | | | | date: Thu Jan 01 00:00:20 1970 +0000
327 | | | | date: Thu Jan 01 00:00:20 1970 +0000
328 | | | | summary: (20) merge two known; two far right
328 | | | | summary: (20) merge two known; two far right
329 | | | |
329 | | | |
330 o | | | changeset: 19:31ddc2c1573b
330 o | | | changeset: 19:31ddc2c1573b
331 |\ \ \ \ parent: 15:1dda3f72782d
331 |\ \ \ \ parent: 15:1dda3f72782d
332 | | | | | parent: 17:44765d7c06e0
332 | | | | | parent: 17:44765d7c06e0
333 | | | | | user: test
333 | | | | | user: test
334 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
334 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
335 | | | | | summary: (19) expand
335 | | | | | summary: (19) expand
336 | | | | |
336 | | | | |
337 +---+---o changeset: 18:1aa84d96232a
337 +---+---o changeset: 18:1aa84d96232a
338 | | | | parent: 1:6db2ef61d156
338 | | | | parent: 1:6db2ef61d156
339 | | | | parent: 15:1dda3f72782d
339 | | | | parent: 15:1dda3f72782d
340 | | | | user: test
340 | | | | user: test
341 | | | | date: Thu Jan 01 00:00:18 1970 +0000
341 | | | | date: Thu Jan 01 00:00:18 1970 +0000
342 | | | | summary: (18) merge two known; two far left
342 | | | | summary: (18) merge two known; two far left
343 | | | |
343 | | | |
344 | o | | changeset: 17:44765d7c06e0
344 | o | | changeset: 17:44765d7c06e0
345 | |\ \ \ parent: 12:86b91144a6e9
345 | |\ \ \ parent: 12:86b91144a6e9
346 | | | | | parent: 16:3677d192927d
346 | | | | | parent: 16:3677d192927d
347 | | | | | user: test
347 | | | | | user: test
348 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
348 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
349 | | | | | summary: (17) expand
349 | | | | | summary: (17) expand
350 | | | | |
350 | | | | |
351 | | o---+ changeset: 16:3677d192927d
351 | | o---+ changeset: 16:3677d192927d
352 | | | | | parent: 0:e6eb3150255d
352 | | | | | parent: 0:e6eb3150255d
353 | | |/ / parent: 1:6db2ef61d156
353 | | |/ / parent: 1:6db2ef61d156
354 | | | | user: test
354 | | | | user: test
355 | | | | date: Thu Jan 01 00:00:16 1970 +0000
355 | | | | date: Thu Jan 01 00:00:16 1970 +0000
356 | | | | summary: (16) merge two known; one immediate right, one near right
356 | | | | summary: (16) merge two known; one immediate right, one near right
357 | | | |
357 | | | |
358 o | | | changeset: 15:1dda3f72782d
358 o | | | changeset: 15:1dda3f72782d
359 |\ \ \ \ parent: 13:22d8966a97e3
359 |\ \ \ \ parent: 13:22d8966a97e3
360 | | | | | parent: 14:8eac370358ef
360 | | | | | parent: 14:8eac370358ef
361 | | | | | user: test
361 | | | | | user: test
362 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
362 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
363 | | | | | summary: (15) expand
363 | | | | | summary: (15) expand
364 | | | | |
364 | | | | |
365 | o-----+ changeset: 14:8eac370358ef
365 | o-----+ changeset: 14:8eac370358ef
366 | | | | | parent: 0:e6eb3150255d
366 | | | | | parent: 0:e6eb3150255d
367 | |/ / / parent: 12:86b91144a6e9
367 | |/ / / parent: 12:86b91144a6e9
368 | | | | user: test
368 | | | | user: test
369 | | | | date: Thu Jan 01 00:00:14 1970 +0000
369 | | | | date: Thu Jan 01 00:00:14 1970 +0000
370 | | | | summary: (14) merge two known; one immediate right, one far right
370 | | | | summary: (14) merge two known; one immediate right, one far right
371 | | | |
371 | | | |
372 o | | | changeset: 13:22d8966a97e3
372 o | | | changeset: 13:22d8966a97e3
373 |\ \ \ \ parent: 9:7010c0af0a35
373 |\ \ \ \ parent: 9:7010c0af0a35
374 | | | | | parent: 11:832d76e6bdf2
374 | | | | | parent: 11:832d76e6bdf2
375 | | | | | user: test
375 | | | | | user: test
376 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
376 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
377 | | | | | summary: (13) expand
377 | | | | | summary: (13) expand
378 | | | | |
378 | | | | |
379 +---o | | changeset: 12:86b91144a6e9
379 +---o | | changeset: 12:86b91144a6e9
380 | | |/ / parent: 1:6db2ef61d156
380 | | |/ / parent: 1:6db2ef61d156
381 | | | | parent: 9:7010c0af0a35
381 | | | | parent: 9:7010c0af0a35
382 | | | | user: test
382 | | | | user: test
383 | | | | date: Thu Jan 01 00:00:12 1970 +0000
383 | | | | date: Thu Jan 01 00:00:12 1970 +0000
384 | | | | summary: (12) merge two known; one immediate right, one far left
384 | | | | summary: (12) merge two known; one immediate right, one far left
385 | | | |
385 | | | |
386 | o | | changeset: 11:832d76e6bdf2
386 | o | | changeset: 11:832d76e6bdf2
387 | |\ \ \ parent: 6:b105a072e251
387 | |\ \ \ parent: 6:b105a072e251
388 | | | | | parent: 10:74c64d036d72
388 | | | | | parent: 10:74c64d036d72
389 | | | | | user: test
389 | | | | | user: test
390 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
390 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
391 | | | | | summary: (11) expand
391 | | | | | summary: (11) expand
392 | | | | |
392 | | | | |
393 | | o---+ changeset: 10:74c64d036d72
393 | | o---+ changeset: 10:74c64d036d72
394 | | | | | parent: 0:e6eb3150255d
394 | | | | | parent: 0:e6eb3150255d
395 | |/ / / parent: 6:b105a072e251
395 | |/ / / parent: 6:b105a072e251
396 | | | | user: test
396 | | | | user: test
397 | | | | date: Thu Jan 01 00:00:10 1970 +0000
397 | | | | date: Thu Jan 01 00:00:10 1970 +0000
398 | | | | summary: (10) merge two known; one immediate left, one near right
398 | | | | summary: (10) merge two known; one immediate left, one near right
399 | | | |
399 | | | |
400 o | | | changeset: 9:7010c0af0a35
400 o | | | changeset: 9:7010c0af0a35
401 |\ \ \ \ parent: 7:b632bb1b1224
401 |\ \ \ \ parent: 7:b632bb1b1224
402 | | | | | parent: 8:7a0b11f71937
402 | | | | | parent: 8:7a0b11f71937
403 | | | | | user: test
403 | | | | | user: test
404 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
404 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
405 | | | | | summary: (9) expand
405 | | | | | summary: (9) expand
406 | | | | |
406 | | | | |
407 | o-----+ changeset: 8:7a0b11f71937
407 | o-----+ changeset: 8:7a0b11f71937
408 | | | | | parent: 0:e6eb3150255d
408 | | | | | parent: 0:e6eb3150255d
409 |/ / / / parent: 7:b632bb1b1224
409 |/ / / / parent: 7:b632bb1b1224
410 | | | | user: test
410 | | | | user: test
411 | | | | date: Thu Jan 01 00:00:08 1970 +0000
411 | | | | date: Thu Jan 01 00:00:08 1970 +0000
412 | | | | summary: (8) merge two known; one immediate left, one far right
412 | | | | summary: (8) merge two known; one immediate left, one far right
413 | | | |
413 | | | |
414 o | | | changeset: 7:b632bb1b1224
414 o | | | changeset: 7:b632bb1b1224
415 |\ \ \ \ parent: 2:3d9a33b8d1e1
415 |\ \ \ \ parent: 2:3d9a33b8d1e1
416 | | | | | parent: 5:4409d547b708
416 | | | | | parent: 5:4409d547b708
417 | | | | | user: test
417 | | | | | user: test
418 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
418 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
419 | | | | | summary: (7) expand
419 | | | | | summary: (7) expand
420 | | | | |
420 | | | | |
421 +---o | | changeset: 6:b105a072e251
421 +---o | | changeset: 6:b105a072e251
422 | |/ / / parent: 2:3d9a33b8d1e1
422 | |/ / / parent: 2:3d9a33b8d1e1
423 | | | | parent: 5:4409d547b708
423 | | | | parent: 5:4409d547b708
424 | | | | user: test
424 | | | | user: test
425 | | | | date: Thu Jan 01 00:00:06 1970 +0000
425 | | | | date: Thu Jan 01 00:00:06 1970 +0000
426 | | | | summary: (6) merge two known; one immediate left, one far left
426 | | | | summary: (6) merge two known; one immediate left, one far left
427 | | | |
427 | | | |
428 | o | | changeset: 5:4409d547b708
428 | o | | changeset: 5:4409d547b708
429 | |\ \ \ parent: 3:27eef8ed80b4
429 | |\ \ \ parent: 3:27eef8ed80b4
430 | | | | | parent: 4:26a8bac39d9f
430 | | | | | parent: 4:26a8bac39d9f
431 | | | | | user: test
431 | | | | | user: test
432 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
432 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
433 | | | | | summary: (5) expand
433 | | | | | summary: (5) expand
434 | | | | |
434 | | | | |
435 | | o | | changeset: 4:26a8bac39d9f
435 | | o | | changeset: 4:26a8bac39d9f
436 | |/|/ / parent: 1:6db2ef61d156
436 | |/|/ / parent: 1:6db2ef61d156
437 | | | | parent: 3:27eef8ed80b4
437 | | | | parent: 3:27eef8ed80b4
438 | | | | user: test
438 | | | | user: test
439 | | | | date: Thu Jan 01 00:00:04 1970 +0000
439 | | | | date: Thu Jan 01 00:00:04 1970 +0000
440 | | | | summary: (4) merge two known; one immediate left, one immediate right
440 | | | | summary: (4) merge two known; one immediate left, one immediate right
441 | | | |
441 | | | |
442 | o | | changeset: 3:27eef8ed80b4
442 | o | | changeset: 3:27eef8ed80b4
443 |/ / / user: test
443 |/ / / user: test
444 | | | date: Thu Jan 01 00:00:03 1970 +0000
444 | | | date: Thu Jan 01 00:00:03 1970 +0000
445 | | | summary: (3) collapse
445 | | | summary: (3) collapse
446 | | |
446 | | |
447 o | | changeset: 2:3d9a33b8d1e1
447 o | | changeset: 2:3d9a33b8d1e1
448 |/ / user: test
448 |/ / user: test
449 | | date: Thu Jan 01 00:00:02 1970 +0000
449 | | date: Thu Jan 01 00:00:02 1970 +0000
450 | | summary: (2) collapse
450 | | summary: (2) collapse
451 | |
451 | |
452 o | changeset: 1:6db2ef61d156
452 o | changeset: 1:6db2ef61d156
453 |/ user: test
453 |/ user: test
454 | date: Thu Jan 01 00:00:01 1970 +0000
454 | date: Thu Jan 01 00:00:01 1970 +0000
455 | summary: (1) collapse
455 | summary: (1) collapse
456 |
456 |
457 o changeset: 0:e6eb3150255d
457 o changeset: 0:e6eb3150255d
458 user: test
458 user: test
459 date: Thu Jan 01 00:00:00 1970 +0000
459 date: Thu Jan 01 00:00:00 1970 +0000
460 summary: (0) root
460 summary: (0) root
461
461
462
462
463 File glog:
463 File glog:
464 $ hg glog a
464 $ hg glog a
465 @ changeset: 34:fea3ac5810e0
465 @ changeset: 34:fea3ac5810e0
466 | tag: tip
466 | tag: tip
467 | parent: 32:d06dffa21a31
467 | parent: 32:d06dffa21a31
468 | user: test
468 | user: test
469 | date: Thu Jan 01 00:00:34 1970 +0000
469 | date: Thu Jan 01 00:00:34 1970 +0000
470 | summary: (34) head
470 | summary: (34) head
471 |
471 |
472 | o changeset: 33:68608f5145f9
472 | o changeset: 33:68608f5145f9
473 | | parent: 18:1aa84d96232a
473 | | parent: 18:1aa84d96232a
474 | | user: test
474 | | user: test
475 | | date: Thu Jan 01 00:00:33 1970 +0000
475 | | date: Thu Jan 01 00:00:33 1970 +0000
476 | | summary: (33) head
476 | | summary: (33) head
477 | |
477 | |
478 o | changeset: 32:d06dffa21a31
478 o | changeset: 32:d06dffa21a31
479 |\ \ parent: 27:886ed638191b
479 |\ \ parent: 27:886ed638191b
480 | | | parent: 31:621d83e11f67
480 | | | parent: 31:621d83e11f67
481 | | | user: test
481 | | | user: test
482 | | | date: Thu Jan 01 00:00:32 1970 +0000
482 | | | date: Thu Jan 01 00:00:32 1970 +0000
483 | | | summary: (32) expand
483 | | | summary: (32) expand
484 | | |
484 | | |
485 | o | changeset: 31:621d83e11f67
485 | o | changeset: 31:621d83e11f67
486 | |\ \ parent: 21:d42a756af44d
486 | |\ \ parent: 21:d42a756af44d
487 | | | | parent: 30:6e11cd4b648f
487 | | | | parent: 30:6e11cd4b648f
488 | | | | user: test
488 | | | | user: test
489 | | | | date: Thu Jan 01 00:00:31 1970 +0000
489 | | | | date: Thu Jan 01 00:00:31 1970 +0000
490 | | | | summary: (31) expand
490 | | | | summary: (31) expand
491 | | | |
491 | | | |
492 | | o | changeset: 30:6e11cd4b648f
492 | | o | changeset: 30:6e11cd4b648f
493 | | |\ \ parent: 28:44ecd0b9ae99
493 | | |\ \ parent: 28:44ecd0b9ae99
494 | | | | | parent: 29:cd9bb2be7593
494 | | | | | parent: 29:cd9bb2be7593
495 | | | | | user: test
495 | | | | | user: test
496 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
496 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
497 | | | | | summary: (30) expand
497 | | | | | summary: (30) expand
498 | | | | |
498 | | | | |
499 | | | o | changeset: 29:cd9bb2be7593
499 | | | o | changeset: 29:cd9bb2be7593
500 | | | | | parent: 0:e6eb3150255d
500 | | | | | parent: 0:e6eb3150255d
501 | | | | | user: test
501 | | | | | user: test
502 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
502 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
503 | | | | | summary: (29) regular commit
503 | | | | | summary: (29) regular commit
504 | | | | |
504 | | | | |
505 | | o | | changeset: 28:44ecd0b9ae99
505 | | o | | changeset: 28:44ecd0b9ae99
506 | | |\ \ \ parent: 1:6db2ef61d156
506 | | |\ \ \ parent: 1:6db2ef61d156
507 | | | | | | parent: 26:7f25b6c2f0b9
507 | | | | | | parent: 26:7f25b6c2f0b9
508 | | | | | | user: test
508 | | | | | | user: test
509 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
509 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
510 | | | | | | summary: (28) merge zero known
510 | | | | | | summary: (28) merge zero known
511 | | | | | |
511 | | | | | |
512 o | | | | | changeset: 27:886ed638191b
512 o | | | | | changeset: 27:886ed638191b
513 |/ / / / / parent: 21:d42a756af44d
513 |/ / / / / parent: 21:d42a756af44d
514 | | | | | user: test
514 | | | | | user: test
515 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
515 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
516 | | | | | summary: (27) collapse
516 | | | | | summary: (27) collapse
517 | | | | |
517 | | | | |
518 | | o---+ changeset: 26:7f25b6c2f0b9
518 | | o---+ changeset: 26:7f25b6c2f0b9
519 | | | | | parent: 18:1aa84d96232a
519 | | | | | parent: 18:1aa84d96232a
520 | | | | | parent: 25:91da8ed57247
520 | | | | | parent: 25:91da8ed57247
521 | | | | | user: test
521 | | | | | user: test
522 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
522 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
523 | | | | | summary: (26) merge one known; far right
523 | | | | | summary: (26) merge one known; far right
524 | | | | |
524 | | | | |
525 +---o | | changeset: 25:91da8ed57247
525 +---o | | changeset: 25:91da8ed57247
526 | | | | | parent: 21:d42a756af44d
526 | | | | | parent: 21:d42a756af44d
527 | | | | | parent: 24:a9c19a3d96b7
527 | | | | | parent: 24:a9c19a3d96b7
528 | | | | | user: test
528 | | | | | user: test
529 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
529 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
530 | | | | | summary: (25) merge one known; far left
530 | | | | | summary: (25) merge one known; far left
531 | | | | |
531 | | | | |
532 | | o | | changeset: 24:a9c19a3d96b7
532 | | o | | changeset: 24:a9c19a3d96b7
533 | | |\| | parent: 0:e6eb3150255d
533 | | |\| | parent: 0:e6eb3150255d
534 | | | | | parent: 23:a01cddf0766d
534 | | | | | parent: 23:a01cddf0766d
535 | | | | | user: test
535 | | | | | user: test
536 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
536 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
537 | | | | | summary: (24) merge one known; immediate right
537 | | | | | summary: (24) merge one known; immediate right
538 | | | | |
538 | | | | |
539 | | o | | changeset: 23:a01cddf0766d
539 | | o | | changeset: 23:a01cddf0766d
540 | |/| | | parent: 1:6db2ef61d156
540 | |/| | | parent: 1:6db2ef61d156
541 | | | | | parent: 22:e0d9cccacb5d
541 | | | | | parent: 22:e0d9cccacb5d
542 | | | | | user: test
542 | | | | | user: test
543 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
543 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
544 | | | | | summary: (23) merge one known; immediate left
544 | | | | | summary: (23) merge one known; immediate left
545 | | | | |
545 | | | | |
546 +---o---+ changeset: 22:e0d9cccacb5d
546 +---o---+ changeset: 22:e0d9cccacb5d
547 | | | | parent: 18:1aa84d96232a
547 | | | | parent: 18:1aa84d96232a
548 | | / / parent: 21:d42a756af44d
548 | | / / parent: 21:d42a756af44d
549 | | | | user: test
549 | | | | user: test
550 | | | | date: Thu Jan 01 00:00:22 1970 +0000
550 | | | | date: Thu Jan 01 00:00:22 1970 +0000
551 | | | | summary: (22) merge two known; one far left, one far right
551 | | | | summary: (22) merge two known; one far left, one far right
552 | | | |
552 | | | |
553 o | | | changeset: 21:d42a756af44d
553 o | | | changeset: 21:d42a756af44d
554 |\ \ \ \ parent: 19:31ddc2c1573b
554 |\ \ \ \ parent: 19:31ddc2c1573b
555 | | | | | parent: 20:d30ed6450e32
555 | | | | | parent: 20:d30ed6450e32
556 | | | | | user: test
556 | | | | | user: test
557 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
557 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
558 | | | | | summary: (21) expand
558 | | | | | summary: (21) expand
559 | | | | |
559 | | | | |
560 | o---+-+ changeset: 20:d30ed6450e32
560 | o---+-+ changeset: 20:d30ed6450e32
561 | | | | parent: 0:e6eb3150255d
561 | | | | parent: 0:e6eb3150255d
562 | / / / parent: 18:1aa84d96232a
562 | / / / parent: 18:1aa84d96232a
563 | | | | user: test
563 | | | | user: test
564 | | | | date: Thu Jan 01 00:00:20 1970 +0000
564 | | | | date: Thu Jan 01 00:00:20 1970 +0000
565 | | | | summary: (20) merge two known; two far right
565 | | | | summary: (20) merge two known; two far right
566 | | | |
566 | | | |
567 o | | | changeset: 19:31ddc2c1573b
567 o | | | changeset: 19:31ddc2c1573b
568 |\ \ \ \ parent: 15:1dda3f72782d
568 |\ \ \ \ parent: 15:1dda3f72782d
569 | | | | | parent: 17:44765d7c06e0
569 | | | | | parent: 17:44765d7c06e0
570 | | | | | user: test
570 | | | | | user: test
571 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
571 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
572 | | | | | summary: (19) expand
572 | | | | | summary: (19) expand
573 | | | | |
573 | | | | |
574 +---+---o changeset: 18:1aa84d96232a
574 +---+---o changeset: 18:1aa84d96232a
575 | | | | parent: 1:6db2ef61d156
575 | | | | parent: 1:6db2ef61d156
576 | | | | parent: 15:1dda3f72782d
576 | | | | parent: 15:1dda3f72782d
577 | | | | user: test
577 | | | | user: test
578 | | | | date: Thu Jan 01 00:00:18 1970 +0000
578 | | | | date: Thu Jan 01 00:00:18 1970 +0000
579 | | | | summary: (18) merge two known; two far left
579 | | | | summary: (18) merge two known; two far left
580 | | | |
580 | | | |
581 | o | | changeset: 17:44765d7c06e0
581 | o | | changeset: 17:44765d7c06e0
582 | |\ \ \ parent: 12:86b91144a6e9
582 | |\ \ \ parent: 12:86b91144a6e9
583 | | | | | parent: 16:3677d192927d
583 | | | | | parent: 16:3677d192927d
584 | | | | | user: test
584 | | | | | user: test
585 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
585 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
586 | | | | | summary: (17) expand
586 | | | | | summary: (17) expand
587 | | | | |
587 | | | | |
588 | | o---+ changeset: 16:3677d192927d
588 | | o---+ changeset: 16:3677d192927d
589 | | | | | parent: 0:e6eb3150255d
589 | | | | | parent: 0:e6eb3150255d
590 | | |/ / parent: 1:6db2ef61d156
590 | | |/ / parent: 1:6db2ef61d156
591 | | | | user: test
591 | | | | user: test
592 | | | | date: Thu Jan 01 00:00:16 1970 +0000
592 | | | | date: Thu Jan 01 00:00:16 1970 +0000
593 | | | | summary: (16) merge two known; one immediate right, one near right
593 | | | | summary: (16) merge two known; one immediate right, one near right
594 | | | |
594 | | | |
595 o | | | changeset: 15:1dda3f72782d
595 o | | | changeset: 15:1dda3f72782d
596 |\ \ \ \ parent: 13:22d8966a97e3
596 |\ \ \ \ parent: 13:22d8966a97e3
597 | | | | | parent: 14:8eac370358ef
597 | | | | | parent: 14:8eac370358ef
598 | | | | | user: test
598 | | | | | user: test
599 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
599 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
600 | | | | | summary: (15) expand
600 | | | | | summary: (15) expand
601 | | | | |
601 | | | | |
602 | o-----+ changeset: 14:8eac370358ef
602 | o-----+ changeset: 14:8eac370358ef
603 | | | | | parent: 0:e6eb3150255d
603 | | | | | parent: 0:e6eb3150255d
604 | |/ / / parent: 12:86b91144a6e9
604 | |/ / / parent: 12:86b91144a6e9
605 | | | | user: test
605 | | | | user: test
606 | | | | date: Thu Jan 01 00:00:14 1970 +0000
606 | | | | date: Thu Jan 01 00:00:14 1970 +0000
607 | | | | summary: (14) merge two known; one immediate right, one far right
607 | | | | summary: (14) merge two known; one immediate right, one far right
608 | | | |
608 | | | |
609 o | | | changeset: 13:22d8966a97e3
609 o | | | changeset: 13:22d8966a97e3
610 |\ \ \ \ parent: 9:7010c0af0a35
610 |\ \ \ \ parent: 9:7010c0af0a35
611 | | | | | parent: 11:832d76e6bdf2
611 | | | | | parent: 11:832d76e6bdf2
612 | | | | | user: test
612 | | | | | user: test
613 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
613 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
614 | | | | | summary: (13) expand
614 | | | | | summary: (13) expand
615 | | | | |
615 | | | | |
616 +---o | | changeset: 12:86b91144a6e9
616 +---o | | changeset: 12:86b91144a6e9
617 | | |/ / parent: 1:6db2ef61d156
617 | | |/ / parent: 1:6db2ef61d156
618 | | | | parent: 9:7010c0af0a35
618 | | | | parent: 9:7010c0af0a35
619 | | | | user: test
619 | | | | user: test
620 | | | | date: Thu Jan 01 00:00:12 1970 +0000
620 | | | | date: Thu Jan 01 00:00:12 1970 +0000
621 | | | | summary: (12) merge two known; one immediate right, one far left
621 | | | | summary: (12) merge two known; one immediate right, one far left
622 | | | |
622 | | | |
623 | o | | changeset: 11:832d76e6bdf2
623 | o | | changeset: 11:832d76e6bdf2
624 | |\ \ \ parent: 6:b105a072e251
624 | |\ \ \ parent: 6:b105a072e251
625 | | | | | parent: 10:74c64d036d72
625 | | | | | parent: 10:74c64d036d72
626 | | | | | user: test
626 | | | | | user: test
627 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
627 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
628 | | | | | summary: (11) expand
628 | | | | | summary: (11) expand
629 | | | | |
629 | | | | |
630 | | o---+ changeset: 10:74c64d036d72
630 | | o---+ changeset: 10:74c64d036d72
631 | | | | | parent: 0:e6eb3150255d
631 | | | | | parent: 0:e6eb3150255d
632 | |/ / / parent: 6:b105a072e251
632 | |/ / / parent: 6:b105a072e251
633 | | | | user: test
633 | | | | user: test
634 | | | | date: Thu Jan 01 00:00:10 1970 +0000
634 | | | | date: Thu Jan 01 00:00:10 1970 +0000
635 | | | | summary: (10) merge two known; one immediate left, one near right
635 | | | | summary: (10) merge two known; one immediate left, one near right
636 | | | |
636 | | | |
637 o | | | changeset: 9:7010c0af0a35
637 o | | | changeset: 9:7010c0af0a35
638 |\ \ \ \ parent: 7:b632bb1b1224
638 |\ \ \ \ parent: 7:b632bb1b1224
639 | | | | | parent: 8:7a0b11f71937
639 | | | | | parent: 8:7a0b11f71937
640 | | | | | user: test
640 | | | | | user: test
641 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
641 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
642 | | | | | summary: (9) expand
642 | | | | | summary: (9) expand
643 | | | | |
643 | | | | |
644 | o-----+ changeset: 8:7a0b11f71937
644 | o-----+ changeset: 8:7a0b11f71937
645 | | | | | parent: 0:e6eb3150255d
645 | | | | | parent: 0:e6eb3150255d
646 |/ / / / parent: 7:b632bb1b1224
646 |/ / / / parent: 7:b632bb1b1224
647 | | | | user: test
647 | | | | user: test
648 | | | | date: Thu Jan 01 00:00:08 1970 +0000
648 | | | | date: Thu Jan 01 00:00:08 1970 +0000
649 | | | | summary: (8) merge two known; one immediate left, one far right
649 | | | | summary: (8) merge two known; one immediate left, one far right
650 | | | |
650 | | | |
651 o | | | changeset: 7:b632bb1b1224
651 o | | | changeset: 7:b632bb1b1224
652 |\ \ \ \ parent: 2:3d9a33b8d1e1
652 |\ \ \ \ parent: 2:3d9a33b8d1e1
653 | | | | | parent: 5:4409d547b708
653 | | | | | parent: 5:4409d547b708
654 | | | | | user: test
654 | | | | | user: test
655 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
655 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
656 | | | | | summary: (7) expand
656 | | | | | summary: (7) expand
657 | | | | |
657 | | | | |
658 +---o | | changeset: 6:b105a072e251
658 +---o | | changeset: 6:b105a072e251
659 | |/ / / parent: 2:3d9a33b8d1e1
659 | |/ / / parent: 2:3d9a33b8d1e1
660 | | | | parent: 5:4409d547b708
660 | | | | parent: 5:4409d547b708
661 | | | | user: test
661 | | | | user: test
662 | | | | date: Thu Jan 01 00:00:06 1970 +0000
662 | | | | date: Thu Jan 01 00:00:06 1970 +0000
663 | | | | summary: (6) merge two known; one immediate left, one far left
663 | | | | summary: (6) merge two known; one immediate left, one far left
664 | | | |
664 | | | |
665 | o | | changeset: 5:4409d547b708
665 | o | | changeset: 5:4409d547b708
666 | |\ \ \ parent: 3:27eef8ed80b4
666 | |\ \ \ parent: 3:27eef8ed80b4
667 | | | | | parent: 4:26a8bac39d9f
667 | | | | | parent: 4:26a8bac39d9f
668 | | | | | user: test
668 | | | | | user: test
669 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
669 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
670 | | | | | summary: (5) expand
670 | | | | | summary: (5) expand
671 | | | | |
671 | | | | |
672 | | o | | changeset: 4:26a8bac39d9f
672 | | o | | changeset: 4:26a8bac39d9f
673 | |/|/ / parent: 1:6db2ef61d156
673 | |/|/ / parent: 1:6db2ef61d156
674 | | | | parent: 3:27eef8ed80b4
674 | | | | parent: 3:27eef8ed80b4
675 | | | | user: test
675 | | | | user: test
676 | | | | date: Thu Jan 01 00:00:04 1970 +0000
676 | | | | date: Thu Jan 01 00:00:04 1970 +0000
677 | | | | summary: (4) merge two known; one immediate left, one immediate right
677 | | | | summary: (4) merge two known; one immediate left, one immediate right
678 | | | |
678 | | | |
679 | o | | changeset: 3:27eef8ed80b4
679 | o | | changeset: 3:27eef8ed80b4
680 |/ / / user: test
680 |/ / / user: test
681 | | | date: Thu Jan 01 00:00:03 1970 +0000
681 | | | date: Thu Jan 01 00:00:03 1970 +0000
682 | | | summary: (3) collapse
682 | | | summary: (3) collapse
683 | | |
683 | | |
684 o | | changeset: 2:3d9a33b8d1e1
684 o | | changeset: 2:3d9a33b8d1e1
685 |/ / user: test
685 |/ / user: test
686 | | date: Thu Jan 01 00:00:02 1970 +0000
686 | | date: Thu Jan 01 00:00:02 1970 +0000
687 | | summary: (2) collapse
687 | | summary: (2) collapse
688 | |
688 | |
689 o | changeset: 1:6db2ef61d156
689 o | changeset: 1:6db2ef61d156
690 |/ user: test
690 |/ user: test
691 | date: Thu Jan 01 00:00:01 1970 +0000
691 | date: Thu Jan 01 00:00:01 1970 +0000
692 | summary: (1) collapse
692 | summary: (1) collapse
693 |
693 |
694 o changeset: 0:e6eb3150255d
694 o changeset: 0:e6eb3150255d
695 user: test
695 user: test
696 date: Thu Jan 01 00:00:00 1970 +0000
696 date: Thu Jan 01 00:00:00 1970 +0000
697 summary: (0) root
697 summary: (0) root
698
698
699
699
700 File glog per revset:
700 File glog per revset:
701
701
702 $ hg glog -r 'file("a")'
702 $ hg glog -r 'file("a")'
703 @ changeset: 34:fea3ac5810e0
703 @ changeset: 34:fea3ac5810e0
704 | tag: tip
704 | tag: tip
705 | parent: 32:d06dffa21a31
705 | parent: 32:d06dffa21a31
706 | user: test
706 | user: test
707 | date: Thu Jan 01 00:00:34 1970 +0000
707 | date: Thu Jan 01 00:00:34 1970 +0000
708 | summary: (34) head
708 | summary: (34) head
709 |
709 |
710 | o changeset: 33:68608f5145f9
710 | o changeset: 33:68608f5145f9
711 | | parent: 18:1aa84d96232a
711 | | parent: 18:1aa84d96232a
712 | | user: test
712 | | user: test
713 | | date: Thu Jan 01 00:00:33 1970 +0000
713 | | date: Thu Jan 01 00:00:33 1970 +0000
714 | | summary: (33) head
714 | | summary: (33) head
715 | |
715 | |
716 o | changeset: 32:d06dffa21a31
716 o | changeset: 32:d06dffa21a31
717 |\ \ parent: 27:886ed638191b
717 |\ \ parent: 27:886ed638191b
718 | | | parent: 31:621d83e11f67
718 | | | parent: 31:621d83e11f67
719 | | | user: test
719 | | | user: test
720 | | | date: Thu Jan 01 00:00:32 1970 +0000
720 | | | date: Thu Jan 01 00:00:32 1970 +0000
721 | | | summary: (32) expand
721 | | | summary: (32) expand
722 | | |
722 | | |
723 | o | changeset: 31:621d83e11f67
723 | o | changeset: 31:621d83e11f67
724 | |\ \ parent: 21:d42a756af44d
724 | |\ \ parent: 21:d42a756af44d
725 | | | | parent: 30:6e11cd4b648f
725 | | | | parent: 30:6e11cd4b648f
726 | | | | user: test
726 | | | | user: test
727 | | | | date: Thu Jan 01 00:00:31 1970 +0000
727 | | | | date: Thu Jan 01 00:00:31 1970 +0000
728 | | | | summary: (31) expand
728 | | | | summary: (31) expand
729 | | | |
729 | | | |
730 | | o | changeset: 30:6e11cd4b648f
730 | | o | changeset: 30:6e11cd4b648f
731 | | |\ \ parent: 28:44ecd0b9ae99
731 | | |\ \ parent: 28:44ecd0b9ae99
732 | | | | | parent: 29:cd9bb2be7593
732 | | | | | parent: 29:cd9bb2be7593
733 | | | | | user: test
733 | | | | | user: test
734 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
734 | | | | | date: Thu Jan 01 00:00:30 1970 +0000
735 | | | | | summary: (30) expand
735 | | | | | summary: (30) expand
736 | | | | |
736 | | | | |
737 | | | o | changeset: 29:cd9bb2be7593
737 | | | o | changeset: 29:cd9bb2be7593
738 | | | | | parent: 0:e6eb3150255d
738 | | | | | parent: 0:e6eb3150255d
739 | | | | | user: test
739 | | | | | user: test
740 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
740 | | | | | date: Thu Jan 01 00:00:29 1970 +0000
741 | | | | | summary: (29) regular commit
741 | | | | | summary: (29) regular commit
742 | | | | |
742 | | | | |
743 | | o | | changeset: 28:44ecd0b9ae99
743 | | o | | changeset: 28:44ecd0b9ae99
744 | | |\ \ \ parent: 1:6db2ef61d156
744 | | |\ \ \ parent: 1:6db2ef61d156
745 | | | | | | parent: 26:7f25b6c2f0b9
745 | | | | | | parent: 26:7f25b6c2f0b9
746 | | | | | | user: test
746 | | | | | | user: test
747 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
747 | | | | | | date: Thu Jan 01 00:00:28 1970 +0000
748 | | | | | | summary: (28) merge zero known
748 | | | | | | summary: (28) merge zero known
749 | | | | | |
749 | | | | | |
750 o | | | | | changeset: 27:886ed638191b
750 o | | | | | changeset: 27:886ed638191b
751 |/ / / / / parent: 21:d42a756af44d
751 |/ / / / / parent: 21:d42a756af44d
752 | | | | | user: test
752 | | | | | user: test
753 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
753 | | | | | date: Thu Jan 01 00:00:27 1970 +0000
754 | | | | | summary: (27) collapse
754 | | | | | summary: (27) collapse
755 | | | | |
755 | | | | |
756 | | o---+ changeset: 26:7f25b6c2f0b9
756 | | o---+ changeset: 26:7f25b6c2f0b9
757 | | | | | parent: 18:1aa84d96232a
757 | | | | | parent: 18:1aa84d96232a
758 | | | | | parent: 25:91da8ed57247
758 | | | | | parent: 25:91da8ed57247
759 | | | | | user: test
759 | | | | | user: test
760 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
760 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
761 | | | | | summary: (26) merge one known; far right
761 | | | | | summary: (26) merge one known; far right
762 | | | | |
762 | | | | |
763 +---o | | changeset: 25:91da8ed57247
763 +---o | | changeset: 25:91da8ed57247
764 | | | | | parent: 21:d42a756af44d
764 | | | | | parent: 21:d42a756af44d
765 | | | | | parent: 24:a9c19a3d96b7
765 | | | | | parent: 24:a9c19a3d96b7
766 | | | | | user: test
766 | | | | | user: test
767 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
767 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
768 | | | | | summary: (25) merge one known; far left
768 | | | | | summary: (25) merge one known; far left
769 | | | | |
769 | | | | |
770 | | o | | changeset: 24:a9c19a3d96b7
770 | | o | | changeset: 24:a9c19a3d96b7
771 | | |\| | parent: 0:e6eb3150255d
771 | | |\| | parent: 0:e6eb3150255d
772 | | | | | parent: 23:a01cddf0766d
772 | | | | | parent: 23:a01cddf0766d
773 | | | | | user: test
773 | | | | | user: test
774 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
774 | | | | | date: Thu Jan 01 00:00:24 1970 +0000
775 | | | | | summary: (24) merge one known; immediate right
775 | | | | | summary: (24) merge one known; immediate right
776 | | | | |
776 | | | | |
777 | | o | | changeset: 23:a01cddf0766d
777 | | o | | changeset: 23:a01cddf0766d
778 | |/| | | parent: 1:6db2ef61d156
778 | |/| | | parent: 1:6db2ef61d156
779 | | | | | parent: 22:e0d9cccacb5d
779 | | | | | parent: 22:e0d9cccacb5d
780 | | | | | user: test
780 | | | | | user: test
781 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
781 | | | | | date: Thu Jan 01 00:00:23 1970 +0000
782 | | | | | summary: (23) merge one known; immediate left
782 | | | | | summary: (23) merge one known; immediate left
783 | | | | |
783 | | | | |
784 +---o---+ changeset: 22:e0d9cccacb5d
784 +---o---+ changeset: 22:e0d9cccacb5d
785 | | | | parent: 18:1aa84d96232a
785 | | | | parent: 18:1aa84d96232a
786 | | / / parent: 21:d42a756af44d
786 | | / / parent: 21:d42a756af44d
787 | | | | user: test
787 | | | | user: test
788 | | | | date: Thu Jan 01 00:00:22 1970 +0000
788 | | | | date: Thu Jan 01 00:00:22 1970 +0000
789 | | | | summary: (22) merge two known; one far left, one far right
789 | | | | summary: (22) merge two known; one far left, one far right
790 | | | |
790 | | | |
791 o | | | changeset: 21:d42a756af44d
791 o | | | changeset: 21:d42a756af44d
792 |\ \ \ \ parent: 19:31ddc2c1573b
792 |\ \ \ \ parent: 19:31ddc2c1573b
793 | | | | | parent: 20:d30ed6450e32
793 | | | | | parent: 20:d30ed6450e32
794 | | | | | user: test
794 | | | | | user: test
795 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
795 | | | | | date: Thu Jan 01 00:00:21 1970 +0000
796 | | | | | summary: (21) expand
796 | | | | | summary: (21) expand
797 | | | | |
797 | | | | |
798 | o---+-+ changeset: 20:d30ed6450e32
798 | o---+-+ changeset: 20:d30ed6450e32
799 | | | | parent: 0:e6eb3150255d
799 | | | | parent: 0:e6eb3150255d
800 | / / / parent: 18:1aa84d96232a
800 | / / / parent: 18:1aa84d96232a
801 | | | | user: test
801 | | | | user: test
802 | | | | date: Thu Jan 01 00:00:20 1970 +0000
802 | | | | date: Thu Jan 01 00:00:20 1970 +0000
803 | | | | summary: (20) merge two known; two far right
803 | | | | summary: (20) merge two known; two far right
804 | | | |
804 | | | |
805 o | | | changeset: 19:31ddc2c1573b
805 o | | | changeset: 19:31ddc2c1573b
806 |\ \ \ \ parent: 15:1dda3f72782d
806 |\ \ \ \ parent: 15:1dda3f72782d
807 | | | | | parent: 17:44765d7c06e0
807 | | | | | parent: 17:44765d7c06e0
808 | | | | | user: test
808 | | | | | user: test
809 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
809 | | | | | date: Thu Jan 01 00:00:19 1970 +0000
810 | | | | | summary: (19) expand
810 | | | | | summary: (19) expand
811 | | | | |
811 | | | | |
812 +---+---o changeset: 18:1aa84d96232a
812 +---+---o changeset: 18:1aa84d96232a
813 | | | | parent: 1:6db2ef61d156
813 | | | | parent: 1:6db2ef61d156
814 | | | | parent: 15:1dda3f72782d
814 | | | | parent: 15:1dda3f72782d
815 | | | | user: test
815 | | | | user: test
816 | | | | date: Thu Jan 01 00:00:18 1970 +0000
816 | | | | date: Thu Jan 01 00:00:18 1970 +0000
817 | | | | summary: (18) merge two known; two far left
817 | | | | summary: (18) merge two known; two far left
818 | | | |
818 | | | |
819 | o | | changeset: 17:44765d7c06e0
819 | o | | changeset: 17:44765d7c06e0
820 | |\ \ \ parent: 12:86b91144a6e9
820 | |\ \ \ parent: 12:86b91144a6e9
821 | | | | | parent: 16:3677d192927d
821 | | | | | parent: 16:3677d192927d
822 | | | | | user: test
822 | | | | | user: test
823 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
823 | | | | | date: Thu Jan 01 00:00:17 1970 +0000
824 | | | | | summary: (17) expand
824 | | | | | summary: (17) expand
825 | | | | |
825 | | | | |
826 | | o---+ changeset: 16:3677d192927d
826 | | o---+ changeset: 16:3677d192927d
827 | | | | | parent: 0:e6eb3150255d
827 | | | | | parent: 0:e6eb3150255d
828 | | |/ / parent: 1:6db2ef61d156
828 | | |/ / parent: 1:6db2ef61d156
829 | | | | user: test
829 | | | | user: test
830 | | | | date: Thu Jan 01 00:00:16 1970 +0000
830 | | | | date: Thu Jan 01 00:00:16 1970 +0000
831 | | | | summary: (16) merge two known; one immediate right, one near right
831 | | | | summary: (16) merge two known; one immediate right, one near right
832 | | | |
832 | | | |
833 o | | | changeset: 15:1dda3f72782d
833 o | | | changeset: 15:1dda3f72782d
834 |\ \ \ \ parent: 13:22d8966a97e3
834 |\ \ \ \ parent: 13:22d8966a97e3
835 | | | | | parent: 14:8eac370358ef
835 | | | | | parent: 14:8eac370358ef
836 | | | | | user: test
836 | | | | | user: test
837 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
837 | | | | | date: Thu Jan 01 00:00:15 1970 +0000
838 | | | | | summary: (15) expand
838 | | | | | summary: (15) expand
839 | | | | |
839 | | | | |
840 | o-----+ changeset: 14:8eac370358ef
840 | o-----+ changeset: 14:8eac370358ef
841 | | | | | parent: 0:e6eb3150255d
841 | | | | | parent: 0:e6eb3150255d
842 | |/ / / parent: 12:86b91144a6e9
842 | |/ / / parent: 12:86b91144a6e9
843 | | | | user: test
843 | | | | user: test
844 | | | | date: Thu Jan 01 00:00:14 1970 +0000
844 | | | | date: Thu Jan 01 00:00:14 1970 +0000
845 | | | | summary: (14) merge two known; one immediate right, one far right
845 | | | | summary: (14) merge two known; one immediate right, one far right
846 | | | |
846 | | | |
847 o | | | changeset: 13:22d8966a97e3
847 o | | | changeset: 13:22d8966a97e3
848 |\ \ \ \ parent: 9:7010c0af0a35
848 |\ \ \ \ parent: 9:7010c0af0a35
849 | | | | | parent: 11:832d76e6bdf2
849 | | | | | parent: 11:832d76e6bdf2
850 | | | | | user: test
850 | | | | | user: test
851 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
851 | | | | | date: Thu Jan 01 00:00:13 1970 +0000
852 | | | | | summary: (13) expand
852 | | | | | summary: (13) expand
853 | | | | |
853 | | | | |
854 +---o | | changeset: 12:86b91144a6e9
854 +---o | | changeset: 12:86b91144a6e9
855 | | |/ / parent: 1:6db2ef61d156
855 | | |/ / parent: 1:6db2ef61d156
856 | | | | parent: 9:7010c0af0a35
856 | | | | parent: 9:7010c0af0a35
857 | | | | user: test
857 | | | | user: test
858 | | | | date: Thu Jan 01 00:00:12 1970 +0000
858 | | | | date: Thu Jan 01 00:00:12 1970 +0000
859 | | | | summary: (12) merge two known; one immediate right, one far left
859 | | | | summary: (12) merge two known; one immediate right, one far left
860 | | | |
860 | | | |
861 | o | | changeset: 11:832d76e6bdf2
861 | o | | changeset: 11:832d76e6bdf2
862 | |\ \ \ parent: 6:b105a072e251
862 | |\ \ \ parent: 6:b105a072e251
863 | | | | | parent: 10:74c64d036d72
863 | | | | | parent: 10:74c64d036d72
864 | | | | | user: test
864 | | | | | user: test
865 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
865 | | | | | date: Thu Jan 01 00:00:11 1970 +0000
866 | | | | | summary: (11) expand
866 | | | | | summary: (11) expand
867 | | | | |
867 | | | | |
868 | | o---+ changeset: 10:74c64d036d72
868 | | o---+ changeset: 10:74c64d036d72
869 | | | | | parent: 0:e6eb3150255d
869 | | | | | parent: 0:e6eb3150255d
870 | |/ / / parent: 6:b105a072e251
870 | |/ / / parent: 6:b105a072e251
871 | | | | user: test
871 | | | | user: test
872 | | | | date: Thu Jan 01 00:00:10 1970 +0000
872 | | | | date: Thu Jan 01 00:00:10 1970 +0000
873 | | | | summary: (10) merge two known; one immediate left, one near right
873 | | | | summary: (10) merge two known; one immediate left, one near right
874 | | | |
874 | | | |
875 o | | | changeset: 9:7010c0af0a35
875 o | | | changeset: 9:7010c0af0a35
876 |\ \ \ \ parent: 7:b632bb1b1224
876 |\ \ \ \ parent: 7:b632bb1b1224
877 | | | | | parent: 8:7a0b11f71937
877 | | | | | parent: 8:7a0b11f71937
878 | | | | | user: test
878 | | | | | user: test
879 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
879 | | | | | date: Thu Jan 01 00:00:09 1970 +0000
880 | | | | | summary: (9) expand
880 | | | | | summary: (9) expand
881 | | | | |
881 | | | | |
882 | o-----+ changeset: 8:7a0b11f71937
882 | o-----+ changeset: 8:7a0b11f71937
883 | | | | | parent: 0:e6eb3150255d
883 | | | | | parent: 0:e6eb3150255d
884 |/ / / / parent: 7:b632bb1b1224
884 |/ / / / parent: 7:b632bb1b1224
885 | | | | user: test
885 | | | | user: test
886 | | | | date: Thu Jan 01 00:00:08 1970 +0000
886 | | | | date: Thu Jan 01 00:00:08 1970 +0000
887 | | | | summary: (8) merge two known; one immediate left, one far right
887 | | | | summary: (8) merge two known; one immediate left, one far right
888 | | | |
888 | | | |
889 o | | | changeset: 7:b632bb1b1224
889 o | | | changeset: 7:b632bb1b1224
890 |\ \ \ \ parent: 2:3d9a33b8d1e1
890 |\ \ \ \ parent: 2:3d9a33b8d1e1
891 | | | | | parent: 5:4409d547b708
891 | | | | | parent: 5:4409d547b708
892 | | | | | user: test
892 | | | | | user: test
893 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
893 | | | | | date: Thu Jan 01 00:00:07 1970 +0000
894 | | | | | summary: (7) expand
894 | | | | | summary: (7) expand
895 | | | | |
895 | | | | |
896 +---o | | changeset: 6:b105a072e251
896 +---o | | changeset: 6:b105a072e251
897 | |/ / / parent: 2:3d9a33b8d1e1
897 | |/ / / parent: 2:3d9a33b8d1e1
898 | | | | parent: 5:4409d547b708
898 | | | | parent: 5:4409d547b708
899 | | | | user: test
899 | | | | user: test
900 | | | | date: Thu Jan 01 00:00:06 1970 +0000
900 | | | | date: Thu Jan 01 00:00:06 1970 +0000
901 | | | | summary: (6) merge two known; one immediate left, one far left
901 | | | | summary: (6) merge two known; one immediate left, one far left
902 | | | |
902 | | | |
903 | o | | changeset: 5:4409d547b708
903 | o | | changeset: 5:4409d547b708
904 | |\ \ \ parent: 3:27eef8ed80b4
904 | |\ \ \ parent: 3:27eef8ed80b4
905 | | | | | parent: 4:26a8bac39d9f
905 | | | | | parent: 4:26a8bac39d9f
906 | | | | | user: test
906 | | | | | user: test
907 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
907 | | | | | date: Thu Jan 01 00:00:05 1970 +0000
908 | | | | | summary: (5) expand
908 | | | | | summary: (5) expand
909 | | | | |
909 | | | | |
910 | | o | | changeset: 4:26a8bac39d9f
910 | | o | | changeset: 4:26a8bac39d9f
911 | |/|/ / parent: 1:6db2ef61d156
911 | |/|/ / parent: 1:6db2ef61d156
912 | | | | parent: 3:27eef8ed80b4
912 | | | | parent: 3:27eef8ed80b4
913 | | | | user: test
913 | | | | user: test
914 | | | | date: Thu Jan 01 00:00:04 1970 +0000
914 | | | | date: Thu Jan 01 00:00:04 1970 +0000
915 | | | | summary: (4) merge two known; one immediate left, one immediate right
915 | | | | summary: (4) merge two known; one immediate left, one immediate right
916 | | | |
916 | | | |
917 | o | | changeset: 3:27eef8ed80b4
917 | o | | changeset: 3:27eef8ed80b4
918 |/ / / user: test
918 |/ / / user: test
919 | | | date: Thu Jan 01 00:00:03 1970 +0000
919 | | | date: Thu Jan 01 00:00:03 1970 +0000
920 | | | summary: (3) collapse
920 | | | summary: (3) collapse
921 | | |
921 | | |
922 o | | changeset: 2:3d9a33b8d1e1
922 o | | changeset: 2:3d9a33b8d1e1
923 |/ / user: test
923 |/ / user: test
924 | | date: Thu Jan 01 00:00:02 1970 +0000
924 | | date: Thu Jan 01 00:00:02 1970 +0000
925 | | summary: (2) collapse
925 | | summary: (2) collapse
926 | |
926 | |
927 o | changeset: 1:6db2ef61d156
927 o | changeset: 1:6db2ef61d156
928 |/ user: test
928 |/ user: test
929 | date: Thu Jan 01 00:00:01 1970 +0000
929 | date: Thu Jan 01 00:00:01 1970 +0000
930 | summary: (1) collapse
930 | summary: (1) collapse
931 |
931 |
932 o changeset: 0:e6eb3150255d
932 o changeset: 0:e6eb3150255d
933 user: test
933 user: test
934 date: Thu Jan 01 00:00:00 1970 +0000
934 date: Thu Jan 01 00:00:00 1970 +0000
935 summary: (0) root
935 summary: (0) root
936
936
937
937
938
938
939 File glog per revset (only merges):
939 File glog per revset (only merges):
940
940
941 $ hg log -G -r 'file("a")' -m
941 $ hg log -G -r 'file("a")' -m
942 o changeset: 32:d06dffa21a31
942 o changeset: 32:d06dffa21a31
943 |\ parent: 27:886ed638191b
943 |\ parent: 27:886ed638191b
944 | | parent: 31:621d83e11f67
944 | | parent: 31:621d83e11f67
945 | | user: test
945 | | user: test
946 | | date: Thu Jan 01 00:00:32 1970 +0000
946 | | date: Thu Jan 01 00:00:32 1970 +0000
947 | | summary: (32) expand
947 | | summary: (32) expand
948 | |
948 | |
949 o | changeset: 31:621d83e11f67
949 o | changeset: 31:621d83e11f67
950 |\| parent: 21:d42a756af44d
950 |\| parent: 21:d42a756af44d
951 | | parent: 30:6e11cd4b648f
951 | | parent: 30:6e11cd4b648f
952 | | user: test
952 | | user: test
953 | | date: Thu Jan 01 00:00:31 1970 +0000
953 | | date: Thu Jan 01 00:00:31 1970 +0000
954 | | summary: (31) expand
954 | | summary: (31) expand
955 | |
955 | |
956 o | changeset: 30:6e11cd4b648f
956 o | changeset: 30:6e11cd4b648f
957 |\ \ parent: 28:44ecd0b9ae99
957 |\ \ parent: 28:44ecd0b9ae99
958 | | | parent: 29:cd9bb2be7593
958 | | | parent: 29:cd9bb2be7593
959 | | | user: test
959 | | | user: test
960 | | | date: Thu Jan 01 00:00:30 1970 +0000
960 | | | date: Thu Jan 01 00:00:30 1970 +0000
961 | | | summary: (30) expand
961 | | | summary: (30) expand
962 | | |
962 | | |
963 o | | changeset: 28:44ecd0b9ae99
963 o | | changeset: 28:44ecd0b9ae99
964 |\ \ \ parent: 1:6db2ef61d156
964 |\ \ \ parent: 1:6db2ef61d156
965 | | | | parent: 26:7f25b6c2f0b9
965 | | | | parent: 26:7f25b6c2f0b9
966 | | | | user: test
966 | | | | user: test
967 | | | | date: Thu Jan 01 00:00:28 1970 +0000
967 | | | | date: Thu Jan 01 00:00:28 1970 +0000
968 | | | | summary: (28) merge zero known
968 | | | | summary: (28) merge zero known
969 | | | |
969 | | | |
970 o | | | changeset: 26:7f25b6c2f0b9
970 o | | | changeset: 26:7f25b6c2f0b9
971 |\ \ \ \ parent: 18:1aa84d96232a
971 |\ \ \ \ parent: 18:1aa84d96232a
972 | | | | | parent: 25:91da8ed57247
972 | | | | | parent: 25:91da8ed57247
973 | | | | | user: test
973 | | | | | user: test
974 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
974 | | | | | date: Thu Jan 01 00:00:26 1970 +0000
975 | | | | | summary: (26) merge one known; far right
975 | | | | | summary: (26) merge one known; far right
976 | | | | |
976 | | | | |
977 | o-----+ changeset: 25:91da8ed57247
977 | o-----+ changeset: 25:91da8ed57247
978 | | | | | parent: 21:d42a756af44d
978 | | | | | parent: 21:d42a756af44d
979 | | | | | parent: 24:a9c19a3d96b7
979 | | | | | parent: 24:a9c19a3d96b7
980 | | | | | user: test
980 | | | | | user: test
981 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
981 | | | | | date: Thu Jan 01 00:00:25 1970 +0000
982 | | | | | summary: (25) merge one known; far left
982 | | | | | summary: (25) merge one known; far left
983 | | | | |
983 | | | | |
984 | o | | | changeset: 24:a9c19a3d96b7
984 | o | | | changeset: 24:a9c19a3d96b7
985 | |\ \ \ \ parent: 0:e6eb3150255d
985 | |\ \ \ \ parent: 0:e6eb3150255d
986 | | | | | | parent: 23:a01cddf0766d
986 | | | | | | parent: 23:a01cddf0766d
987 | | | | | | user: test
987 | | | | | | user: test
988 | | | | | | date: Thu Jan 01 00:00:24 1970 +0000
988 | | | | | | date: Thu Jan 01 00:00:24 1970 +0000
989 | | | | | | summary: (24) merge one known; immediate right
989 | | | | | | summary: (24) merge one known; immediate right
990 | | | | | |
990 | | | | | |
991 | o---+ | | changeset: 23:a01cddf0766d
991 | o---+ | | changeset: 23:a01cddf0766d
992 | | | | | | parent: 1:6db2ef61d156
992 | | | | | | parent: 1:6db2ef61d156
993 | | | | | | parent: 22:e0d9cccacb5d
993 | | | | | | parent: 22:e0d9cccacb5d
994 | | | | | | user: test
994 | | | | | | user: test
995 | | | | | | date: Thu Jan 01 00:00:23 1970 +0000
995 | | | | | | date: Thu Jan 01 00:00:23 1970 +0000
996 | | | | | | summary: (23) merge one known; immediate left
996 | | | | | | summary: (23) merge one known; immediate left
997 | | | | | |
997 | | | | | |
998 | o-------+ changeset: 22:e0d9cccacb5d
998 | o-------+ changeset: 22:e0d9cccacb5d
999 | | | | | | parent: 18:1aa84d96232a
999 | | | | | | parent: 18:1aa84d96232a
1000 |/ / / / / parent: 21:d42a756af44d
1000 |/ / / / / parent: 21:d42a756af44d
1001 | | | | | user: test
1001 | | | | | user: test
1002 | | | | | date: Thu Jan 01 00:00:22 1970 +0000
1002 | | | | | date: Thu Jan 01 00:00:22 1970 +0000
1003 | | | | | summary: (22) merge two known; one far left, one far right
1003 | | | | | summary: (22) merge two known; one far left, one far right
1004 | | | | |
1004 | | | | |
1005 | | | | o changeset: 21:d42a756af44d
1005 | | | | o changeset: 21:d42a756af44d
1006 | | | | |\ parent: 19:31ddc2c1573b
1006 | | | | |\ parent: 19:31ddc2c1573b
1007 | | | | | | parent: 20:d30ed6450e32
1007 | | | | | | parent: 20:d30ed6450e32
1008 | | | | | | user: test
1008 | | | | | | user: test
1009 | | | | | | date: Thu Jan 01 00:00:21 1970 +0000
1009 | | | | | | date: Thu Jan 01 00:00:21 1970 +0000
1010 | | | | | | summary: (21) expand
1010 | | | | | | summary: (21) expand
1011 | | | | | |
1011 | | | | | |
1012 +-+-------o changeset: 20:d30ed6450e32
1012 +-+-------o changeset: 20:d30ed6450e32
1013 | | | | | parent: 0:e6eb3150255d
1013 | | | | | parent: 0:e6eb3150255d
1014 | | | | | parent: 18:1aa84d96232a
1014 | | | | | parent: 18:1aa84d96232a
1015 | | | | | user: test
1015 | | | | | user: test
1016 | | | | | date: Thu Jan 01 00:00:20 1970 +0000
1016 | | | | | date: Thu Jan 01 00:00:20 1970 +0000
1017 | | | | | summary: (20) merge two known; two far right
1017 | | | | | summary: (20) merge two known; two far right
1018 | | | | |
1018 | | | | |
1019 | | | | o changeset: 19:31ddc2c1573b
1019 | | | | o changeset: 19:31ddc2c1573b
1020 | | | | |\ parent: 15:1dda3f72782d
1020 | | | | |\ parent: 15:1dda3f72782d
1021 | | | | | | parent: 17:44765d7c06e0
1021 | | | | | | parent: 17:44765d7c06e0
1022 | | | | | | user: test
1022 | | | | | | user: test
1023 | | | | | | date: Thu Jan 01 00:00:19 1970 +0000
1023 | | | | | | date: Thu Jan 01 00:00:19 1970 +0000
1024 | | | | | | summary: (19) expand
1024 | | | | | | summary: (19) expand
1025 | | | | | |
1025 | | | | | |
1026 o---+---+ | changeset: 18:1aa84d96232a
1026 o---+---+ | changeset: 18:1aa84d96232a
1027 | | | | | parent: 1:6db2ef61d156
1027 | | | | | parent: 1:6db2ef61d156
1028 / / / / / parent: 15:1dda3f72782d
1028 / / / / / parent: 15:1dda3f72782d
1029 | | | | | user: test
1029 | | | | | user: test
1030 | | | | | date: Thu Jan 01 00:00:18 1970 +0000
1030 | | | | | date: Thu Jan 01 00:00:18 1970 +0000
1031 | | | | | summary: (18) merge two known; two far left
1031 | | | | | summary: (18) merge two known; two far left
1032 | | | | |
1032 | | | | |
1033 | | | | o changeset: 17:44765d7c06e0
1033 | | | | o changeset: 17:44765d7c06e0
1034 | | | | |\ parent: 12:86b91144a6e9
1034 | | | | |\ parent: 12:86b91144a6e9
1035 | | | | | | parent: 16:3677d192927d
1035 | | | | | | parent: 16:3677d192927d
1036 | | | | | | user: test
1036 | | | | | | user: test
1037 | | | | | | date: Thu Jan 01 00:00:17 1970 +0000
1037 | | | | | | date: Thu Jan 01 00:00:17 1970 +0000
1038 | | | | | | summary: (17) expand
1038 | | | | | | summary: (17) expand
1039 | | | | | |
1039 | | | | | |
1040 +-+-------o changeset: 16:3677d192927d
1040 +-+-------o changeset: 16:3677d192927d
1041 | | | | | parent: 0:e6eb3150255d
1041 | | | | | parent: 0:e6eb3150255d
1042 | | | | | parent: 1:6db2ef61d156
1042 | | | | | parent: 1:6db2ef61d156
1043 | | | | | user: test
1043 | | | | | user: test
1044 | | | | | date: Thu Jan 01 00:00:16 1970 +0000
1044 | | | | | date: Thu Jan 01 00:00:16 1970 +0000
1045 | | | | | summary: (16) merge two known; one immediate right, one near right
1045 | | | | | summary: (16) merge two known; one immediate right, one near right
1046 | | | | |
1046 | | | | |
1047 | | | o | changeset: 15:1dda3f72782d
1047 | | | o | changeset: 15:1dda3f72782d
1048 | | | |\ \ parent: 13:22d8966a97e3
1048 | | | |\ \ parent: 13:22d8966a97e3
1049 | | | | | | parent: 14:8eac370358ef
1049 | | | | | | parent: 14:8eac370358ef
1050 | | | | | | user: test
1050 | | | | | | user: test
1051 | | | | | | date: Thu Jan 01 00:00:15 1970 +0000
1051 | | | | | | date: Thu Jan 01 00:00:15 1970 +0000
1052 | | | | | | summary: (15) expand
1052 | | | | | | summary: (15) expand
1053 | | | | | |
1053 | | | | | |
1054 +-------o | changeset: 14:8eac370358ef
1054 +-------o | changeset: 14:8eac370358ef
1055 | | | | |/ parent: 0:e6eb3150255d
1055 | | | | |/ parent: 0:e6eb3150255d
1056 | | | | | parent: 12:86b91144a6e9
1056 | | | | | parent: 12:86b91144a6e9
1057 | | | | | user: test
1057 | | | | | user: test
1058 | | | | | date: Thu Jan 01 00:00:14 1970 +0000
1058 | | | | | date: Thu Jan 01 00:00:14 1970 +0000
1059 | | | | | summary: (14) merge two known; one immediate right, one far right
1059 | | | | | summary: (14) merge two known; one immediate right, one far right
1060 | | | | |
1060 | | | | |
1061 | | | o | changeset: 13:22d8966a97e3
1061 | | | o | changeset: 13:22d8966a97e3
1062 | | | |\ \ parent: 9:7010c0af0a35
1062 | | | |\ \ parent: 9:7010c0af0a35
1063 | | | | | | parent: 11:832d76e6bdf2
1063 | | | | | | parent: 11:832d76e6bdf2
1064 | | | | | | user: test
1064 | | | | | | user: test
1065 | | | | | | date: Thu Jan 01 00:00:13 1970 +0000
1065 | | | | | | date: Thu Jan 01 00:00:13 1970 +0000
1066 | | | | | | summary: (13) expand
1066 | | | | | | summary: (13) expand
1067 | | | | | |
1067 | | | | | |
1068 | +---+---o changeset: 12:86b91144a6e9
1068 | +---+---o changeset: 12:86b91144a6e9
1069 | | | | | parent: 1:6db2ef61d156
1069 | | | | | parent: 1:6db2ef61d156
1070 | | | | | parent: 9:7010c0af0a35
1070 | | | | | parent: 9:7010c0af0a35
1071 | | | | | user: test
1071 | | | | | user: test
1072 | | | | | date: Thu Jan 01 00:00:12 1970 +0000
1072 | | | | | date: Thu Jan 01 00:00:12 1970 +0000
1073 | | | | | summary: (12) merge two known; one immediate right, one far left
1073 | | | | | summary: (12) merge two known; one immediate right, one far left
1074 | | | | |
1074 | | | | |
1075 | | | | o changeset: 11:832d76e6bdf2
1075 | | | | o changeset: 11:832d76e6bdf2
1076 | | | | |\ parent: 6:b105a072e251
1076 | | | | |\ parent: 6:b105a072e251
1077 | | | | | | parent: 10:74c64d036d72
1077 | | | | | | parent: 10:74c64d036d72
1078 | | | | | | user: test
1078 | | | | | | user: test
1079 | | | | | | date: Thu Jan 01 00:00:11 1970 +0000
1079 | | | | | | date: Thu Jan 01 00:00:11 1970 +0000
1080 | | | | | | summary: (11) expand
1080 | | | | | | summary: (11) expand
1081 | | | | | |
1081 | | | | | |
1082 +---------o changeset: 10:74c64d036d72
1082 +---------o changeset: 10:74c64d036d72
1083 | | | | |/ parent: 0:e6eb3150255d
1083 | | | | |/ parent: 0:e6eb3150255d
1084 | | | | | parent: 6:b105a072e251
1084 | | | | | parent: 6:b105a072e251
1085 | | | | | user: test
1085 | | | | | user: test
1086 | | | | | date: Thu Jan 01 00:00:10 1970 +0000
1086 | | | | | date: Thu Jan 01 00:00:10 1970 +0000
1087 | | | | | summary: (10) merge two known; one immediate left, one near right
1087 | | | | | summary: (10) merge two known; one immediate left, one near right
1088 | | | | |
1088 | | | | |
1089 | | | o | changeset: 9:7010c0af0a35
1089 | | | o | changeset: 9:7010c0af0a35
1090 | | | |\ \ parent: 7:b632bb1b1224
1090 | | | |\ \ parent: 7:b632bb1b1224
1091 | | | | | | parent: 8:7a0b11f71937
1091 | | | | | | parent: 8:7a0b11f71937
1092 | | | | | | user: test
1092 | | | | | | user: test
1093 | | | | | | date: Thu Jan 01 00:00:09 1970 +0000
1093 | | | | | | date: Thu Jan 01 00:00:09 1970 +0000
1094 | | | | | | summary: (9) expand
1094 | | | | | | summary: (9) expand
1095 | | | | | |
1095 | | | | | |
1096 +-------o | changeset: 8:7a0b11f71937
1096 +-------o | changeset: 8:7a0b11f71937
1097 | | | |/ / parent: 0:e6eb3150255d
1097 | | | |/ / parent: 0:e6eb3150255d
1098 | | | | | parent: 7:b632bb1b1224
1098 | | | | | parent: 7:b632bb1b1224
1099 | | | | | user: test
1099 | | | | | user: test
1100 | | | | | date: Thu Jan 01 00:00:08 1970 +0000
1100 | | | | | date: Thu Jan 01 00:00:08 1970 +0000
1101 | | | | | summary: (8) merge two known; one immediate left, one far right
1101 | | | | | summary: (8) merge two known; one immediate left, one far right
1102 | | | | |
1102 | | | | |
1103 | | | o | changeset: 7:b632bb1b1224
1103 | | | o | changeset: 7:b632bb1b1224
1104 | | | |\ \ parent: 2:3d9a33b8d1e1
1104 | | | |\ \ parent: 2:3d9a33b8d1e1
1105 | | | | | | parent: 5:4409d547b708
1105 | | | | | | parent: 5:4409d547b708
1106 | | | | | | user: test
1106 | | | | | | user: test
1107 | | | | | | date: Thu Jan 01 00:00:07 1970 +0000
1107 | | | | | | date: Thu Jan 01 00:00:07 1970 +0000
1108 | | | | | | summary: (7) expand
1108 | | | | | | summary: (7) expand
1109 | | | | | |
1109 | | | | | |
1110 | | | +---o changeset: 6:b105a072e251
1110 | | | +---o changeset: 6:b105a072e251
1111 | | | | |/ parent: 2:3d9a33b8d1e1
1111 | | | | |/ parent: 2:3d9a33b8d1e1
1112 | | | | | parent: 5:4409d547b708
1112 | | | | | parent: 5:4409d547b708
1113 | | | | | user: test
1113 | | | | | user: test
1114 | | | | | date: Thu Jan 01 00:00:06 1970 +0000
1114 | | | | | date: Thu Jan 01 00:00:06 1970 +0000
1115 | | | | | summary: (6) merge two known; one immediate left, one far left
1115 | | | | | summary: (6) merge two known; one immediate left, one far left
1116 | | | | |
1116 | | | | |
1117 | | | o | changeset: 5:4409d547b708
1117 | | | o | changeset: 5:4409d547b708
1118 | | | |\ \ parent: 3:27eef8ed80b4
1118 | | | |\ \ parent: 3:27eef8ed80b4
1119 | | | | | | parent: 4:26a8bac39d9f
1119 | | | | | | parent: 4:26a8bac39d9f
1120 | | | | | | user: test
1120 | | | | | | user: test
1121 | | | | | | date: Thu Jan 01 00:00:05 1970 +0000
1121 | | | | | | date: Thu Jan 01 00:00:05 1970 +0000
1122 | | | | | | summary: (5) expand
1122 | | | | | | summary: (5) expand
1123 | | | | | |
1123 | | | | | |
1124 | +---o | | changeset: 4:26a8bac39d9f
1124 | +---o | | changeset: 4:26a8bac39d9f
1125 | | | |/ / parent: 1:6db2ef61d156
1125 | | | |/ / parent: 1:6db2ef61d156
1126 | | | | | parent: 3:27eef8ed80b4
1126 | | | | | parent: 3:27eef8ed80b4
1127 | | | | | user: test
1127 | | | | | user: test
1128 | | | | | date: Thu Jan 01 00:00:04 1970 +0000
1128 | | | | | date: Thu Jan 01 00:00:04 1970 +0000
1129 | | | | | summary: (4) merge two known; one immediate left, one immediate right
1129 | | | | | summary: (4) merge two known; one immediate left, one immediate right
1130 | | | | |
1130 | | | | |
1131
1131
1132
1132
1133 Empty revision range - display nothing:
1133 Empty revision range - display nothing:
1134 $ hg glog -r 1..0
1134 $ hg glog -r 1..0
1135
1135
1136 $ cd ..
1136 $ cd ..
1137
1137
1138 #if no-outer-repo
1138 #if no-outer-repo
1139
1139
1140 From outer space:
1140 From outer space:
1141 $ hg glog -l1 repo
1141 $ hg glog -l1 repo
1142 @ changeset: 34:fea3ac5810e0
1142 @ changeset: 34:fea3ac5810e0
1143 | tag: tip
1143 | tag: tip
1144 | parent: 32:d06dffa21a31
1144 | parent: 32:d06dffa21a31
1145 | user: test
1145 | user: test
1146 | date: Thu Jan 01 00:00:34 1970 +0000
1146 | date: Thu Jan 01 00:00:34 1970 +0000
1147 | summary: (34) head
1147 | summary: (34) head
1148 |
1148 |
1149 $ hg glog -l1 repo/a
1149 $ hg glog -l1 repo/a
1150 @ changeset: 34:fea3ac5810e0
1150 @ changeset: 34:fea3ac5810e0
1151 | tag: tip
1151 | tag: tip
1152 | parent: 32:d06dffa21a31
1152 | parent: 32:d06dffa21a31
1153 | user: test
1153 | user: test
1154 | date: Thu Jan 01 00:00:34 1970 +0000
1154 | date: Thu Jan 01 00:00:34 1970 +0000
1155 | summary: (34) head
1155 | summary: (34) head
1156 |
1156 |
1157 $ hg glog -l1 repo/missing
1157 $ hg glog -l1 repo/missing
1158
1158
1159 #endif
1159 #endif
1160
1160
1161 File log with revs != cset revs:
1161 File log with revs != cset revs:
1162 $ hg init flog
1162 $ hg init flog
1163 $ cd flog
1163 $ cd flog
1164 $ echo one >one
1164 $ echo one >one
1165 $ hg add one
1165 $ hg add one
1166 $ hg commit -mone
1166 $ hg commit -mone
1167 $ echo two >two
1167 $ echo two >two
1168 $ hg add two
1168 $ hg add two
1169 $ hg commit -mtwo
1169 $ hg commit -mtwo
1170 $ echo more >two
1170 $ echo more >two
1171 $ hg commit -mmore
1171 $ hg commit -mmore
1172 $ hg glog two
1172 $ hg glog two
1173 @ changeset: 2:12c28321755b
1173 @ changeset: 2:12c28321755b
1174 | tag: tip
1174 | tag: tip
1175 | user: test
1175 | user: test
1176 | date: Thu Jan 01 00:00:00 1970 +0000
1176 | date: Thu Jan 01 00:00:00 1970 +0000
1177 | summary: more
1177 | summary: more
1178 |
1178 |
1179 o changeset: 1:5ac72c0599bf
1179 o changeset: 1:5ac72c0599bf
1180 | user: test
1180 | user: test
1181 | date: Thu Jan 01 00:00:00 1970 +0000
1181 | date: Thu Jan 01 00:00:00 1970 +0000
1182 | summary: two
1182 | summary: two
1183 |
1183 |
1184
1184
1185 Issue1896: File log with explicit style
1185 Issue1896: File log with explicit style
1186 $ hg glog --style=default one
1186 $ hg glog --style=default one
1187 o changeset: 0:3d578b4a1f53
1187 o changeset: 0:3d578b4a1f53
1188 user: test
1188 user: test
1189 date: Thu Jan 01 00:00:00 1970 +0000
1189 date: Thu Jan 01 00:00:00 1970 +0000
1190 summary: one
1190 summary: one
1191
1191
1192 Issue2395: glog --style header and footer
1192 Issue2395: glog --style header and footer
1193 $ hg glog --style=xml one
1193 $ hg glog --style=xml one
1194 <?xml version="1.0"?>
1194 <?xml version="1.0"?>
1195 <log>
1195 <log>
1196 o <logentry revision="0" node="3d578b4a1f537d5fcf7301bfa9c0b97adfaa6fb1">
1196 o <logentry revision="0" node="3d578b4a1f537d5fcf7301bfa9c0b97adfaa6fb1">
1197 <author email="test">test</author>
1197 <author email="test">test</author>
1198 <date>1970-01-01T00:00:00+00:00</date>
1198 <date>1970-01-01T00:00:00+00:00</date>
1199 <msg xml:space="preserve">one</msg>
1199 <msg xml:space="preserve">one</msg>
1200 </logentry>
1200 </logentry>
1201 </log>
1201 </log>
1202
1202
1203 $ cd ..
1203 $ cd ..
1204
1204
1205 Incoming and outgoing:
1205 Incoming and outgoing:
1206
1206
1207 $ hg clone -U -r31 repo repo2
1207 $ hg clone -U -r31 repo repo2
1208 adding changesets
1208 adding changesets
1209 adding manifests
1209 adding manifests
1210 adding file changes
1210 adding file changes
1211 added 31 changesets with 31 changes to 1 files
1211 added 31 changesets with 31 changes to 1 files
1212 $ cd repo2
1212 $ cd repo2
1213
1213
1214 $ hg incoming --graph ../repo
1214 $ hg incoming --graph ../repo
1215 comparing with ../repo
1215 comparing with ../repo
1216 searching for changes
1216 searching for changes
1217 o changeset: 34:fea3ac5810e0
1217 o changeset: 34:fea3ac5810e0
1218 | tag: tip
1218 | tag: tip
1219 | parent: 32:d06dffa21a31
1219 | parent: 32:d06dffa21a31
1220 | user: test
1220 | user: test
1221 | date: Thu Jan 01 00:00:34 1970 +0000
1221 | date: Thu Jan 01 00:00:34 1970 +0000
1222 | summary: (34) head
1222 | summary: (34) head
1223 |
1223 |
1224 | o changeset: 33:68608f5145f9
1224 | o changeset: 33:68608f5145f9
1225 | parent: 18:1aa84d96232a
1225 | parent: 18:1aa84d96232a
1226 | user: test
1226 | user: test
1227 | date: Thu Jan 01 00:00:33 1970 +0000
1227 | date: Thu Jan 01 00:00:33 1970 +0000
1228 | summary: (33) head
1228 | summary: (33) head
1229 |
1229 |
1230 o changeset: 32:d06dffa21a31
1230 o changeset: 32:d06dffa21a31
1231 | parent: 27:886ed638191b
1231 | parent: 27:886ed638191b
1232 | parent: 31:621d83e11f67
1232 | parent: 31:621d83e11f67
1233 | user: test
1233 | user: test
1234 | date: Thu Jan 01 00:00:32 1970 +0000
1234 | date: Thu Jan 01 00:00:32 1970 +0000
1235 | summary: (32) expand
1235 | summary: (32) expand
1236 |
1236 |
1237 o changeset: 27:886ed638191b
1237 o changeset: 27:886ed638191b
1238 parent: 21:d42a756af44d
1238 parent: 21:d42a756af44d
1239 user: test
1239 user: test
1240 date: Thu Jan 01 00:00:27 1970 +0000
1240 date: Thu Jan 01 00:00:27 1970 +0000
1241 summary: (27) collapse
1241 summary: (27) collapse
1242
1242
1243 $ cd ..
1243 $ cd ..
1244
1244
1245 $ hg -R repo outgoing --graph repo2
1245 $ hg -R repo outgoing --graph repo2
1246 comparing with repo2
1246 comparing with repo2
1247 searching for changes
1247 searching for changes
1248 @ changeset: 34:fea3ac5810e0
1248 @ changeset: 34:fea3ac5810e0
1249 | tag: tip
1249 | tag: tip
1250 | parent: 32:d06dffa21a31
1250 | parent: 32:d06dffa21a31
1251 | user: test
1251 | user: test
1252 | date: Thu Jan 01 00:00:34 1970 +0000
1252 | date: Thu Jan 01 00:00:34 1970 +0000
1253 | summary: (34) head
1253 | summary: (34) head
1254 |
1254 |
1255 | o changeset: 33:68608f5145f9
1255 | o changeset: 33:68608f5145f9
1256 | parent: 18:1aa84d96232a
1256 | parent: 18:1aa84d96232a
1257 | user: test
1257 | user: test
1258 | date: Thu Jan 01 00:00:33 1970 +0000
1258 | date: Thu Jan 01 00:00:33 1970 +0000
1259 | summary: (33) head
1259 | summary: (33) head
1260 |
1260 |
1261 o changeset: 32:d06dffa21a31
1261 o changeset: 32:d06dffa21a31
1262 | parent: 27:886ed638191b
1262 | parent: 27:886ed638191b
1263 | parent: 31:621d83e11f67
1263 | parent: 31:621d83e11f67
1264 | user: test
1264 | user: test
1265 | date: Thu Jan 01 00:00:32 1970 +0000
1265 | date: Thu Jan 01 00:00:32 1970 +0000
1266 | summary: (32) expand
1266 | summary: (32) expand
1267 |
1267 |
1268 o changeset: 27:886ed638191b
1268 o changeset: 27:886ed638191b
1269 parent: 21:d42a756af44d
1269 parent: 21:d42a756af44d
1270 user: test
1270 user: test
1271 date: Thu Jan 01 00:00:27 1970 +0000
1271 date: Thu Jan 01 00:00:27 1970 +0000
1272 summary: (27) collapse
1272 summary: (27) collapse
1273
1273
1274
1274
1275 File + limit with revs != cset revs:
1275 File + limit with revs != cset revs:
1276 $ cd repo
1276 $ cd repo
1277 $ touch b
1277 $ touch b
1278 $ hg ci -Aqm0
1278 $ hg ci -Aqm0
1279 $ hg glog -l2 a
1279 $ hg glog -l2 a
1280 o changeset: 34:fea3ac5810e0
1280 o changeset: 34:fea3ac5810e0
1281 | parent: 32:d06dffa21a31
1281 | parent: 32:d06dffa21a31
1282 | user: test
1282 | user: test
1283 | date: Thu Jan 01 00:00:34 1970 +0000
1283 | date: Thu Jan 01 00:00:34 1970 +0000
1284 | summary: (34) head
1284 | summary: (34) head
1285 |
1285 |
1286 | o changeset: 33:68608f5145f9
1286 | o changeset: 33:68608f5145f9
1287 | | parent: 18:1aa84d96232a
1287 | | parent: 18:1aa84d96232a
1288 | | user: test
1288 | | user: test
1289 | | date: Thu Jan 01 00:00:33 1970 +0000
1289 | | date: Thu Jan 01 00:00:33 1970 +0000
1290 | | summary: (33) head
1290 | | summary: (33) head
1291 | |
1291 | |
1292
1292
1293 File + limit + -ra:b, (b - a) < limit:
1293 File + limit + -ra:b, (b - a) < limit:
1294 $ hg glog -l3000 -r32:tip a
1294 $ hg glog -l3000 -r32:tip a
1295 o changeset: 34:fea3ac5810e0
1295 o changeset: 34:fea3ac5810e0
1296 | parent: 32:d06dffa21a31
1296 | parent: 32:d06dffa21a31
1297 | user: test
1297 | user: test
1298 | date: Thu Jan 01 00:00:34 1970 +0000
1298 | date: Thu Jan 01 00:00:34 1970 +0000
1299 | summary: (34) head
1299 | summary: (34) head
1300 |
1300 |
1301 | o changeset: 33:68608f5145f9
1301 | o changeset: 33:68608f5145f9
1302 | | parent: 18:1aa84d96232a
1302 | | parent: 18:1aa84d96232a
1303 | | user: test
1303 | | user: test
1304 | | date: Thu Jan 01 00:00:33 1970 +0000
1304 | | date: Thu Jan 01 00:00:33 1970 +0000
1305 | | summary: (33) head
1305 | | summary: (33) head
1306 | |
1306 | |
1307 o | changeset: 32:d06dffa21a31
1307 o | changeset: 32:d06dffa21a31
1308 |\ \ parent: 27:886ed638191b
1308 |\ \ parent: 27:886ed638191b
1309 | | | parent: 31:621d83e11f67
1309 | | | parent: 31:621d83e11f67
1310 | | | user: test
1310 | | | user: test
1311 | | | date: Thu Jan 01 00:00:32 1970 +0000
1311 | | | date: Thu Jan 01 00:00:32 1970 +0000
1312 | | | summary: (32) expand
1312 | | | summary: (32) expand
1313 | | |
1313 | | |
1314
1314
1315 Point out a common and an uncommon unshown parent
1315 Point out a common and an uncommon unshown parent
1316
1316
1317 $ hg glog -r 'rev(8) or rev(9)'
1317 $ hg glog -r 'rev(8) or rev(9)'
1318 o changeset: 9:7010c0af0a35
1318 o changeset: 9:7010c0af0a35
1319 |\ parent: 7:b632bb1b1224
1319 |\ parent: 7:b632bb1b1224
1320 | | parent: 8:7a0b11f71937
1320 | | parent: 8:7a0b11f71937
1321 | | user: test
1321 | | user: test
1322 | | date: Thu Jan 01 00:00:09 1970 +0000
1322 | | date: Thu Jan 01 00:00:09 1970 +0000
1323 | | summary: (9) expand
1323 | | summary: (9) expand
1324 | |
1324 | |
1325 o | changeset: 8:7a0b11f71937
1325 o | changeset: 8:7a0b11f71937
1326 |\| parent: 0:e6eb3150255d
1326 |\| parent: 0:e6eb3150255d
1327 | | parent: 7:b632bb1b1224
1327 | | parent: 7:b632bb1b1224
1328 | | user: test
1328 | | user: test
1329 | | date: Thu Jan 01 00:00:08 1970 +0000
1329 | | date: Thu Jan 01 00:00:08 1970 +0000
1330 | | summary: (8) merge two known; one immediate left, one far right
1330 | | summary: (8) merge two known; one immediate left, one far right
1331 | |
1331 | |
1332
1332
1333 File + limit + -ra:b, b < tip:
1333 File + limit + -ra:b, b < tip:
1334
1334
1335 $ hg glog -l1 -r32:34 a
1335 $ hg glog -l1 -r32:34 a
1336 o changeset: 34:fea3ac5810e0
1336 o changeset: 34:fea3ac5810e0
1337 | parent: 32:d06dffa21a31
1337 | parent: 32:d06dffa21a31
1338 | user: test
1338 | user: test
1339 | date: Thu Jan 01 00:00:34 1970 +0000
1339 | date: Thu Jan 01 00:00:34 1970 +0000
1340 | summary: (34) head
1340 | summary: (34) head
1341 |
1341 |
1342
1342
1343 file(File) + limit + -ra:b, b < tip:
1343 file(File) + limit + -ra:b, b < tip:
1344
1344
1345 $ hg glog -l1 -r32:34 -r 'file("a")'
1345 $ hg glog -l1 -r32:34 -r 'file("a")'
1346 o changeset: 34:fea3ac5810e0
1346 o changeset: 34:fea3ac5810e0
1347 | parent: 32:d06dffa21a31
1347 | parent: 32:d06dffa21a31
1348 | user: test
1348 | user: test
1349 | date: Thu Jan 01 00:00:34 1970 +0000
1349 | date: Thu Jan 01 00:00:34 1970 +0000
1350 | summary: (34) head
1350 | summary: (34) head
1351 |
1351 |
1352
1352
1353 limit(file(File) and a::b), b < tip:
1353 limit(file(File) and a::b), b < tip:
1354
1354
1355 $ hg glog -r 'limit(file("a") and 32::34, 1)'
1355 $ hg glog -r 'limit(file("a") and 32::34, 1)'
1356 o changeset: 32:d06dffa21a31
1356 o changeset: 32:d06dffa21a31
1357 |\ parent: 27:886ed638191b
1357 |\ parent: 27:886ed638191b
1358 | | parent: 31:621d83e11f67
1358 | | parent: 31:621d83e11f67
1359 | | user: test
1359 | | user: test
1360 | | date: Thu Jan 01 00:00:32 1970 +0000
1360 | | date: Thu Jan 01 00:00:32 1970 +0000
1361 | | summary: (32) expand
1361 | | summary: (32) expand
1362 | |
1362 | |
1363
1363
1364 File + limit + -ra:b, b < tip:
1364 File + limit + -ra:b, b < tip:
1365
1365
1366 $ hg glog -r 'limit(file("a") and 34::32, 1)'
1366 $ hg glog -r 'limit(file("a") and 34::32, 1)'
1367
1367
1368 File + limit + -ra:b, b < tip, (b - a) < limit:
1368 File + limit + -ra:b, b < tip, (b - a) < limit:
1369
1369
1370 $ hg glog -l10 -r33:34 a
1370 $ hg glog -l10 -r33:34 a
1371 o changeset: 34:fea3ac5810e0
1371 o changeset: 34:fea3ac5810e0
1372 | parent: 32:d06dffa21a31
1372 | parent: 32:d06dffa21a31
1373 | user: test
1373 | user: test
1374 | date: Thu Jan 01 00:00:34 1970 +0000
1374 | date: Thu Jan 01 00:00:34 1970 +0000
1375 | summary: (34) head
1375 | summary: (34) head
1376 |
1376 |
1377 | o changeset: 33:68608f5145f9
1377 | o changeset: 33:68608f5145f9
1378 | | parent: 18:1aa84d96232a
1378 | | parent: 18:1aa84d96232a
1379 | | user: test
1379 | | user: test
1380 | | date: Thu Jan 01 00:00:33 1970 +0000
1380 | | date: Thu Jan 01 00:00:33 1970 +0000
1381 | | summary: (33) head
1381 | | summary: (33) head
1382 | |
1382 | |
1383
1383
1384 Do not crash or produce strange graphs if history is buggy
1384 Do not crash or produce strange graphs if history is buggy
1385
1385
1386 $ hg branch branch
1386 $ hg branch branch
1387 marked working directory as branch branch
1387 marked working directory as branch branch
1388 (branches are permanent and global, did you want a bookmark?)
1388 (branches are permanent and global, did you want a bookmark?)
1389 $ commit 36 "buggy merge: identical parents" 35 35
1389 $ commit 36 "buggy merge: identical parents" 35 35
1390 $ hg glog -l5
1390 $ hg glog -l5
1391 @ changeset: 36:08a19a744424
1391 @ changeset: 36:08a19a744424
1392 | branch: branch
1392 | branch: branch
1393 | tag: tip
1393 | tag: tip
1394 | parent: 35:9159c3644c5e
1394 | parent: 35:9159c3644c5e
1395 | parent: 35:9159c3644c5e
1395 | parent: 35:9159c3644c5e
1396 | user: test
1396 | user: test
1397 | date: Thu Jan 01 00:00:36 1970 +0000
1397 | date: Thu Jan 01 00:00:36 1970 +0000
1398 | summary: (36) buggy merge: identical parents
1398 | summary: (36) buggy merge: identical parents
1399 |
1399 |
1400 o changeset: 35:9159c3644c5e
1400 o changeset: 35:9159c3644c5e
1401 | user: test
1401 | user: test
1402 | date: Thu Jan 01 00:00:00 1970 +0000
1402 | date: Thu Jan 01 00:00:00 1970 +0000
1403 | summary: 0
1403 | summary: 0
1404 |
1404 |
1405 o changeset: 34:fea3ac5810e0
1405 o changeset: 34:fea3ac5810e0
1406 | parent: 32:d06dffa21a31
1406 | parent: 32:d06dffa21a31
1407 | user: test
1407 | user: test
1408 | date: Thu Jan 01 00:00:34 1970 +0000
1408 | date: Thu Jan 01 00:00:34 1970 +0000
1409 | summary: (34) head
1409 | summary: (34) head
1410 |
1410 |
1411 | o changeset: 33:68608f5145f9
1411 | o changeset: 33:68608f5145f9
1412 | | parent: 18:1aa84d96232a
1412 | | parent: 18:1aa84d96232a
1413 | | user: test
1413 | | user: test
1414 | | date: Thu Jan 01 00:00:33 1970 +0000
1414 | | date: Thu Jan 01 00:00:33 1970 +0000
1415 | | summary: (33) head
1415 | | summary: (33) head
1416 | |
1416 | |
1417 o | changeset: 32:d06dffa21a31
1417 o | changeset: 32:d06dffa21a31
1418 |\ \ parent: 27:886ed638191b
1418 |\ \ parent: 27:886ed638191b
1419 | | | parent: 31:621d83e11f67
1419 | | | parent: 31:621d83e11f67
1420 | | | user: test
1420 | | | user: test
1421 | | | date: Thu Jan 01 00:00:32 1970 +0000
1421 | | | date: Thu Jan 01 00:00:32 1970 +0000
1422 | | | summary: (32) expand
1422 | | | summary: (32) expand
1423 | | |
1423 | | |
1424
1424
1425 Test log -G options
1425 Test log -G options
1426
1426
1427 $ testlog() {
1427 $ testlog() {
1428 > hg log -G --print-revset "$@"
1428 > hg log -G --print-revset "$@"
1429 > hg log --template 'nodetag {rev}\n' "$@" | grep nodetag \
1429 > hg log --template 'nodetag {rev}\n' "$@" | grep nodetag \
1430 > | sed 's/.*nodetag/nodetag/' > log.nodes
1430 > | sed 's/.*nodetag/nodetag/' > log.nodes
1431 > hg log -G --template 'nodetag {rev}\n' "$@" | grep nodetag \
1431 > hg log -G --template 'nodetag {rev}\n' "$@" | grep nodetag \
1432 > | sed 's/.*nodetag/nodetag/' > glog.nodes
1432 > | sed 's/.*nodetag/nodetag/' > glog.nodes
1433 > diff -u log.nodes glog.nodes | grep '^[-+@ ]' || :
1433 > diff -u log.nodes glog.nodes | grep '^[-+@ ]' || :
1434 > }
1434 > }
1435
1435
1436 glog always reorders nodes which explains the difference with log
1436 glog always reorders nodes which explains the difference with log
1437
1437
1438 $ testlog -r 27 -r 25 -r 21 -r 34 -r 32 -r 31
1438 $ testlog -r 27 -r 25 -r 21 -r 34 -r 32 -r 31
1439 ['27', '25', '21', '34', '32', '31']
1439 ['27', '25', '21', '34', '32', '31']
1440 []
1440 []
1441 --- log.nodes * (glob)
1441 --- log.nodes * (glob)
1442 +++ glog.nodes * (glob)
1442 +++ glog.nodes * (glob)
1443 @@ -1,6 +1,6 @@
1443 @@ -1,6 +1,6 @@
1444 -nodetag 27
1444 -nodetag 27
1445 -nodetag 25
1445 -nodetag 25
1446 -nodetag 21
1446 -nodetag 21
1447 nodetag 34
1447 nodetag 34
1448 nodetag 32
1448 nodetag 32
1449 nodetag 31
1449 nodetag 31
1450 +nodetag 27
1450 +nodetag 27
1451 +nodetag 25
1451 +nodetag 25
1452 +nodetag 21
1452 +nodetag 21
1453 $ testlog -u test -u not-a-user
1453 $ testlog -u test -u not-a-user
1454 []
1454 []
1455 (group
1455 (group
1456 (group
1456 (group
1457 (or
1457 (or
1458 (func
1458 (func
1459 ('symbol', 'user')
1459 ('symbol', 'user')
1460 ('string', 'test'))
1460 ('string', 'test'))
1461 (func
1461 (func
1462 ('symbol', 'user')
1462 ('symbol', 'user')
1463 ('string', 'not-a-user')))))
1463 ('string', 'not-a-user')))))
1464 $ testlog -b not-a-branch
1464 $ testlog -b not-a-branch
1465 abort: unknown revision 'not-a-branch'!
1465 abort: unknown revision 'not-a-branch'!
1466 abort: unknown revision 'not-a-branch'!
1466 abort: unknown revision 'not-a-branch'!
1467 abort: unknown revision 'not-a-branch'!
1467 abort: unknown revision 'not-a-branch'!
1468 $ testlog -b 35 -b 36 --only-branch branch
1468 $ testlog -b 35 -b 36 --only-branch branch
1469 []
1469 []
1470 (group
1470 (group
1471 (group
1471 (group
1472 (or
1472 (or
1473 (or
1473 (or
1474 (func
1474 (func
1475 ('symbol', 'branch')
1475 ('symbol', 'branch')
1476 ('string', 'default'))
1476 ('string', 'default'))
1477 (func
1477 (func
1478 ('symbol', 'branch')
1478 ('symbol', 'branch')
1479 ('string', 'branch')))
1479 ('string', 'branch')))
1480 (func
1480 (func
1481 ('symbol', 'branch')
1481 ('symbol', 'branch')
1482 ('string', 'branch')))))
1482 ('string', 'branch')))))
1483 $ testlog -k expand -k merge
1483 $ testlog -k expand -k merge
1484 []
1484 []
1485 (group
1485 (group
1486 (group
1486 (group
1487 (or
1487 (or
1488 (func
1488 (func
1489 ('symbol', 'keyword')
1489 ('symbol', 'keyword')
1490 ('string', 'expand'))
1490 ('string', 'expand'))
1491 (func
1491 (func
1492 ('symbol', 'keyword')
1492 ('symbol', 'keyword')
1493 ('string', 'merge')))))
1493 ('string', 'merge')))))
1494 $ testlog --only-merges
1494 $ testlog --only-merges
1495 []
1495 []
1496 (group
1496 (group
1497 (func
1497 (func
1498 ('symbol', 'merge')
1498 ('symbol', 'merge')
1499 None))
1499 None))
1500 $ testlog --no-merges
1500 $ testlog --no-merges
1501 []
1501 []
1502 (group
1502 (group
1503 (not
1503 (not
1504 (func
1504 (func
1505 ('symbol', 'merge')
1505 ('symbol', 'merge')
1506 None)))
1506 None)))
1507 $ testlog --date '2 0 to 4 0'
1507 $ testlog --date '2 0 to 4 0'
1508 []
1508 []
1509 (group
1509 (group
1510 (func
1510 (func
1511 ('symbol', 'date')
1511 ('symbol', 'date')
1512 ('string', '2 0 to 4 0')))
1512 ('string', '2 0 to 4 0')))
1513 $ hg log -G -d 'brace ) in a date'
1513 $ hg log -G -d 'brace ) in a date'
1514 abort: invalid date: 'brace ) in a date'
1514 abort: invalid date: 'brace ) in a date'
1515 [255]
1515 [255]
1516 $ testlog --prune 31 --prune 32
1516 $ testlog --prune 31 --prune 32
1517 []
1517 []
1518 (group
1518 (group
1519 (group
1519 (group
1520 (and
1520 (and
1521 (not
1521 (not
1522 (group
1522 (group
1523 (or
1523 (or
1524 ('string', '31')
1524 ('string', '31')
1525 (func
1525 (func
1526 ('symbol', 'ancestors')
1526 ('symbol', 'ancestors')
1527 ('string', '31')))))
1527 ('string', '31')))))
1528 (not
1528 (not
1529 (group
1529 (group
1530 (or
1530 (or
1531 ('string', '32')
1531 ('string', '32')
1532 (func
1532 (func
1533 ('symbol', 'ancestors')
1533 ('symbol', 'ancestors')
1534 ('string', '32'))))))))
1534 ('string', '32'))))))))
1535
1535
1536 Dedicated repo for --follow and paths filtering. The g is crafted to
1536 Dedicated repo for --follow and paths filtering. The g is crafted to
1537 have 2 filelog topological heads in a linear changeset graph.
1537 have 2 filelog topological heads in a linear changeset graph.
1538
1538
1539 $ cd ..
1539 $ cd ..
1540 $ hg init follow
1540 $ hg init follow
1541 $ cd follow
1541 $ cd follow
1542 $ testlog --follow
1542 $ testlog --follow
1543 []
1543 []
1544 []
1544 []
1545 abort: unknown revision '0'!
1546 $ echo a > a
1545 $ echo a > a
1547 $ echo aa > aa
1546 $ echo aa > aa
1548 $ echo f > f
1547 $ echo f > f
1549 $ hg ci -Am "add a" a aa f
1548 $ hg ci -Am "add a" a aa f
1550 $ hg cp a b
1549 $ hg cp a b
1551 $ hg cp f g
1550 $ hg cp f g
1552 $ hg ci -m "copy a b"
1551 $ hg ci -m "copy a b"
1553 $ mkdir dir
1552 $ mkdir dir
1554 $ hg mv b dir
1553 $ hg mv b dir
1555 $ echo g >> g
1554 $ echo g >> g
1556 $ echo f >> f
1555 $ echo f >> f
1557 $ hg ci -m "mv b dir/b"
1556 $ hg ci -m "mv b dir/b"
1558 $ hg mv a b
1557 $ hg mv a b
1559 $ hg cp -f f g
1558 $ hg cp -f f g
1560 $ echo a > d
1559 $ echo a > d
1561 $ hg add d
1560 $ hg add d
1562 $ hg ci -m "mv a b; add d"
1561 $ hg ci -m "mv a b; add d"
1563 $ hg mv dir/b e
1562 $ hg mv dir/b e
1564 $ hg ci -m "mv dir/b e"
1563 $ hg ci -m "mv dir/b e"
1565 $ hg glog --template '({rev}) {desc|firstline}\n'
1564 $ hg glog --template '({rev}) {desc|firstline}\n'
1566 @ (4) mv dir/b e
1565 @ (4) mv dir/b e
1567 |
1566 |
1568 o (3) mv a b; add d
1567 o (3) mv a b; add d
1569 |
1568 |
1570 o (2) mv b dir/b
1569 o (2) mv b dir/b
1571 |
1570 |
1572 o (1) copy a b
1571 o (1) copy a b
1573 |
1572 |
1574 o (0) add a
1573 o (0) add a
1575
1574
1576
1575
1577 $ testlog a
1576 $ testlog a
1578 []
1577 []
1579 (group
1578 (group
1580 (group
1579 (group
1581 (func
1580 (func
1582 ('symbol', 'filelog')
1581 ('symbol', 'filelog')
1583 ('string', 'a'))))
1582 ('string', 'a'))))
1584 $ testlog a b
1583 $ testlog a b
1585 []
1584 []
1586 (group
1585 (group
1587 (group
1586 (group
1588 (or
1587 (or
1589 (func
1588 (func
1590 ('symbol', 'filelog')
1589 ('symbol', 'filelog')
1591 ('string', 'a'))
1590 ('string', 'a'))
1592 (func
1591 (func
1593 ('symbol', 'filelog')
1592 ('symbol', 'filelog')
1594 ('string', 'b')))))
1593 ('string', 'b')))))
1595
1594
1596 Test falling back to slow path for non-existing files
1595 Test falling back to slow path for non-existing files
1597
1596
1598 $ testlog a c
1597 $ testlog a c
1599 []
1598 []
1600 (group
1599 (group
1601 (func
1600 (func
1602 ('symbol', '_matchfiles')
1601 ('symbol', '_matchfiles')
1603 (list
1602 (list
1604 (list
1603 (list
1605 (list
1604 (list
1606 ('string', 'r:')
1605 ('string', 'r:')
1607 ('string', 'd:relpath'))
1606 ('string', 'd:relpath'))
1608 ('string', 'p:a'))
1607 ('string', 'p:a'))
1609 ('string', 'p:c'))))
1608 ('string', 'p:c'))))
1610
1609
1611 Test multiple --include/--exclude/paths
1610 Test multiple --include/--exclude/paths
1612
1611
1613 $ testlog --include a --include e --exclude b --exclude e a e
1612 $ testlog --include a --include e --exclude b --exclude e a e
1614 []
1613 []
1615 (group
1614 (group
1616 (func
1615 (func
1617 ('symbol', '_matchfiles')
1616 ('symbol', '_matchfiles')
1618 (list
1617 (list
1619 (list
1618 (list
1620 (list
1619 (list
1621 (list
1620 (list
1622 (list
1621 (list
1623 (list
1622 (list
1624 (list
1623 (list
1625 ('string', 'r:')
1624 ('string', 'r:')
1626 ('string', 'd:relpath'))
1625 ('string', 'd:relpath'))
1627 ('string', 'p:a'))
1626 ('string', 'p:a'))
1628 ('string', 'p:e'))
1627 ('string', 'p:e'))
1629 ('string', 'i:a'))
1628 ('string', 'i:a'))
1630 ('string', 'i:e'))
1629 ('string', 'i:e'))
1631 ('string', 'x:b'))
1630 ('string', 'x:b'))
1632 ('string', 'x:e'))))
1631 ('string', 'x:e'))))
1633
1632
1634 Test glob expansion of pats
1633 Test glob expansion of pats
1635
1634
1636 $ expandglobs=`python -c "import mercurial.util; \
1635 $ expandglobs=`python -c "import mercurial.util; \
1637 > print mercurial.util.expandglobs and 'true' or 'false'"`
1636 > print mercurial.util.expandglobs and 'true' or 'false'"`
1638 $ if [ $expandglobs = "true" ]; then
1637 $ if [ $expandglobs = "true" ]; then
1639 > testlog 'a*';
1638 > testlog 'a*';
1640 > else
1639 > else
1641 > testlog a*;
1640 > testlog a*;
1642 > fi;
1641 > fi;
1643 []
1642 []
1644 (group
1643 (group
1645 (group
1644 (group
1646 (func
1645 (func
1647 ('symbol', 'filelog')
1646 ('symbol', 'filelog')
1648 ('string', 'aa'))))
1647 ('string', 'aa'))))
1649
1648
1650 Test --follow on a directory
1649 Test --follow on a directory
1651
1650
1652 $ testlog -f dir
1651 $ testlog -f dir
1653 abort: cannot follow file not in parent revision: "dir"
1652 abort: cannot follow file not in parent revision: "dir"
1654 abort: cannot follow file not in parent revision: "dir"
1653 abort: cannot follow file not in parent revision: "dir"
1655 abort: cannot follow file not in parent revision: "dir"
1654 abort: cannot follow file not in parent revision: "dir"
1656
1655
1657 Test --follow on file not in parent revision
1656 Test --follow on file not in parent revision
1658
1657
1659 $ testlog -f a
1658 $ testlog -f a
1660 abort: cannot follow file not in parent revision: "a"
1659 abort: cannot follow file not in parent revision: "a"
1661 abort: cannot follow file not in parent revision: "a"
1660 abort: cannot follow file not in parent revision: "a"
1662 abort: cannot follow file not in parent revision: "a"
1661 abort: cannot follow file not in parent revision: "a"
1663
1662
1664 Test --follow and patterns
1663 Test --follow and patterns
1665
1664
1666 $ testlog -f 'glob:*'
1665 $ testlog -f 'glob:*'
1667 abort: can only follow copies/renames for explicit filenames
1666 abort: can only follow copies/renames for explicit filenames
1668 abort: can only follow copies/renames for explicit filenames
1667 abort: can only follow copies/renames for explicit filenames
1669 abort: can only follow copies/renames for explicit filenames
1668 abort: can only follow copies/renames for explicit filenames
1670
1669
1671 Test --follow on a single rename
1670 Test --follow on a single rename
1672
1671
1673 $ hg up -q 2
1672 $ hg up -q 2
1674 $ testlog -f a
1673 $ testlog -f a
1675 []
1674 []
1676 (group
1675 (group
1677 (group
1676 (group
1678 (func
1677 (func
1679 ('symbol', 'follow')
1678 ('symbol', 'follow')
1680 ('string', 'a'))))
1679 ('string', 'a'))))
1681
1680
1682 Test --follow and multiple renames
1681 Test --follow and multiple renames
1683
1682
1684 $ hg up -q tip
1683 $ hg up -q tip
1685 $ testlog -f e
1684 $ testlog -f e
1686 []
1685 []
1687 (group
1686 (group
1688 (group
1687 (group
1689 (func
1688 (func
1690 ('symbol', 'follow')
1689 ('symbol', 'follow')
1691 ('string', 'e'))))
1690 ('string', 'e'))))
1692
1691
1693 Test --follow and multiple filelog heads
1692 Test --follow and multiple filelog heads
1694
1693
1695 $ hg up -q 2
1694 $ hg up -q 2
1696 $ testlog -f g
1695 $ testlog -f g
1697 []
1696 []
1698 (group
1697 (group
1699 (group
1698 (group
1700 (func
1699 (func
1701 ('symbol', 'follow')
1700 ('symbol', 'follow')
1702 ('string', 'g'))))
1701 ('string', 'g'))))
1703 $ cat log.nodes
1702 $ cat log.nodes
1704 nodetag 2
1703 nodetag 2
1705 nodetag 1
1704 nodetag 1
1706 nodetag 0
1705 nodetag 0
1707 $ hg up -q tip
1706 $ hg up -q tip
1708 $ testlog -f g
1707 $ testlog -f g
1709 []
1708 []
1710 (group
1709 (group
1711 (group
1710 (group
1712 (func
1711 (func
1713 ('symbol', 'follow')
1712 ('symbol', 'follow')
1714 ('string', 'g'))))
1713 ('string', 'g'))))
1715 $ cat log.nodes
1714 $ cat log.nodes
1716 nodetag 3
1715 nodetag 3
1717 nodetag 2
1716 nodetag 2
1718 nodetag 0
1717 nodetag 0
1719
1718
1720 Test --follow and multiple files
1719 Test --follow and multiple files
1721
1720
1722 $ testlog -f g e
1721 $ testlog -f g e
1723 []
1722 []
1724 (group
1723 (group
1725 (group
1724 (group
1726 (or
1725 (or
1727 (func
1726 (func
1728 ('symbol', 'follow')
1727 ('symbol', 'follow')
1729 ('string', 'g'))
1728 ('string', 'g'))
1730 (func
1729 (func
1731 ('symbol', 'follow')
1730 ('symbol', 'follow')
1732 ('string', 'e')))))
1731 ('string', 'e')))))
1733 $ cat log.nodes
1732 $ cat log.nodes
1734 nodetag 4
1733 nodetag 4
1735 nodetag 3
1734 nodetag 3
1736 nodetag 2
1735 nodetag 2
1737 nodetag 1
1736 nodetag 1
1738 nodetag 0
1737 nodetag 0
1739
1738
1740 Test --follow-first
1739 Test --follow-first
1741
1740
1742 $ hg up -q 3
1741 $ hg up -q 3
1743 $ echo ee > e
1742 $ echo ee > e
1744 $ hg ci -Am "add another e" e
1743 $ hg ci -Am "add another e" e
1745 created new head
1744 created new head
1746 $ hg merge --tool internal:other 4
1745 $ hg merge --tool internal:other 4
1747 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
1746 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
1748 (branch merge, don't forget to commit)
1747 (branch merge, don't forget to commit)
1749 $ echo merge > e
1748 $ echo merge > e
1750 $ hg ci -m "merge 5 and 4"
1749 $ hg ci -m "merge 5 and 4"
1751 $ testlog --follow-first
1750 $ testlog --follow-first
1752 []
1751 []
1753 (group
1752 (group
1754 (func
1753 (func
1755 ('symbol', '_firstancestors')
1754 ('symbol', '_firstancestors')
1756 ('symbol', '6')))
1755 ('symbol', '6')))
1757
1756
1758 Cannot compare with log --follow-first FILE as it never worked
1757 Cannot compare with log --follow-first FILE as it never worked
1759
1758
1760 $ hg log -G --print-revset --follow-first e
1759 $ hg log -G --print-revset --follow-first e
1761 []
1760 []
1762 (group
1761 (group
1763 (group
1762 (group
1764 (func
1763 (func
1765 ('symbol', '_followfirst')
1764 ('symbol', '_followfirst')
1766 ('string', 'e'))))
1765 ('string', 'e'))))
1767 $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
1766 $ hg log -G --follow-first e --template '{rev} {desc|firstline}\n'
1768 @ 6 merge 5 and 4
1767 @ 6 merge 5 and 4
1769 |\
1768 |\
1770 o | 5 add another e
1769 o | 5 add another e
1771 | |
1770 | |
1772
1771
1773 Test --copies
1772 Test --copies
1774
1773
1775 $ hg log -G --copies --template "{rev} {desc|firstline} \
1774 $ hg log -G --copies --template "{rev} {desc|firstline} \
1776 > copies: {file_copies_switch}\n"
1775 > copies: {file_copies_switch}\n"
1777 @ 6 merge 5 and 4 copies:
1776 @ 6 merge 5 and 4 copies:
1778 |\
1777 |\
1779 | o 5 add another e copies:
1778 | o 5 add another e copies:
1780 | |
1779 | |
1781 o | 4 mv dir/b e copies: e (dir/b)
1780 o | 4 mv dir/b e copies: e (dir/b)
1782 |/
1781 |/
1783 o 3 mv a b; add d copies: b (a)g (f)
1782 o 3 mv a b; add d copies: b (a)g (f)
1784 |
1783 |
1785 o 2 mv b dir/b copies: dir/b (b)
1784 o 2 mv b dir/b copies: dir/b (b)
1786 |
1785 |
1787 o 1 copy a b copies: b (a)g (f)
1786 o 1 copy a b copies: b (a)g (f)
1788 |
1787 |
1789 o 0 add a copies:
1788 o 0 add a copies:
1790
1789
1791 Test "set:..." and parent revision
1790 Test "set:..." and parent revision
1792
1791
1793 $ hg up -q 4
1792 $ hg up -q 4
1794 $ testlog "set:copied()"
1793 $ testlog "set:copied()"
1795 []
1794 []
1796 (group
1795 (group
1797 (func
1796 (func
1798 ('symbol', '_matchfiles')
1797 ('symbol', '_matchfiles')
1799 (list
1798 (list
1800 (list
1799 (list
1801 ('string', 'r:')
1800 ('string', 'r:')
1802 ('string', 'd:relpath'))
1801 ('string', 'd:relpath'))
1803 ('string', 'p:set:copied()'))))
1802 ('string', 'p:set:copied()'))))
1804 $ testlog --include "set:copied()"
1803 $ testlog --include "set:copied()"
1805 []
1804 []
1806 (group
1805 (group
1807 (func
1806 (func
1808 ('symbol', '_matchfiles')
1807 ('symbol', '_matchfiles')
1809 (list
1808 (list
1810 (list
1809 (list
1811 ('string', 'r:')
1810 ('string', 'r:')
1812 ('string', 'd:relpath'))
1811 ('string', 'd:relpath'))
1813 ('string', 'i:set:copied()'))))
1812 ('string', 'i:set:copied()'))))
1814 $ testlog -r "sort(file('set:copied()'), -rev)"
1813 $ testlog -r "sort(file('set:copied()'), -rev)"
1815 ["sort(file('set:copied()'), -rev)"]
1814 ["sort(file('set:copied()'), -rev)"]
1816 []
1815 []
1817
1816
1818 Test --removed
1817 Test --removed
1819
1818
1820 $ testlog --removed
1819 $ testlog --removed
1821 []
1820 []
1822 []
1821 []
1823 $ testlog --removed a
1822 $ testlog --removed a
1824 []
1823 []
1825 (group
1824 (group
1826 (func
1825 (func
1827 ('symbol', '_matchfiles')
1826 ('symbol', '_matchfiles')
1828 (list
1827 (list
1829 (list
1828 (list
1830 ('string', 'r:')
1829 ('string', 'r:')
1831 ('string', 'd:relpath'))
1830 ('string', 'd:relpath'))
1832 ('string', 'p:a'))))
1831 ('string', 'p:a'))))
1833 $ testlog --removed --follow a
1832 $ testlog --removed --follow a
1834 abort: can only follow copies/renames for explicit filenames
1833 abort: can only follow copies/renames for explicit filenames
1835 abort: can only follow copies/renames for explicit filenames
1834 abort: can only follow copies/renames for explicit filenames
1836 abort: can only follow copies/renames for explicit filenames
1835 abort: can only follow copies/renames for explicit filenames
1837
1836
1838 Test --patch and --stat with --follow and --follow-first
1837 Test --patch and --stat with --follow and --follow-first
1839
1838
1840 $ hg up -q 3
1839 $ hg up -q 3
1841 $ hg log -G --git --patch b
1840 $ hg log -G --git --patch b
1842 o changeset: 1:216d4c92cf98
1841 o changeset: 1:216d4c92cf98
1843 | user: test
1842 | user: test
1844 | date: Thu Jan 01 00:00:00 1970 +0000
1843 | date: Thu Jan 01 00:00:00 1970 +0000
1845 | summary: copy a b
1844 | summary: copy a b
1846 |
1845 |
1847 | diff --git a/a b/b
1846 | diff --git a/a b/b
1848 | copy from a
1847 | copy from a
1849 | copy to b
1848 | copy to b
1850 |
1849 |
1851
1850
1852 $ hg log -G --git --stat b
1851 $ hg log -G --git --stat b
1853 o changeset: 1:216d4c92cf98
1852 o changeset: 1:216d4c92cf98
1854 | user: test
1853 | user: test
1855 | date: Thu Jan 01 00:00:00 1970 +0000
1854 | date: Thu Jan 01 00:00:00 1970 +0000
1856 | summary: copy a b
1855 | summary: copy a b
1857 |
1856 |
1858 | a | 0
1857 | a | 0
1859 | 1 files changed, 0 insertions(+), 0 deletions(-)
1858 | 1 files changed, 0 insertions(+), 0 deletions(-)
1860 |
1859 |
1861
1860
1862 $ hg log -G --git --patch --follow b
1861 $ hg log -G --git --patch --follow b
1863 o changeset: 1:216d4c92cf98
1862 o changeset: 1:216d4c92cf98
1864 | user: test
1863 | user: test
1865 | date: Thu Jan 01 00:00:00 1970 +0000
1864 | date: Thu Jan 01 00:00:00 1970 +0000
1866 | summary: copy a b
1865 | summary: copy a b
1867 |
1866 |
1868 | diff --git a/a b/b
1867 | diff --git a/a b/b
1869 | copy from a
1868 | copy from a
1870 | copy to b
1869 | copy to b
1871 |
1870 |
1872 o changeset: 0:f8035bb17114
1871 o changeset: 0:f8035bb17114
1873 user: test
1872 user: test
1874 date: Thu Jan 01 00:00:00 1970 +0000
1873 date: Thu Jan 01 00:00:00 1970 +0000
1875 summary: add a
1874 summary: add a
1876
1875
1877 diff --git a/a b/a
1876 diff --git a/a b/a
1878 new file mode 100644
1877 new file mode 100644
1879 --- /dev/null
1878 --- /dev/null
1880 +++ b/a
1879 +++ b/a
1881 @@ -0,0 +1,1 @@
1880 @@ -0,0 +1,1 @@
1882 +a
1881 +a
1883
1882
1884
1883
1885 $ hg log -G --git --stat --follow b
1884 $ hg log -G --git --stat --follow b
1886 o changeset: 1:216d4c92cf98
1885 o changeset: 1:216d4c92cf98
1887 | user: test
1886 | user: test
1888 | date: Thu Jan 01 00:00:00 1970 +0000
1887 | date: Thu Jan 01 00:00:00 1970 +0000
1889 | summary: copy a b
1888 | summary: copy a b
1890 |
1889 |
1891 | a | 0
1890 | a | 0
1892 | 1 files changed, 0 insertions(+), 0 deletions(-)
1891 | 1 files changed, 0 insertions(+), 0 deletions(-)
1893 |
1892 |
1894 o changeset: 0:f8035bb17114
1893 o changeset: 0:f8035bb17114
1895 user: test
1894 user: test
1896 date: Thu Jan 01 00:00:00 1970 +0000
1895 date: Thu Jan 01 00:00:00 1970 +0000
1897 summary: add a
1896 summary: add a
1898
1897
1899 a | 1 +
1898 a | 1 +
1900 1 files changed, 1 insertions(+), 0 deletions(-)
1899 1 files changed, 1 insertions(+), 0 deletions(-)
1901
1900
1902
1901
1903 $ hg up -q 6
1902 $ hg up -q 6
1904 $ hg log -G --git --patch --follow-first e
1903 $ hg log -G --git --patch --follow-first e
1905 @ changeset: 6:fc281d8ff18d
1904 @ changeset: 6:fc281d8ff18d
1906 |\ tag: tip
1905 |\ tag: tip
1907 | | parent: 5:99b31f1c2782
1906 | | parent: 5:99b31f1c2782
1908 | | parent: 4:17d952250a9d
1907 | | parent: 4:17d952250a9d
1909 | | user: test
1908 | | user: test
1910 | | date: Thu Jan 01 00:00:00 1970 +0000
1909 | | date: Thu Jan 01 00:00:00 1970 +0000
1911 | | summary: merge 5 and 4
1910 | | summary: merge 5 and 4
1912 | |
1911 | |
1913 | | diff --git a/e b/e
1912 | | diff --git a/e b/e
1914 | | --- a/e
1913 | | --- a/e
1915 | | +++ b/e
1914 | | +++ b/e
1916 | | @@ -1,1 +1,1 @@
1915 | | @@ -1,1 +1,1 @@
1917 | | -ee
1916 | | -ee
1918 | | +merge
1917 | | +merge
1919 | |
1918 | |
1920 o | changeset: 5:99b31f1c2782
1919 o | changeset: 5:99b31f1c2782
1921 | | parent: 3:5918b8d165d1
1920 | | parent: 3:5918b8d165d1
1922 | | user: test
1921 | | user: test
1923 | | date: Thu Jan 01 00:00:00 1970 +0000
1922 | | date: Thu Jan 01 00:00:00 1970 +0000
1924 | | summary: add another e
1923 | | summary: add another e
1925 | |
1924 | |
1926 | | diff --git a/e b/e
1925 | | diff --git a/e b/e
1927 | | new file mode 100644
1926 | | new file mode 100644
1928 | | --- /dev/null
1927 | | --- /dev/null
1929 | | +++ b/e
1928 | | +++ b/e
1930 | | @@ -0,0 +1,1 @@
1929 | | @@ -0,0 +1,1 @@
1931 | | +ee
1930 | | +ee
1932 | |
1931 | |
1933
1932
1934 Test old-style --rev
1933 Test old-style --rev
1935
1934
1936 $ hg tag 'foo-bar'
1935 $ hg tag 'foo-bar'
1937 $ testlog -r 'foo-bar'
1936 $ testlog -r 'foo-bar'
1938 ['foo-bar']
1937 ['foo-bar']
1939 []
1938 []
1940
1939
1941 Test --follow and forward --rev
1940 Test --follow and forward --rev
1942
1941
1943 $ hg up -q 6
1942 $ hg up -q 6
1944 $ echo g > g
1943 $ echo g > g
1945 $ hg ci -Am 'add g' g
1944 $ hg ci -Am 'add g' g
1946 created new head
1945 created new head
1947 $ hg up -q 2
1946 $ hg up -q 2
1948 $ hg log -G --template "{rev} {desc|firstline}\n"
1947 $ hg log -G --template "{rev} {desc|firstline}\n"
1949 o 8 add g
1948 o 8 add g
1950 |
1949 |
1951 | o 7 Added tag foo-bar for changeset fc281d8ff18d
1950 | o 7 Added tag foo-bar for changeset fc281d8ff18d
1952 |/
1951 |/
1953 o 6 merge 5 and 4
1952 o 6 merge 5 and 4
1954 |\
1953 |\
1955 | o 5 add another e
1954 | o 5 add another e
1956 | |
1955 | |
1957 o | 4 mv dir/b e
1956 o | 4 mv dir/b e
1958 |/
1957 |/
1959 o 3 mv a b; add d
1958 o 3 mv a b; add d
1960 |
1959 |
1961 @ 2 mv b dir/b
1960 @ 2 mv b dir/b
1962 |
1961 |
1963 o 1 copy a b
1962 o 1 copy a b
1964 |
1963 |
1965 o 0 add a
1964 o 0 add a
1966
1965
1967 $ testlog --follow -r6 -r8 -r5 -r7 -r4
1966 $ testlog --follow -r6 -r8 -r5 -r7 -r4
1968 ['6', '8', '5', '7', '4']
1967 ['6', '8', '5', '7', '4']
1969 (group
1968 (group
1970 (func
1969 (func
1971 ('symbol', 'descendants')
1970 ('symbol', 'descendants')
1972 ('symbol', '6')))
1971 ('symbol', '6')))
1973 --- log.nodes * (glob)
1972 --- log.nodes * (glob)
1974 +++ glog.nodes * (glob)
1973 +++ glog.nodes * (glob)
1975 @@ -1,3 +1,3 @@
1974 @@ -1,3 +1,3 @@
1976 -nodetag 6
1975 -nodetag 6
1977 nodetag 8
1976 nodetag 8
1978 nodetag 7
1977 nodetag 7
1979 +nodetag 6
1978 +nodetag 6
1980
1979
1981 Test --follow-first and forward --rev
1980 Test --follow-first and forward --rev
1982
1981
1983 $ testlog --follow-first -r6 -r8 -r5 -r7 -r4
1982 $ testlog --follow-first -r6 -r8 -r5 -r7 -r4
1984 ['6', '8', '5', '7', '4']
1983 ['6', '8', '5', '7', '4']
1985 (group
1984 (group
1986 (func
1985 (func
1987 ('symbol', '_firstdescendants')
1986 ('symbol', '_firstdescendants')
1988 ('symbol', '6')))
1987 ('symbol', '6')))
1989 --- log.nodes * (glob)
1988 --- log.nodes * (glob)
1990 +++ glog.nodes * (glob)
1989 +++ glog.nodes * (glob)
1991 @@ -1,3 +1,3 @@
1990 @@ -1,3 +1,3 @@
1992 -nodetag 6
1991 -nodetag 6
1993 nodetag 8
1992 nodetag 8
1994 nodetag 7
1993 nodetag 7
1995 +nodetag 6
1994 +nodetag 6
1996
1995
1997 Test --follow and backward --rev
1996 Test --follow and backward --rev
1998
1997
1999 $ testlog --follow -r6 -r5 -r7 -r8 -r4
1998 $ testlog --follow -r6 -r5 -r7 -r8 -r4
2000 ['6', '5', '7', '8', '4']
1999 ['6', '5', '7', '8', '4']
2001 (group
2000 (group
2002 (func
2001 (func
2003 ('symbol', 'ancestors')
2002 ('symbol', 'ancestors')
2004 ('symbol', '6')))
2003 ('symbol', '6')))
2005
2004
2006 Test --follow-first and backward --rev
2005 Test --follow-first and backward --rev
2007
2006
2008 $ testlog --follow-first -r6 -r5 -r7 -r8 -r4
2007 $ testlog --follow-first -r6 -r5 -r7 -r8 -r4
2009 ['6', '5', '7', '8', '4']
2008 ['6', '5', '7', '8', '4']
2010 (group
2009 (group
2011 (func
2010 (func
2012 ('symbol', '_firstancestors')
2011 ('symbol', '_firstancestors')
2013 ('symbol', '6')))
2012 ('symbol', '6')))
2014
2013
2015 Test subdir
2014 Test subdir
2016
2015
2017 $ hg up -q 3
2016 $ hg up -q 3
2018 $ cd dir
2017 $ cd dir
2019 $ testlog .
2018 $ testlog .
2020 []
2019 []
2021 (group
2020 (group
2022 (func
2021 (func
2023 ('symbol', '_matchfiles')
2022 ('symbol', '_matchfiles')
2024 (list
2023 (list
2025 (list
2024 (list
2026 ('string', 'r:')
2025 ('string', 'r:')
2027 ('string', 'd:relpath'))
2026 ('string', 'd:relpath'))
2028 ('string', 'p:.'))))
2027 ('string', 'p:.'))))
2029 $ testlog ../b
2028 $ testlog ../b
2030 []
2029 []
2031 (group
2030 (group
2032 (group
2031 (group
2033 (func
2032 (func
2034 ('symbol', 'filelog')
2033 ('symbol', 'filelog')
2035 ('string', '../b'))))
2034 ('string', '../b'))))
2036 $ testlog -f ../b
2035 $ testlog -f ../b
2037 []
2036 []
2038 (group
2037 (group
2039 (group
2038 (group
2040 (func
2039 (func
2041 ('symbol', 'follow')
2040 ('symbol', 'follow')
2042 ('string', 'b'))))
2041 ('string', 'b'))))
2043 $ cd ..
2042 $ cd ..
2044
2043
2045 Test --hidden
2044 Test --hidden
2046 (enable obsolete)
2045 (enable obsolete)
2047
2046
2048 $ cat > ${TESTTMP}/obs.py << EOF
2047 $ cat > ${TESTTMP}/obs.py << EOF
2049 > import mercurial.obsolete
2048 > import mercurial.obsolete
2050 > mercurial.obsolete._enabled = True
2049 > mercurial.obsolete._enabled = True
2051 > EOF
2050 > EOF
2052 $ echo '[extensions]' >> $HGRCPATH
2051 $ echo '[extensions]' >> $HGRCPATH
2053 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
2052 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
2054
2053
2055 $ hg debugobsolete `hg id --debug -i -r 8`
2054 $ hg debugobsolete `hg id --debug -i -r 8`
2056 $ testlog
2055 $ testlog
2057 []
2056 []
2058 []
2057 []
2059 $ testlog --hidden
2058 $ testlog --hidden
2060 []
2059 []
2061 []
2060 []
2062 $ hg glog --template '{rev} {desc}\n'
2061 $ hg glog --template '{rev} {desc}\n'
2063 o 7 Added tag foo-bar for changeset fc281d8ff18d
2062 o 7 Added tag foo-bar for changeset fc281d8ff18d
2064 |
2063 |
2065 o 6 merge 5 and 4
2064 o 6 merge 5 and 4
2066 |\
2065 |\
2067 | o 5 add another e
2066 | o 5 add another e
2068 | |
2067 | |
2069 o | 4 mv dir/b e
2068 o | 4 mv dir/b e
2070 |/
2069 |/
2071 @ 3 mv a b; add d
2070 @ 3 mv a b; add d
2072 |
2071 |
2073 o 2 mv b dir/b
2072 o 2 mv b dir/b
2074 |
2073 |
2075 o 1 copy a b
2074 o 1 copy a b
2076 |
2075 |
2077 o 0 add a
2076 o 0 add a
2078
2077
2079
2078
2080 A template without trailing newline should do something sane
2079 A template without trailing newline should do something sane
2081
2080
2082 $ hg glog -r ::2 --template '{rev} {desc}'
2081 $ hg glog -r ::2 --template '{rev} {desc}'
2083 o 2 mv b dir/b
2082 o 2 mv b dir/b
2084 |
2083 |
2085 o 1 copy a b
2084 o 1 copy a b
2086 |
2085 |
2087 o 0 add a
2086 o 0 add a
2088
2087
2089
2088
2090 Extra newlines must be preserved
2089 Extra newlines must be preserved
2091
2090
2092 $ hg glog -r ::2 --template '\n{rev} {desc}\n\n'
2091 $ hg glog -r ::2 --template '\n{rev} {desc}\n\n'
2093 o
2092 o
2094 | 2 mv b dir/b
2093 | 2 mv b dir/b
2095 |
2094 |
2096 o
2095 o
2097 | 1 copy a b
2096 | 1 copy a b
2098 |
2097 |
2099 o
2098 o
2100 0 add a
2099 0 add a
2101
2100
2102
2101
2103 The almost-empty template should do something sane too ...
2102 The almost-empty template should do something sane too ...
2104
2103
2105 $ hg glog -r ::2 --template '\n'
2104 $ hg glog -r ::2 --template '\n'
2106 o
2105 o
2107 |
2106 |
2108 o
2107 o
2109 |
2108 |
2110 o
2109 o
2111
2110
2112
2111
2113 issue3772
2112 issue3772
2114
2113
2115 $ hg glog -r :null
2114 $ hg glog -r :null
2116 o changeset: -1:000000000000
2115 o changeset: -1:000000000000
2117 user:
2116 user:
2118 date: Thu Jan 01 00:00:00 1970 +0000
2117 date: Thu Jan 01 00:00:00 1970 +0000
2119
2118
2120 $ hg glog -r null:null
2119 $ hg glog -r null:null
2121 o changeset: -1:000000000000
2120 o changeset: -1:000000000000
2122 user:
2121 user:
2123 date: Thu Jan 01 00:00:00 1970 +0000
2122 date: Thu Jan 01 00:00:00 1970 +0000
2124
2123
2125
2124
2126 $ cd ..
2125 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now