##// END OF EJS Templates
hidden: use both parents of working directory...
Pierre-Yves David -
r18250:f5489852 default
parent child Browse files
Show More
@@ -1,167 +1,167 b''
1 # repoview.py - Filtered view of a localrepo object
1 # repoview.py - Filtered view of a localrepo object
2 #
2 #
3 # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
3 # Copyright 2012 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
4 # Logilab SA <contact@logilab.fr>
4 # Logilab SA <contact@logilab.fr>
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 import copy
9 import copy
10 import phases
10 import phases
11 import util
11 import util
12
12
13
13
14 def computehidden(repo):
14 def computehidden(repo):
15 """compute the set of hidden revision to filter
15 """compute the set of hidden revision to filter
16
16
17 During most operation hidden should be filtered."""
17 During most operation hidden should be filtered."""
18 assert not repo.changelog.filteredrevs
18 assert not repo.changelog.filteredrevs
19 if repo.obsstore:
19 if repo.obsstore:
20 ### hide extinct changeset that are not accessible by any mean
20 ### hide extinct changeset that are not accessible by any mean
21 hiddenquery = 'extinct() - ::(. + bookmark())'
21 hiddenquery = 'extinct() - ::(parents() + bookmark())'
22 return frozenset(repo.revs(hiddenquery))
22 return frozenset(repo.revs(hiddenquery))
23 return frozenset()
23 return frozenset()
24
24
25 def computeunserved(repo):
25 def computeunserved(repo):
26 """compute the set of revision that should be filtered when used a server
26 """compute the set of revision that should be filtered when used a server
27
27
28 Secret and hidden changeset should not pretend to be here."""
28 Secret and hidden changeset should not pretend to be here."""
29 assert not repo.changelog.filteredrevs
29 assert not repo.changelog.filteredrevs
30 # fast path in simple case to avoid impact of non optimised code
30 # fast path in simple case to avoid impact of non optimised code
31 if phases.hassecret(repo) or repo.obsstore:
31 if phases.hassecret(repo) or repo.obsstore:
32 return frozenset(repo.revs('hidden() + secret()'))
32 return frozenset(repo.revs('hidden() + secret()'))
33 return frozenset()
33 return frozenset()
34
34
35 def computemutable(repo):
35 def computemutable(repo):
36 """compute the set of revision that should be filtered when used a server
36 """compute the set of revision that should be filtered when used a server
37
37
38 Secret and hidden changeset should not pretend to be here."""
38 Secret and hidden changeset should not pretend to be here."""
39 assert not repo.changelog.filteredrevs
39 assert not repo.changelog.filteredrevs
40 # fast check to avoid revset call on huge repo
40 # fast check to avoid revset call on huge repo
41 if util.any(repo._phasecache.phaseroots[1:]):
41 if util.any(repo._phasecache.phaseroots[1:]):
42 return frozenset(repo.revs('draft() + secret()'))
42 return frozenset(repo.revs('draft() + secret()'))
43 return frozenset()
43 return frozenset()
44
44
45 def computeimpactable(repo):
45 def computeimpactable(repo):
46 """Everything impactable by mutable revision
46 """Everything impactable by mutable revision
47
47
48 The mutable filter still have some chance to get invalidated. This will
48 The mutable filter still have some chance to get invalidated. This will
49 happen when:
49 happen when:
50
50
51 - you garbage collect hidden changeset,
51 - you garbage collect hidden changeset,
52 - public phase is moved backward,
52 - public phase is moved backward,
53 - something is changed in the filtering (this could be fixed)
53 - something is changed in the filtering (this could be fixed)
54
54
55 This filter out any mutable changeset and any public changeset that may be
55 This filter out any mutable changeset and any public changeset that may be
56 impacted by something happening to a mutable revision.
56 impacted by something happening to a mutable revision.
57
57
58 This is achieved by filtered everything with a revision number egal or
58 This is achieved by filtered everything with a revision number egal or
59 higher than the first mutable changeset is filtered."""
59 higher than the first mutable changeset is filtered."""
60 assert not repo.changelog.filteredrevs
60 assert not repo.changelog.filteredrevs
61 cl = repo.changelog
61 cl = repo.changelog
62 firstmutable = len(cl)
62 firstmutable = len(cl)
63 for roots in repo._phasecache.phaseroots[1:]:
63 for roots in repo._phasecache.phaseroots[1:]:
64 if roots:
64 if roots:
65 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
65 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
66 return frozenset(xrange(firstmutable, len(cl)))
66 return frozenset(xrange(firstmutable, len(cl)))
67
67
68 # function to compute filtered set
68 # function to compute filtered set
69 filtertable = {'hidden': computehidden,
69 filtertable = {'hidden': computehidden,
70 'unserved': computeunserved,
70 'unserved': computeunserved,
71 'mutable': computemutable,
71 'mutable': computemutable,
72 'impactable': computeimpactable}
72 'impactable': computeimpactable}
73 ### Nearest subset relation
73 ### Nearest subset relation
74 # Nearest subset of filter X is a filter Y so that:
74 # Nearest subset of filter X is a filter Y so that:
75 # * Y is included in X,
75 # * Y is included in X,
76 # * X - Y is as small as possible.
76 # * X - Y is as small as possible.
77 # This create and ordering used for branchmap purpose.
77 # This create and ordering used for branchmap purpose.
78 # the ordering may be partial
78 # the ordering may be partial
79 subsettable = {None: 'hidden',
79 subsettable = {None: 'hidden',
80 'hidden': 'unserved',
80 'hidden': 'unserved',
81 'unserved': 'mutable',
81 'unserved': 'mutable',
82 'mutable': 'impactable'}
82 'mutable': 'impactable'}
83
83
84 def filteredrevs(repo, filtername):
84 def filteredrevs(repo, filtername):
85 """returns set of filtered revision for this filter name"""
85 """returns set of filtered revision for this filter name"""
86 if filtername not in repo.filteredrevcache:
86 if filtername not in repo.filteredrevcache:
87 func = filtertable[filtername]
87 func = filtertable[filtername]
88 repo.filteredrevcache[filtername] = func(repo.unfiltered())
88 repo.filteredrevcache[filtername] = func(repo.unfiltered())
89 return repo.filteredrevcache[filtername]
89 return repo.filteredrevcache[filtername]
90
90
91 class repoview(object):
91 class repoview(object):
92 """Provide a read/write view of a repo through a filtered changelog
92 """Provide a read/write view of a repo through a filtered changelog
93
93
94 This object is used to access a filtered version of a repository without
94 This object is used to access a filtered version of a repository without
95 altering the original repository object itself. We can not alter the
95 altering the original repository object itself. We can not alter the
96 original object for two main reasons:
96 original object for two main reasons:
97 - It prevents the use of a repo with multiple filters at the same time. In
97 - It prevents the use of a repo with multiple filters at the same time. In
98 particular when multiple threads are involved.
98 particular when multiple threads are involved.
99 - It makes scope of the filtering harder to control.
99 - It makes scope of the filtering harder to control.
100
100
101 This object behaves very closely to the original repository. All attribute
101 This object behaves very closely to the original repository. All attribute
102 operations are done on the original repository:
102 operations are done on the original repository:
103 - An access to `repoview.someattr` actually returns `repo.someattr`,
103 - An access to `repoview.someattr` actually returns `repo.someattr`,
104 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
104 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
105 - A deletion of `repoview.someattr` actually drops `someattr`
105 - A deletion of `repoview.someattr` actually drops `someattr`
106 from `repo.__dict__`.
106 from `repo.__dict__`.
107
107
108 The only exception is the `changelog` property. It is overridden to return
108 The only exception is the `changelog` property. It is overridden to return
109 a (surface) copy of `repo.changelog` with some revisions filtered. The
109 a (surface) copy of `repo.changelog` with some revisions filtered. The
110 `filtername` attribute of the view control the revisions that need to be
110 `filtername` attribute of the view control the revisions that need to be
111 filtered. (the fact the changelog is copied is an implementation detail).
111 filtered. (the fact the changelog is copied is an implementation detail).
112
112
113 Unlike attributes, this object intercepts all method calls. This means that
113 Unlike attributes, this object intercepts all method calls. This means that
114 all methods are run on the `repoview` object with the filtered `changelog`
114 all methods are run on the `repoview` object with the filtered `changelog`
115 property. For this purpose the simple `repoview` class must be mixed with
115 property. For this purpose the simple `repoview` class must be mixed with
116 the actual class of the repository. This ensures that the resulting
116 the actual class of the repository. This ensures that the resulting
117 `repoview` object have the very same methods than the repo object. This
117 `repoview` object have the very same methods than the repo object. This
118 leads to the property below.
118 leads to the property below.
119
119
120 repoview.method() --> repo.__class__.method(repoview)
120 repoview.method() --> repo.__class__.method(repoview)
121
121
122 The inheritance has to be done dynamically because `repo` can be of any
122 The inheritance has to be done dynamically because `repo` can be of any
123 subclasses of `localrepo`. Eg: `bundlerepo` or `httprepo`.
123 subclasses of `localrepo`. Eg: `bundlerepo` or `httprepo`.
124 """
124 """
125
125
126 def __init__(self, repo, filtername):
126 def __init__(self, repo, filtername):
127 object.__setattr__(self, '_unfilteredrepo', repo)
127 object.__setattr__(self, '_unfilteredrepo', repo)
128 object.__setattr__(self, 'filtername', filtername)
128 object.__setattr__(self, 'filtername', filtername)
129
129
130 # not a cacheproperty on purpose we shall implement a proper cache later
130 # not a cacheproperty on purpose we shall implement a proper cache later
131 @property
131 @property
132 def changelog(self):
132 def changelog(self):
133 """return a filtered version of the changeset
133 """return a filtered version of the changeset
134
134
135 this changelog must not be used for writing"""
135 this changelog must not be used for writing"""
136 # some cache may be implemented later
136 # some cache may be implemented later
137 cl = copy.copy(self._unfilteredrepo.changelog)
137 cl = copy.copy(self._unfilteredrepo.changelog)
138 cl.filteredrevs = filteredrevs(self._unfilteredrepo, self.filtername)
138 cl.filteredrevs = filteredrevs(self._unfilteredrepo, self.filtername)
139 return cl
139 return cl
140
140
141 def unfiltered(self):
141 def unfiltered(self):
142 """Return an unfiltered version of a repo"""
142 """Return an unfiltered version of a repo"""
143 return self._unfilteredrepo
143 return self._unfilteredrepo
144
144
145 def filtered(self, name):
145 def filtered(self, name):
146 """Return a filtered version of a repository"""
146 """Return a filtered version of a repository"""
147 if name == self.filtername:
147 if name == self.filtername:
148 return self
148 return self
149 return self.unfiltered().filtered(name)
149 return self.unfiltered().filtered(name)
150
150
151 # everything access are forwarded to the proxied repo
151 # everything access are forwarded to the proxied repo
152 def __getattr__(self, attr):
152 def __getattr__(self, attr):
153 return getattr(self._unfilteredrepo, attr)
153 return getattr(self._unfilteredrepo, attr)
154
154
155 def __setattr__(self, attr, value):
155 def __setattr__(self, attr, value):
156 return setattr(self._unfilteredrepo, attr, value)
156 return setattr(self._unfilteredrepo, attr, value)
157
157
158 def __delattr__(self, attr):
158 def __delattr__(self, attr):
159 return delattr(self._unfilteredrepo, attr)
159 return delattr(self._unfilteredrepo, attr)
160
160
161 # The `requirement` attribut is initialiazed during __init__. But
161 # The `requirement` attribut is initialiazed during __init__. But
162 # __getattr__ won't be called as it also exists on the class. We need
162 # __getattr__ won't be called as it also exists on the class. We need
163 # explicit forwarding to main repo here
163 # explicit forwarding to main repo here
164 @property
164 @property
165 def requirements(self):
165 def requirements(self):
166 return self._unfilteredrepo.requirements
166 return self._unfilteredrepo.requirements
167
167
@@ -1,1259 +1,1273 b''
1 The g is crafted to have 2 filelog topological heads in a linear
1 The g is crafted to have 2 filelog topological heads in a linear
2 changeset graph
2 changeset graph
3
3
4 $ hg init a
4 $ hg init a
5 $ cd a
5 $ cd a
6 $ echo a > a
6 $ echo a > a
7 $ echo f > f
7 $ echo f > f
8 $ hg ci -Ama -d '1 0'
8 $ hg ci -Ama -d '1 0'
9 adding a
9 adding a
10 adding f
10 adding f
11
11
12 $ hg cp a b
12 $ hg cp a b
13 $ hg cp f g
13 $ hg cp f g
14 $ hg ci -mb -d '2 0'
14 $ hg ci -mb -d '2 0'
15
15
16 $ mkdir dir
16 $ mkdir dir
17 $ hg mv b dir
17 $ hg mv b dir
18 $ echo g >> g
18 $ echo g >> g
19 $ echo f >> f
19 $ echo f >> f
20 $ hg ci -mc -d '3 0'
20 $ hg ci -mc -d '3 0'
21
21
22 $ hg mv a b
22 $ hg mv a b
23 $ hg cp -f f g
23 $ hg cp -f f g
24 $ echo a > d
24 $ echo a > d
25 $ hg add d
25 $ hg add d
26 $ hg ci -md -d '4 0'
26 $ hg ci -md -d '4 0'
27
27
28 $ hg mv dir/b e
28 $ hg mv dir/b e
29 $ hg ci -me -d '5 0'
29 $ hg ci -me -d '5 0'
30
30
31 $ hg log a
31 $ hg log a
32 changeset: 0:9161b9aeaf16
32 changeset: 0:9161b9aeaf16
33 user: test
33 user: test
34 date: Thu Jan 01 00:00:01 1970 +0000
34 date: Thu Jan 01 00:00:01 1970 +0000
35 summary: a
35 summary: a
36
36
37
37
38 -f, directory
38 -f, directory
39
39
40 $ hg log -f dir
40 $ hg log -f dir
41 abort: cannot follow file not in parent revision: "dir"
41 abort: cannot follow file not in parent revision: "dir"
42 [255]
42 [255]
43
43
44 -f, but no args
44 -f, but no args
45
45
46 $ hg log -f
46 $ hg log -f
47 changeset: 4:7e4639b4691b
47 changeset: 4:7e4639b4691b
48 tag: tip
48 tag: tip
49 user: test
49 user: test
50 date: Thu Jan 01 00:00:05 1970 +0000
50 date: Thu Jan 01 00:00:05 1970 +0000
51 summary: e
51 summary: e
52
52
53 changeset: 3:2ca5ba701980
53 changeset: 3:2ca5ba701980
54 user: test
54 user: test
55 date: Thu Jan 01 00:00:04 1970 +0000
55 date: Thu Jan 01 00:00:04 1970 +0000
56 summary: d
56 summary: d
57
57
58 changeset: 2:f8954cd4dc1f
58 changeset: 2:f8954cd4dc1f
59 user: test
59 user: test
60 date: Thu Jan 01 00:00:03 1970 +0000
60 date: Thu Jan 01 00:00:03 1970 +0000
61 summary: c
61 summary: c
62
62
63 changeset: 1:d89b0a12d229
63 changeset: 1:d89b0a12d229
64 user: test
64 user: test
65 date: Thu Jan 01 00:00:02 1970 +0000
65 date: Thu Jan 01 00:00:02 1970 +0000
66 summary: b
66 summary: b
67
67
68 changeset: 0:9161b9aeaf16
68 changeset: 0:9161b9aeaf16
69 user: test
69 user: test
70 date: Thu Jan 01 00:00:01 1970 +0000
70 date: Thu Jan 01 00:00:01 1970 +0000
71 summary: a
71 summary: a
72
72
73
73
74 one rename
74 one rename
75
75
76 $ hg up -q 2
76 $ hg up -q 2
77 $ hg log -vf a
77 $ hg log -vf a
78 changeset: 0:9161b9aeaf16
78 changeset: 0:9161b9aeaf16
79 user: test
79 user: test
80 date: Thu Jan 01 00:00:01 1970 +0000
80 date: Thu Jan 01 00:00:01 1970 +0000
81 files: a f
81 files: a f
82 description:
82 description:
83 a
83 a
84
84
85
85
86
86
87 many renames
87 many renames
88
88
89 $ hg up -q tip
89 $ hg up -q tip
90 $ hg log -vf e
90 $ hg log -vf e
91 changeset: 4:7e4639b4691b
91 changeset: 4:7e4639b4691b
92 tag: tip
92 tag: tip
93 user: test
93 user: test
94 date: Thu Jan 01 00:00:05 1970 +0000
94 date: Thu Jan 01 00:00:05 1970 +0000
95 files: dir/b e
95 files: dir/b e
96 description:
96 description:
97 e
97 e
98
98
99
99
100 changeset: 2:f8954cd4dc1f
100 changeset: 2:f8954cd4dc1f
101 user: test
101 user: test
102 date: Thu Jan 01 00:00:03 1970 +0000
102 date: Thu Jan 01 00:00:03 1970 +0000
103 files: b dir/b f g
103 files: b dir/b f g
104 description:
104 description:
105 c
105 c
106
106
107
107
108 changeset: 1:d89b0a12d229
108 changeset: 1:d89b0a12d229
109 user: test
109 user: test
110 date: Thu Jan 01 00:00:02 1970 +0000
110 date: Thu Jan 01 00:00:02 1970 +0000
111 files: b g
111 files: b g
112 description:
112 description:
113 b
113 b
114
114
115
115
116 changeset: 0:9161b9aeaf16
116 changeset: 0:9161b9aeaf16
117 user: test
117 user: test
118 date: Thu Jan 01 00:00:01 1970 +0000
118 date: Thu Jan 01 00:00:01 1970 +0000
119 files: a f
119 files: a f
120 description:
120 description:
121 a
121 a
122
122
123
123
124
124
125
125
126 log -pf dir/b
126 log -pf dir/b
127
127
128 $ hg up -q 3
128 $ hg up -q 3
129 $ hg log -pf dir/b
129 $ hg log -pf dir/b
130 changeset: 2:f8954cd4dc1f
130 changeset: 2:f8954cd4dc1f
131 user: test
131 user: test
132 date: Thu Jan 01 00:00:03 1970 +0000
132 date: Thu Jan 01 00:00:03 1970 +0000
133 summary: c
133 summary: c
134
134
135 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
135 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
136 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
136 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
137 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
137 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
138 @@ -0,0 +1,1 @@
138 @@ -0,0 +1,1 @@
139 +a
139 +a
140
140
141 changeset: 1:d89b0a12d229
141 changeset: 1:d89b0a12d229
142 user: test
142 user: test
143 date: Thu Jan 01 00:00:02 1970 +0000
143 date: Thu Jan 01 00:00:02 1970 +0000
144 summary: b
144 summary: b
145
145
146 diff -r 9161b9aeaf16 -r d89b0a12d229 b
146 diff -r 9161b9aeaf16 -r d89b0a12d229 b
147 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
147 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
148 +++ b/b Thu Jan 01 00:00:02 1970 +0000
148 +++ b/b Thu Jan 01 00:00:02 1970 +0000
149 @@ -0,0 +1,1 @@
149 @@ -0,0 +1,1 @@
150 +a
150 +a
151
151
152 changeset: 0:9161b9aeaf16
152 changeset: 0:9161b9aeaf16
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:01 1970 +0000
154 date: Thu Jan 01 00:00:01 1970 +0000
155 summary: a
155 summary: a
156
156
157 diff -r 000000000000 -r 9161b9aeaf16 a
157 diff -r 000000000000 -r 9161b9aeaf16 a
158 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
158 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
159 +++ b/a Thu Jan 01 00:00:01 1970 +0000
159 +++ b/a Thu Jan 01 00:00:01 1970 +0000
160 @@ -0,0 +1,1 @@
160 @@ -0,0 +1,1 @@
161 +a
161 +a
162
162
163
163
164 log -vf dir/b
164 log -vf dir/b
165
165
166 $ hg log -vf dir/b
166 $ hg log -vf dir/b
167 changeset: 2:f8954cd4dc1f
167 changeset: 2:f8954cd4dc1f
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:03 1970 +0000
169 date: Thu Jan 01 00:00:03 1970 +0000
170 files: b dir/b f g
170 files: b dir/b f g
171 description:
171 description:
172 c
172 c
173
173
174
174
175 changeset: 1:d89b0a12d229
175 changeset: 1:d89b0a12d229
176 user: test
176 user: test
177 date: Thu Jan 01 00:00:02 1970 +0000
177 date: Thu Jan 01 00:00:02 1970 +0000
178 files: b g
178 files: b g
179 description:
179 description:
180 b
180 b
181
181
182
182
183 changeset: 0:9161b9aeaf16
183 changeset: 0:9161b9aeaf16
184 user: test
184 user: test
185 date: Thu Jan 01 00:00:01 1970 +0000
185 date: Thu Jan 01 00:00:01 1970 +0000
186 files: a f
186 files: a f
187 description:
187 description:
188 a
188 a
189
189
190
190
191
191
192
192
193 -f and multiple filelog heads
193 -f and multiple filelog heads
194
194
195 $ hg up -q 2
195 $ hg up -q 2
196 $ hg log -f g --template '{rev}\n'
196 $ hg log -f g --template '{rev}\n'
197 2
197 2
198 1
198 1
199 0
199 0
200 $ hg up -q tip
200 $ hg up -q tip
201 $ hg log -f g --template '{rev}\n'
201 $ hg log -f g --template '{rev}\n'
202 3
202 3
203 2
203 2
204 0
204 0
205
205
206
206
207 log copies with --copies
207 log copies with --copies
208
208
209 $ hg log -vC --template '{rev} {file_copies}\n'
209 $ hg log -vC --template '{rev} {file_copies}\n'
210 4 e (dir/b)
210 4 e (dir/b)
211 3 b (a)g (f)
211 3 b (a)g (f)
212 2 dir/b (b)
212 2 dir/b (b)
213 1 b (a)g (f)
213 1 b (a)g (f)
214 0
214 0
215
215
216 log copies switch without --copies, with old filecopy template
216 log copies switch without --copies, with old filecopy template
217
217
218 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
218 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
219 4
219 4
220 3
220 3
221 2
221 2
222 1
222 1
223 0
223 0
224
224
225 log copies switch with --copies
225 log copies switch with --copies
226
226
227 $ hg log -vC --template '{rev} {file_copies_switch}\n'
227 $ hg log -vC --template '{rev} {file_copies_switch}\n'
228 4 e (dir/b)
228 4 e (dir/b)
229 3 b (a)g (f)
229 3 b (a)g (f)
230 2 dir/b (b)
230 2 dir/b (b)
231 1 b (a)g (f)
231 1 b (a)g (f)
232 0
232 0
233
233
234
234
235 log copies with hardcoded style and with --style=default
235 log copies with hardcoded style and with --style=default
236
236
237 $ hg log -vC -r4
237 $ hg log -vC -r4
238 changeset: 4:7e4639b4691b
238 changeset: 4:7e4639b4691b
239 tag: tip
239 tag: tip
240 user: test
240 user: test
241 date: Thu Jan 01 00:00:05 1970 +0000
241 date: Thu Jan 01 00:00:05 1970 +0000
242 files: dir/b e
242 files: dir/b e
243 copies: e (dir/b)
243 copies: e (dir/b)
244 description:
244 description:
245 e
245 e
246
246
247
247
248 $ hg log -vC -r4 --style=default
248 $ hg log -vC -r4 --style=default
249 changeset: 4:7e4639b4691b
249 changeset: 4:7e4639b4691b
250 tag: tip
250 tag: tip
251 user: test
251 user: test
252 date: Thu Jan 01 00:00:05 1970 +0000
252 date: Thu Jan 01 00:00:05 1970 +0000
253 files: dir/b e
253 files: dir/b e
254 copies: e (dir/b)
254 copies: e (dir/b)
255 description:
255 description:
256 e
256 e
257
257
258
258
259
259
260
260
261 log copies, non-linear manifest
261 log copies, non-linear manifest
262
262
263 $ hg up -C 3
263 $ hg up -C 3
264 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
264 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
265 $ hg mv dir/b e
265 $ hg mv dir/b e
266 $ echo foo > foo
266 $ echo foo > foo
267 $ hg ci -Ame2 -d '6 0'
267 $ hg ci -Ame2 -d '6 0'
268 adding foo
268 adding foo
269 created new head
269 created new head
270 $ hg log -v --template '{rev} {file_copies}\n' -r 5
270 $ hg log -v --template '{rev} {file_copies}\n' -r 5
271 5 e (dir/b)
271 5 e (dir/b)
272
272
273
273
274 log copies, execute bit set
274 log copies, execute bit set
275
275
276 #if execbit
276 #if execbit
277 $ chmod +x e
277 $ chmod +x e
278 $ hg ci -me3 -d '7 0'
278 $ hg ci -me3 -d '7 0'
279 $ hg log -v --template '{rev} {file_copies}\n' -r 6
279 $ hg log -v --template '{rev} {file_copies}\n' -r 6
280 6
280 6
281 #endif
281 #endif
282
282
283
283
284 log -p d
284 log -p d
285
285
286 $ hg log -pv d
286 $ hg log -pv d
287 changeset: 3:2ca5ba701980
287 changeset: 3:2ca5ba701980
288 user: test
288 user: test
289 date: Thu Jan 01 00:00:04 1970 +0000
289 date: Thu Jan 01 00:00:04 1970 +0000
290 files: a b d g
290 files: a b d g
291 description:
291 description:
292 d
292 d
293
293
294
294
295 diff -r f8954cd4dc1f -r 2ca5ba701980 d
295 diff -r f8954cd4dc1f -r 2ca5ba701980 d
296 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
296 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
297 +++ b/d Thu Jan 01 00:00:04 1970 +0000
297 +++ b/d Thu Jan 01 00:00:04 1970 +0000
298 @@ -0,0 +1,1 @@
298 @@ -0,0 +1,1 @@
299 +a
299 +a
300
300
301
301
302
302
303 log --removed file
303 log --removed file
304
304
305 $ hg log --removed -v a
305 $ hg log --removed -v a
306 changeset: 3:2ca5ba701980
306 changeset: 3:2ca5ba701980
307 user: test
307 user: test
308 date: Thu Jan 01 00:00:04 1970 +0000
308 date: Thu Jan 01 00:00:04 1970 +0000
309 files: a b d g
309 files: a b d g
310 description:
310 description:
311 d
311 d
312
312
313
313
314 changeset: 0:9161b9aeaf16
314 changeset: 0:9161b9aeaf16
315 user: test
315 user: test
316 date: Thu Jan 01 00:00:01 1970 +0000
316 date: Thu Jan 01 00:00:01 1970 +0000
317 files: a f
317 files: a f
318 description:
318 description:
319 a
319 a
320
320
321
321
322
322
323 log --removed revrange file
323 log --removed revrange file
324
324
325 $ hg log --removed -v -r0:2 a
325 $ hg log --removed -v -r0:2 a
326 changeset: 0:9161b9aeaf16
326 changeset: 0:9161b9aeaf16
327 user: test
327 user: test
328 date: Thu Jan 01 00:00:01 1970 +0000
328 date: Thu Jan 01 00:00:01 1970 +0000
329 files: a f
329 files: a f
330 description:
330 description:
331 a
331 a
332
332
333
333
334 $ cd ..
334 $ cd ..
335
335
336 log --follow tests
336 log --follow tests
337
337
338 $ hg init follow
338 $ hg init follow
339 $ cd follow
339 $ cd follow
340
340
341 $ echo base > base
341 $ echo base > base
342 $ hg ci -Ambase -d '1 0'
342 $ hg ci -Ambase -d '1 0'
343 adding base
343 adding base
344
344
345 $ echo r1 >> base
345 $ echo r1 >> base
346 $ hg ci -Amr1 -d '1 0'
346 $ hg ci -Amr1 -d '1 0'
347 $ echo r2 >> base
347 $ echo r2 >> base
348 $ hg ci -Amr2 -d '1 0'
348 $ hg ci -Amr2 -d '1 0'
349
349
350 $ hg up -C 1
350 $ hg up -C 1
351 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
352 $ echo b1 > b1
352 $ echo b1 > b1
353 $ hg ci -Amb1 -d '1 0'
353 $ hg ci -Amb1 -d '1 0'
354 adding b1
354 adding b1
355 created new head
355 created new head
356
356
357
357
358 log -f
358 log -f
359
359
360 $ hg log -f
360 $ hg log -f
361 changeset: 3:e62f78d544b4
361 changeset: 3:e62f78d544b4
362 tag: tip
362 tag: tip
363 parent: 1:3d5bf5654eda
363 parent: 1:3d5bf5654eda
364 user: test
364 user: test
365 date: Thu Jan 01 00:00:01 1970 +0000
365 date: Thu Jan 01 00:00:01 1970 +0000
366 summary: b1
366 summary: b1
367
367
368 changeset: 1:3d5bf5654eda
368 changeset: 1:3d5bf5654eda
369 user: test
369 user: test
370 date: Thu Jan 01 00:00:01 1970 +0000
370 date: Thu Jan 01 00:00:01 1970 +0000
371 summary: r1
371 summary: r1
372
372
373 changeset: 0:67e992f2c4f3
373 changeset: 0:67e992f2c4f3
374 user: test
374 user: test
375 date: Thu Jan 01 00:00:01 1970 +0000
375 date: Thu Jan 01 00:00:01 1970 +0000
376 summary: base
376 summary: base
377
377
378
378
379
379
380 log -f -r 1:tip
380 log -f -r 1:tip
381
381
382 $ hg up -C 0
382 $ hg up -C 0
383 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
383 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
384 $ echo b2 > b2
384 $ echo b2 > b2
385 $ hg ci -Amb2 -d '1 0'
385 $ hg ci -Amb2 -d '1 0'
386 adding b2
386 adding b2
387 created new head
387 created new head
388 $ hg log -f -r 1:tip
388 $ hg log -f -r 1:tip
389 changeset: 1:3d5bf5654eda
389 changeset: 1:3d5bf5654eda
390 user: test
390 user: test
391 date: Thu Jan 01 00:00:01 1970 +0000
391 date: Thu Jan 01 00:00:01 1970 +0000
392 summary: r1
392 summary: r1
393
393
394 changeset: 2:60c670bf5b30
394 changeset: 2:60c670bf5b30
395 user: test
395 user: test
396 date: Thu Jan 01 00:00:01 1970 +0000
396 date: Thu Jan 01 00:00:01 1970 +0000
397 summary: r2
397 summary: r2
398
398
399 changeset: 3:e62f78d544b4
399 changeset: 3:e62f78d544b4
400 parent: 1:3d5bf5654eda
400 parent: 1:3d5bf5654eda
401 user: test
401 user: test
402 date: Thu Jan 01 00:00:01 1970 +0000
402 date: Thu Jan 01 00:00:01 1970 +0000
403 summary: b1
403 summary: b1
404
404
405
405
406
406
407 log -r . with two parents
407 log -r . with two parents
408
408
409 $ hg up -C 3
409 $ hg up -C 3
410 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
410 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
411 $ hg merge tip
411 $ hg merge tip
412 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
412 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
413 (branch merge, don't forget to commit)
413 (branch merge, don't forget to commit)
414 $ hg log -r .
414 $ hg log -r .
415 changeset: 3:e62f78d544b4
415 changeset: 3:e62f78d544b4
416 parent: 1:3d5bf5654eda
416 parent: 1:3d5bf5654eda
417 user: test
417 user: test
418 date: Thu Jan 01 00:00:01 1970 +0000
418 date: Thu Jan 01 00:00:01 1970 +0000
419 summary: b1
419 summary: b1
420
420
421
421
422
422
423 log -r . with one parent
423 log -r . with one parent
424
424
425 $ hg ci -mm12 -d '1 0'
425 $ hg ci -mm12 -d '1 0'
426 $ hg log -r .
426 $ hg log -r .
427 changeset: 5:302e9dd6890d
427 changeset: 5:302e9dd6890d
428 tag: tip
428 tag: tip
429 parent: 3:e62f78d544b4
429 parent: 3:e62f78d544b4
430 parent: 4:ddb82e70d1a1
430 parent: 4:ddb82e70d1a1
431 user: test
431 user: test
432 date: Thu Jan 01 00:00:01 1970 +0000
432 date: Thu Jan 01 00:00:01 1970 +0000
433 summary: m12
433 summary: m12
434
434
435
435
436 $ echo postm >> b1
436 $ echo postm >> b1
437 $ hg ci -Amb1.1 -d'1 0'
437 $ hg ci -Amb1.1 -d'1 0'
438
438
439
439
440 log --follow-first
440 log --follow-first
441
441
442 $ hg log --follow-first
442 $ hg log --follow-first
443 changeset: 6:2404bbcab562
443 changeset: 6:2404bbcab562
444 tag: tip
444 tag: tip
445 user: test
445 user: test
446 date: Thu Jan 01 00:00:01 1970 +0000
446 date: Thu Jan 01 00:00:01 1970 +0000
447 summary: b1.1
447 summary: b1.1
448
448
449 changeset: 5:302e9dd6890d
449 changeset: 5:302e9dd6890d
450 parent: 3:e62f78d544b4
450 parent: 3:e62f78d544b4
451 parent: 4:ddb82e70d1a1
451 parent: 4:ddb82e70d1a1
452 user: test
452 user: test
453 date: Thu Jan 01 00:00:01 1970 +0000
453 date: Thu Jan 01 00:00:01 1970 +0000
454 summary: m12
454 summary: m12
455
455
456 changeset: 3:e62f78d544b4
456 changeset: 3:e62f78d544b4
457 parent: 1:3d5bf5654eda
457 parent: 1:3d5bf5654eda
458 user: test
458 user: test
459 date: Thu Jan 01 00:00:01 1970 +0000
459 date: Thu Jan 01 00:00:01 1970 +0000
460 summary: b1
460 summary: b1
461
461
462 changeset: 1:3d5bf5654eda
462 changeset: 1:3d5bf5654eda
463 user: test
463 user: test
464 date: Thu Jan 01 00:00:01 1970 +0000
464 date: Thu Jan 01 00:00:01 1970 +0000
465 summary: r1
465 summary: r1
466
466
467 changeset: 0:67e992f2c4f3
467 changeset: 0:67e992f2c4f3
468 user: test
468 user: test
469 date: Thu Jan 01 00:00:01 1970 +0000
469 date: Thu Jan 01 00:00:01 1970 +0000
470 summary: base
470 summary: base
471
471
472
472
473
473
474 log -P 2
474 log -P 2
475
475
476 $ hg log -P 2
476 $ hg log -P 2
477 changeset: 6:2404bbcab562
477 changeset: 6:2404bbcab562
478 tag: tip
478 tag: tip
479 user: test
479 user: test
480 date: Thu Jan 01 00:00:01 1970 +0000
480 date: Thu Jan 01 00:00:01 1970 +0000
481 summary: b1.1
481 summary: b1.1
482
482
483 changeset: 5:302e9dd6890d
483 changeset: 5:302e9dd6890d
484 parent: 3:e62f78d544b4
484 parent: 3:e62f78d544b4
485 parent: 4:ddb82e70d1a1
485 parent: 4:ddb82e70d1a1
486 user: test
486 user: test
487 date: Thu Jan 01 00:00:01 1970 +0000
487 date: Thu Jan 01 00:00:01 1970 +0000
488 summary: m12
488 summary: m12
489
489
490 changeset: 4:ddb82e70d1a1
490 changeset: 4:ddb82e70d1a1
491 parent: 0:67e992f2c4f3
491 parent: 0:67e992f2c4f3
492 user: test
492 user: test
493 date: Thu Jan 01 00:00:01 1970 +0000
493 date: Thu Jan 01 00:00:01 1970 +0000
494 summary: b2
494 summary: b2
495
495
496 changeset: 3:e62f78d544b4
496 changeset: 3:e62f78d544b4
497 parent: 1:3d5bf5654eda
497 parent: 1:3d5bf5654eda
498 user: test
498 user: test
499 date: Thu Jan 01 00:00:01 1970 +0000
499 date: Thu Jan 01 00:00:01 1970 +0000
500 summary: b1
500 summary: b1
501
501
502
502
503
503
504 log -r tip -p --git
504 log -r tip -p --git
505
505
506 $ hg log -r tip -p --git
506 $ hg log -r tip -p --git
507 changeset: 6:2404bbcab562
507 changeset: 6:2404bbcab562
508 tag: tip
508 tag: tip
509 user: test
509 user: test
510 date: Thu Jan 01 00:00:01 1970 +0000
510 date: Thu Jan 01 00:00:01 1970 +0000
511 summary: b1.1
511 summary: b1.1
512
512
513 diff --git a/b1 b/b1
513 diff --git a/b1 b/b1
514 --- a/b1
514 --- a/b1
515 +++ b/b1
515 +++ b/b1
516 @@ -1,1 +1,2 @@
516 @@ -1,1 +1,2 @@
517 b1
517 b1
518 +postm
518 +postm
519
519
520
520
521
521
522 log -r ""
522 log -r ""
523
523
524 $ hg log -r ''
524 $ hg log -r ''
525 hg: parse error: empty query
525 hg: parse error: empty query
526 [255]
526 [255]
527
527
528 log -r <some unknown node id>
528 log -r <some unknown node id>
529
529
530 $ hg log -r 1000000000000000000000000000000000000000
530 $ hg log -r 1000000000000000000000000000000000000000
531 abort: unknown revision '1000000000000000000000000000000000000000'!
531 abort: unknown revision '1000000000000000000000000000000000000000'!
532 [255]
532 [255]
533
533
534 log -k r1
534 log -k r1
535
535
536 $ hg log -k r1
536 $ hg log -k r1
537 changeset: 1:3d5bf5654eda
537 changeset: 1:3d5bf5654eda
538 user: test
538 user: test
539 date: Thu Jan 01 00:00:01 1970 +0000
539 date: Thu Jan 01 00:00:01 1970 +0000
540 summary: r1
540 summary: r1
541
541
542 log -p -l2 --color=always
542 log -p -l2 --color=always
543
543
544 $ hg --config extensions.color= --config color.mode=ansi \
544 $ hg --config extensions.color= --config color.mode=ansi \
545 > log -p -l2 --color=always
545 > log -p -l2 --color=always
546 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
546 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
547 tag: tip
547 tag: tip
548 user: test
548 user: test
549 date: Thu Jan 01 00:00:01 1970 +0000
549 date: Thu Jan 01 00:00:01 1970 +0000
550 summary: b1.1
550 summary: b1.1
551
551
552 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
552 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
553 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
553 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
554 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
554 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
555 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
555 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
556 b1
556 b1
557 \x1b[0;32m+postm\x1b[0m (esc)
557 \x1b[0;32m+postm\x1b[0m (esc)
558
558
559 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
559 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
560 parent: 3:e62f78d544b4
560 parent: 3:e62f78d544b4
561 parent: 4:ddb82e70d1a1
561 parent: 4:ddb82e70d1a1
562 user: test
562 user: test
563 date: Thu Jan 01 00:00:01 1970 +0000
563 date: Thu Jan 01 00:00:01 1970 +0000
564 summary: m12
564 summary: m12
565
565
566 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
566 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
567 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
567 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
568 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
568 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
569 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
569 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
570 \x1b[0;32m+b2\x1b[0m (esc)
570 \x1b[0;32m+b2\x1b[0m (esc)
571
571
572
572
573
573
574 log -r tip --stat
574 log -r tip --stat
575
575
576 $ hg log -r tip --stat
576 $ hg log -r tip --stat
577 changeset: 6:2404bbcab562
577 changeset: 6:2404bbcab562
578 tag: tip
578 tag: tip
579 user: test
579 user: test
580 date: Thu Jan 01 00:00:01 1970 +0000
580 date: Thu Jan 01 00:00:01 1970 +0000
581 summary: b1.1
581 summary: b1.1
582
582
583 b1 | 1 +
583 b1 | 1 +
584 1 files changed, 1 insertions(+), 0 deletions(-)
584 1 files changed, 1 insertions(+), 0 deletions(-)
585
585
586
586
587 $ cd ..
587 $ cd ..
588
588
589
589
590 User
590 User
591
591
592 $ hg init usertest
592 $ hg init usertest
593 $ cd usertest
593 $ cd usertest
594
594
595 $ echo a > a
595 $ echo a > a
596 $ hg ci -A -m "a" -u "User One <user1@example.org>"
596 $ hg ci -A -m "a" -u "User One <user1@example.org>"
597 adding a
597 adding a
598 $ echo b > b
598 $ echo b > b
599 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
599 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
600 adding b
600 adding b
601
601
602 $ hg log -u "User One <user1@example.org>"
602 $ hg log -u "User One <user1@example.org>"
603 changeset: 0:29a4c94f1924
603 changeset: 0:29a4c94f1924
604 user: User One <user1@example.org>
604 user: User One <user1@example.org>
605 date: Thu Jan 01 00:00:00 1970 +0000
605 date: Thu Jan 01 00:00:00 1970 +0000
606 summary: a
606 summary: a
607
607
608 $ hg log -u "user1" -u "user2"
608 $ hg log -u "user1" -u "user2"
609 changeset: 1:e834b5e69c0e
609 changeset: 1:e834b5e69c0e
610 tag: tip
610 tag: tip
611 user: User Two <user2@example.org>
611 user: User Two <user2@example.org>
612 date: Thu Jan 01 00:00:00 1970 +0000
612 date: Thu Jan 01 00:00:00 1970 +0000
613 summary: b
613 summary: b
614
614
615 changeset: 0:29a4c94f1924
615 changeset: 0:29a4c94f1924
616 user: User One <user1@example.org>
616 user: User One <user1@example.org>
617 date: Thu Jan 01 00:00:00 1970 +0000
617 date: Thu Jan 01 00:00:00 1970 +0000
618 summary: a
618 summary: a
619
619
620 $ hg log -u "user3"
620 $ hg log -u "user3"
621
621
622 $ cd ..
622 $ cd ..
623
623
624 $ hg init branches
624 $ hg init branches
625 $ cd branches
625 $ cd branches
626
626
627 $ echo a > a
627 $ echo a > a
628 $ hg ci -A -m "commit on default"
628 $ hg ci -A -m "commit on default"
629 adding a
629 adding a
630 $ hg branch test
630 $ hg branch test
631 marked working directory as branch test
631 marked working directory as branch test
632 (branches are permanent and global, did you want a bookmark?)
632 (branches are permanent and global, did you want a bookmark?)
633 $ echo b > b
633 $ echo b > b
634 $ hg ci -A -m "commit on test"
634 $ hg ci -A -m "commit on test"
635 adding b
635 adding b
636
636
637 $ hg up default
637 $ hg up default
638 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
638 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
639 $ echo c > c
639 $ echo c > c
640 $ hg ci -A -m "commit on default"
640 $ hg ci -A -m "commit on default"
641 adding c
641 adding c
642 $ hg up test
642 $ hg up test
643 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
643 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
644 $ echo c > c
644 $ echo c > c
645 $ hg ci -A -m "commit on test"
645 $ hg ci -A -m "commit on test"
646 adding c
646 adding c
647
647
648
648
649 log -b default
649 log -b default
650
650
651 $ hg log -b default
651 $ hg log -b default
652 changeset: 2:c3a4f03cc9a7
652 changeset: 2:c3a4f03cc9a7
653 parent: 0:24427303d56f
653 parent: 0:24427303d56f
654 user: test
654 user: test
655 date: Thu Jan 01 00:00:00 1970 +0000
655 date: Thu Jan 01 00:00:00 1970 +0000
656 summary: commit on default
656 summary: commit on default
657
657
658 changeset: 0:24427303d56f
658 changeset: 0:24427303d56f
659 user: test
659 user: test
660 date: Thu Jan 01 00:00:00 1970 +0000
660 date: Thu Jan 01 00:00:00 1970 +0000
661 summary: commit on default
661 summary: commit on default
662
662
663
663
664
664
665 log -b test
665 log -b test
666
666
667 $ hg log -b test
667 $ hg log -b test
668 changeset: 3:f5d8de11c2e2
668 changeset: 3:f5d8de11c2e2
669 branch: test
669 branch: test
670 tag: tip
670 tag: tip
671 parent: 1:d32277701ccb
671 parent: 1:d32277701ccb
672 user: test
672 user: test
673 date: Thu Jan 01 00:00:00 1970 +0000
673 date: Thu Jan 01 00:00:00 1970 +0000
674 summary: commit on test
674 summary: commit on test
675
675
676 changeset: 1:d32277701ccb
676 changeset: 1:d32277701ccb
677 branch: test
677 branch: test
678 user: test
678 user: test
679 date: Thu Jan 01 00:00:00 1970 +0000
679 date: Thu Jan 01 00:00:00 1970 +0000
680 summary: commit on test
680 summary: commit on test
681
681
682
682
683
683
684 log -b dummy
684 log -b dummy
685
685
686 $ hg log -b dummy
686 $ hg log -b dummy
687 abort: unknown revision 'dummy'!
687 abort: unknown revision 'dummy'!
688 [255]
688 [255]
689
689
690
690
691 log -b .
691 log -b .
692
692
693 $ hg log -b .
693 $ hg log -b .
694 changeset: 3:f5d8de11c2e2
694 changeset: 3:f5d8de11c2e2
695 branch: test
695 branch: test
696 tag: tip
696 tag: tip
697 parent: 1:d32277701ccb
697 parent: 1:d32277701ccb
698 user: test
698 user: test
699 date: Thu Jan 01 00:00:00 1970 +0000
699 date: Thu Jan 01 00:00:00 1970 +0000
700 summary: commit on test
700 summary: commit on test
701
701
702 changeset: 1:d32277701ccb
702 changeset: 1:d32277701ccb
703 branch: test
703 branch: test
704 user: test
704 user: test
705 date: Thu Jan 01 00:00:00 1970 +0000
705 date: Thu Jan 01 00:00:00 1970 +0000
706 summary: commit on test
706 summary: commit on test
707
707
708
708
709
709
710 log -b default -b test
710 log -b default -b test
711
711
712 $ hg log -b default -b test
712 $ hg log -b default -b test
713 changeset: 3:f5d8de11c2e2
713 changeset: 3:f5d8de11c2e2
714 branch: test
714 branch: test
715 tag: tip
715 tag: tip
716 parent: 1:d32277701ccb
716 parent: 1:d32277701ccb
717 user: test
717 user: test
718 date: Thu Jan 01 00:00:00 1970 +0000
718 date: Thu Jan 01 00:00:00 1970 +0000
719 summary: commit on test
719 summary: commit on test
720
720
721 changeset: 2:c3a4f03cc9a7
721 changeset: 2:c3a4f03cc9a7
722 parent: 0:24427303d56f
722 parent: 0:24427303d56f
723 user: test
723 user: test
724 date: Thu Jan 01 00:00:00 1970 +0000
724 date: Thu Jan 01 00:00:00 1970 +0000
725 summary: commit on default
725 summary: commit on default
726
726
727 changeset: 1:d32277701ccb
727 changeset: 1:d32277701ccb
728 branch: test
728 branch: test
729 user: test
729 user: test
730 date: Thu Jan 01 00:00:00 1970 +0000
730 date: Thu Jan 01 00:00:00 1970 +0000
731 summary: commit on test
731 summary: commit on test
732
732
733 changeset: 0:24427303d56f
733 changeset: 0:24427303d56f
734 user: test
734 user: test
735 date: Thu Jan 01 00:00:00 1970 +0000
735 date: Thu Jan 01 00:00:00 1970 +0000
736 summary: commit on default
736 summary: commit on default
737
737
738
738
739
739
740 log -b default -b .
740 log -b default -b .
741
741
742 $ hg log -b default -b .
742 $ hg log -b default -b .
743 changeset: 3:f5d8de11c2e2
743 changeset: 3:f5d8de11c2e2
744 branch: test
744 branch: test
745 tag: tip
745 tag: tip
746 parent: 1:d32277701ccb
746 parent: 1:d32277701ccb
747 user: test
747 user: test
748 date: Thu Jan 01 00:00:00 1970 +0000
748 date: Thu Jan 01 00:00:00 1970 +0000
749 summary: commit on test
749 summary: commit on test
750
750
751 changeset: 2:c3a4f03cc9a7
751 changeset: 2:c3a4f03cc9a7
752 parent: 0:24427303d56f
752 parent: 0:24427303d56f
753 user: test
753 user: test
754 date: Thu Jan 01 00:00:00 1970 +0000
754 date: Thu Jan 01 00:00:00 1970 +0000
755 summary: commit on default
755 summary: commit on default
756
756
757 changeset: 1:d32277701ccb
757 changeset: 1:d32277701ccb
758 branch: test
758 branch: test
759 user: test
759 user: test
760 date: Thu Jan 01 00:00:00 1970 +0000
760 date: Thu Jan 01 00:00:00 1970 +0000
761 summary: commit on test
761 summary: commit on test
762
762
763 changeset: 0:24427303d56f
763 changeset: 0:24427303d56f
764 user: test
764 user: test
765 date: Thu Jan 01 00:00:00 1970 +0000
765 date: Thu Jan 01 00:00:00 1970 +0000
766 summary: commit on default
766 summary: commit on default
767
767
768
768
769
769
770 log -b . -b test
770 log -b . -b test
771
771
772 $ hg log -b . -b test
772 $ hg log -b . -b test
773 changeset: 3:f5d8de11c2e2
773 changeset: 3:f5d8de11c2e2
774 branch: test
774 branch: test
775 tag: tip
775 tag: tip
776 parent: 1:d32277701ccb
776 parent: 1:d32277701ccb
777 user: test
777 user: test
778 date: Thu Jan 01 00:00:00 1970 +0000
778 date: Thu Jan 01 00:00:00 1970 +0000
779 summary: commit on test
779 summary: commit on test
780
780
781 changeset: 1:d32277701ccb
781 changeset: 1:d32277701ccb
782 branch: test
782 branch: test
783 user: test
783 user: test
784 date: Thu Jan 01 00:00:00 1970 +0000
784 date: Thu Jan 01 00:00:00 1970 +0000
785 summary: commit on test
785 summary: commit on test
786
786
787
787
788
788
789 log -b 2
789 log -b 2
790
790
791 $ hg log -b 2
791 $ hg log -b 2
792 changeset: 2:c3a4f03cc9a7
792 changeset: 2:c3a4f03cc9a7
793 parent: 0:24427303d56f
793 parent: 0:24427303d56f
794 user: test
794 user: test
795 date: Thu Jan 01 00:00:00 1970 +0000
795 date: Thu Jan 01 00:00:00 1970 +0000
796 summary: commit on default
796 summary: commit on default
797
797
798 changeset: 0:24427303d56f
798 changeset: 0:24427303d56f
799 user: test
799 user: test
800 date: Thu Jan 01 00:00:00 1970 +0000
800 date: Thu Jan 01 00:00:00 1970 +0000
801 summary: commit on default
801 summary: commit on default
802
802
803
803
804
804
805 log -p --cwd dir (in subdir)
805 log -p --cwd dir (in subdir)
806
806
807 $ mkdir dir
807 $ mkdir dir
808 $ hg log -p --cwd dir
808 $ hg log -p --cwd dir
809 changeset: 3:f5d8de11c2e2
809 changeset: 3:f5d8de11c2e2
810 branch: test
810 branch: test
811 tag: tip
811 tag: tip
812 parent: 1:d32277701ccb
812 parent: 1:d32277701ccb
813 user: test
813 user: test
814 date: Thu Jan 01 00:00:00 1970 +0000
814 date: Thu Jan 01 00:00:00 1970 +0000
815 summary: commit on test
815 summary: commit on test
816
816
817 diff -r d32277701ccb -r f5d8de11c2e2 c
817 diff -r d32277701ccb -r f5d8de11c2e2 c
818 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
818 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
819 +++ b/c Thu Jan 01 00:00:00 1970 +0000
819 +++ b/c Thu Jan 01 00:00:00 1970 +0000
820 @@ -0,0 +1,1 @@
820 @@ -0,0 +1,1 @@
821 +c
821 +c
822
822
823 changeset: 2:c3a4f03cc9a7
823 changeset: 2:c3a4f03cc9a7
824 parent: 0:24427303d56f
824 parent: 0:24427303d56f
825 user: test
825 user: test
826 date: Thu Jan 01 00:00:00 1970 +0000
826 date: Thu Jan 01 00:00:00 1970 +0000
827 summary: commit on default
827 summary: commit on default
828
828
829 diff -r 24427303d56f -r c3a4f03cc9a7 c
829 diff -r 24427303d56f -r c3a4f03cc9a7 c
830 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
830 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
831 +++ b/c Thu Jan 01 00:00:00 1970 +0000
831 +++ b/c Thu Jan 01 00:00:00 1970 +0000
832 @@ -0,0 +1,1 @@
832 @@ -0,0 +1,1 @@
833 +c
833 +c
834
834
835 changeset: 1:d32277701ccb
835 changeset: 1:d32277701ccb
836 branch: test
836 branch: test
837 user: test
837 user: test
838 date: Thu Jan 01 00:00:00 1970 +0000
838 date: Thu Jan 01 00:00:00 1970 +0000
839 summary: commit on test
839 summary: commit on test
840
840
841 diff -r 24427303d56f -r d32277701ccb b
841 diff -r 24427303d56f -r d32277701ccb b
842 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
842 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
843 +++ b/b Thu Jan 01 00:00:00 1970 +0000
843 +++ b/b Thu Jan 01 00:00:00 1970 +0000
844 @@ -0,0 +1,1 @@
844 @@ -0,0 +1,1 @@
845 +b
845 +b
846
846
847 changeset: 0:24427303d56f
847 changeset: 0:24427303d56f
848 user: test
848 user: test
849 date: Thu Jan 01 00:00:00 1970 +0000
849 date: Thu Jan 01 00:00:00 1970 +0000
850 summary: commit on default
850 summary: commit on default
851
851
852 diff -r 000000000000 -r 24427303d56f a
852 diff -r 000000000000 -r 24427303d56f a
853 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
853 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
854 +++ b/a Thu Jan 01 00:00:00 1970 +0000
854 +++ b/a Thu Jan 01 00:00:00 1970 +0000
855 @@ -0,0 +1,1 @@
855 @@ -0,0 +1,1 @@
856 +a
856 +a
857
857
858
858
859
859
860 log -p -R repo
860 log -p -R repo
861
861
862 $ cd dir
862 $ cd dir
863 $ hg log -p -R .. ../a
863 $ hg log -p -R .. ../a
864 changeset: 0:24427303d56f
864 changeset: 0:24427303d56f
865 user: test
865 user: test
866 date: Thu Jan 01 00:00:00 1970 +0000
866 date: Thu Jan 01 00:00:00 1970 +0000
867 summary: commit on default
867 summary: commit on default
868
868
869 diff -r 000000000000 -r 24427303d56f a
869 diff -r 000000000000 -r 24427303d56f a
870 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
870 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
871 +++ b/a Thu Jan 01 00:00:00 1970 +0000
871 +++ b/a Thu Jan 01 00:00:00 1970 +0000
872 @@ -0,0 +1,1 @@
872 @@ -0,0 +1,1 @@
873 +a
873 +a
874
874
875
875
876 $ cd ../..
876 $ cd ../..
877
877
878 $ hg init follow2
878 $ hg init follow2
879 $ cd follow2
879 $ cd follow2
880
880
881 # Build the following history:
881 # Build the following history:
882 # tip - o - x - o - x - x
882 # tip - o - x - o - x - x
883 # \ /
883 # \ /
884 # o - o - o - x
884 # o - o - o - x
885 # \ /
885 # \ /
886 # o
886 # o
887 #
887 #
888 # Where "o" is a revision containing "foo" and
888 # Where "o" is a revision containing "foo" and
889 # "x" is a revision without "foo"
889 # "x" is a revision without "foo"
890
890
891 $ touch init
891 $ touch init
892 $ hg ci -A -m "init, unrelated"
892 $ hg ci -A -m "init, unrelated"
893 adding init
893 adding init
894 $ echo 'foo' > init
894 $ echo 'foo' > init
895 $ hg ci -m "change, unrelated"
895 $ hg ci -m "change, unrelated"
896 $ echo 'foo' > foo
896 $ echo 'foo' > foo
897 $ hg ci -A -m "add unrelated old foo"
897 $ hg ci -A -m "add unrelated old foo"
898 adding foo
898 adding foo
899 $ hg rm foo
899 $ hg rm foo
900 $ hg ci -m "delete foo, unrelated"
900 $ hg ci -m "delete foo, unrelated"
901 $ echo 'related' > foo
901 $ echo 'related' > foo
902 $ hg ci -A -m "add foo, related"
902 $ hg ci -A -m "add foo, related"
903 adding foo
903 adding foo
904
904
905 $ hg up 0
905 $ hg up 0
906 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
906 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
907 $ touch branch
907 $ touch branch
908 $ hg ci -A -m "first branch, unrelated"
908 $ hg ci -A -m "first branch, unrelated"
909 adding branch
909 adding branch
910 created new head
910 created new head
911 $ touch foo
911 $ touch foo
912 $ hg ci -A -m "create foo, related"
912 $ hg ci -A -m "create foo, related"
913 adding foo
913 adding foo
914 $ echo 'change' > foo
914 $ echo 'change' > foo
915 $ hg ci -m "change foo, related"
915 $ hg ci -m "change foo, related"
916
916
917 $ hg up 6
917 $ hg up 6
918 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
918 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
919 $ echo 'change foo in branch' > foo
919 $ echo 'change foo in branch' > foo
920 $ hg ci -m "change foo in branch, related"
920 $ hg ci -m "change foo in branch, related"
921 created new head
921 created new head
922 $ hg merge 7
922 $ hg merge 7
923 merging foo
923 merging foo
924 warning: conflicts during merge.
924 warning: conflicts during merge.
925 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
925 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
926 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
926 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
927 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
927 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
928 [1]
928 [1]
929 $ echo 'merge 1' > foo
929 $ echo 'merge 1' > foo
930 $ hg resolve -m foo
930 $ hg resolve -m foo
931 $ hg ci -m "First merge, related"
931 $ hg ci -m "First merge, related"
932
932
933 $ hg merge 4
933 $ hg merge 4
934 merging foo
934 merging foo
935 warning: conflicts during merge.
935 warning: conflicts during merge.
936 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
936 merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
937 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
937 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
938 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
938 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
939 [1]
939 [1]
940 $ echo 'merge 2' > foo
940 $ echo 'merge 2' > foo
941 $ hg resolve -m foo
941 $ hg resolve -m foo
942 $ hg ci -m "Last merge, related"
942 $ hg ci -m "Last merge, related"
943
943
944 $ hg log --graph
944 $ hg log --graph
945 @ changeset: 10:4dae8563d2c5
945 @ changeset: 10:4dae8563d2c5
946 |\ tag: tip
946 |\ tag: tip
947 | | parent: 9:7b35701b003e
947 | | parent: 9:7b35701b003e
948 | | parent: 4:88176d361b69
948 | | parent: 4:88176d361b69
949 | | user: test
949 | | user: test
950 | | date: Thu Jan 01 00:00:00 1970 +0000
950 | | date: Thu Jan 01 00:00:00 1970 +0000
951 | | summary: Last merge, related
951 | | summary: Last merge, related
952 | |
952 | |
953 | o changeset: 9:7b35701b003e
953 | o changeset: 9:7b35701b003e
954 | |\ parent: 8:e5416ad8a855
954 | |\ parent: 8:e5416ad8a855
955 | | | parent: 7:87fe3144dcfa
955 | | | parent: 7:87fe3144dcfa
956 | | | user: test
956 | | | user: test
957 | | | date: Thu Jan 01 00:00:00 1970 +0000
957 | | | date: Thu Jan 01 00:00:00 1970 +0000
958 | | | summary: First merge, related
958 | | | summary: First merge, related
959 | | |
959 | | |
960 | | o changeset: 8:e5416ad8a855
960 | | o changeset: 8:e5416ad8a855
961 | | | parent: 6:dc6c325fe5ee
961 | | | parent: 6:dc6c325fe5ee
962 | | | user: test
962 | | | user: test
963 | | | date: Thu Jan 01 00:00:00 1970 +0000
963 | | | date: Thu Jan 01 00:00:00 1970 +0000
964 | | | summary: change foo in branch, related
964 | | | summary: change foo in branch, related
965 | | |
965 | | |
966 | o | changeset: 7:87fe3144dcfa
966 | o | changeset: 7:87fe3144dcfa
967 | |/ user: test
967 | |/ user: test
968 | | date: Thu Jan 01 00:00:00 1970 +0000
968 | | date: Thu Jan 01 00:00:00 1970 +0000
969 | | summary: change foo, related
969 | | summary: change foo, related
970 | |
970 | |
971 | o changeset: 6:dc6c325fe5ee
971 | o changeset: 6:dc6c325fe5ee
972 | | user: test
972 | | user: test
973 | | date: Thu Jan 01 00:00:00 1970 +0000
973 | | date: Thu Jan 01 00:00:00 1970 +0000
974 | | summary: create foo, related
974 | | summary: create foo, related
975 | |
975 | |
976 | o changeset: 5:73db34516eb9
976 | o changeset: 5:73db34516eb9
977 | | parent: 0:e87515fd044a
977 | | parent: 0:e87515fd044a
978 | | user: test
978 | | user: test
979 | | date: Thu Jan 01 00:00:00 1970 +0000
979 | | date: Thu Jan 01 00:00:00 1970 +0000
980 | | summary: first branch, unrelated
980 | | summary: first branch, unrelated
981 | |
981 | |
982 o | changeset: 4:88176d361b69
982 o | changeset: 4:88176d361b69
983 | | user: test
983 | | user: test
984 | | date: Thu Jan 01 00:00:00 1970 +0000
984 | | date: Thu Jan 01 00:00:00 1970 +0000
985 | | summary: add foo, related
985 | | summary: add foo, related
986 | |
986 | |
987 o | changeset: 3:dd78ae4afb56
987 o | changeset: 3:dd78ae4afb56
988 | | user: test
988 | | user: test
989 | | date: Thu Jan 01 00:00:00 1970 +0000
989 | | date: Thu Jan 01 00:00:00 1970 +0000
990 | | summary: delete foo, unrelated
990 | | summary: delete foo, unrelated
991 | |
991 | |
992 o | changeset: 2:c4c64aedf0f7
992 o | changeset: 2:c4c64aedf0f7
993 | | user: test
993 | | user: test
994 | | date: Thu Jan 01 00:00:00 1970 +0000
994 | | date: Thu Jan 01 00:00:00 1970 +0000
995 | | summary: add unrelated old foo
995 | | summary: add unrelated old foo
996 | |
996 | |
997 o | changeset: 1:e5faa7440653
997 o | changeset: 1:e5faa7440653
998 |/ user: test
998 |/ user: test
999 | date: Thu Jan 01 00:00:00 1970 +0000
999 | date: Thu Jan 01 00:00:00 1970 +0000
1000 | summary: change, unrelated
1000 | summary: change, unrelated
1001 |
1001 |
1002 o changeset: 0:e87515fd044a
1002 o changeset: 0:e87515fd044a
1003 user: test
1003 user: test
1004 date: Thu Jan 01 00:00:00 1970 +0000
1004 date: Thu Jan 01 00:00:00 1970 +0000
1005 summary: init, unrelated
1005 summary: init, unrelated
1006
1006
1007
1007
1008 $ hg --traceback log -f foo
1008 $ hg --traceback log -f foo
1009 changeset: 10:4dae8563d2c5
1009 changeset: 10:4dae8563d2c5
1010 tag: tip
1010 tag: tip
1011 parent: 9:7b35701b003e
1011 parent: 9:7b35701b003e
1012 parent: 4:88176d361b69
1012 parent: 4:88176d361b69
1013 user: test
1013 user: test
1014 date: Thu Jan 01 00:00:00 1970 +0000
1014 date: Thu Jan 01 00:00:00 1970 +0000
1015 summary: Last merge, related
1015 summary: Last merge, related
1016
1016
1017 changeset: 9:7b35701b003e
1017 changeset: 9:7b35701b003e
1018 parent: 8:e5416ad8a855
1018 parent: 8:e5416ad8a855
1019 parent: 7:87fe3144dcfa
1019 parent: 7:87fe3144dcfa
1020 user: test
1020 user: test
1021 date: Thu Jan 01 00:00:00 1970 +0000
1021 date: Thu Jan 01 00:00:00 1970 +0000
1022 summary: First merge, related
1022 summary: First merge, related
1023
1023
1024 changeset: 8:e5416ad8a855
1024 changeset: 8:e5416ad8a855
1025 parent: 6:dc6c325fe5ee
1025 parent: 6:dc6c325fe5ee
1026 user: test
1026 user: test
1027 date: Thu Jan 01 00:00:00 1970 +0000
1027 date: Thu Jan 01 00:00:00 1970 +0000
1028 summary: change foo in branch, related
1028 summary: change foo in branch, related
1029
1029
1030 changeset: 7:87fe3144dcfa
1030 changeset: 7:87fe3144dcfa
1031 user: test
1031 user: test
1032 date: Thu Jan 01 00:00:00 1970 +0000
1032 date: Thu Jan 01 00:00:00 1970 +0000
1033 summary: change foo, related
1033 summary: change foo, related
1034
1034
1035 changeset: 6:dc6c325fe5ee
1035 changeset: 6:dc6c325fe5ee
1036 user: test
1036 user: test
1037 date: Thu Jan 01 00:00:00 1970 +0000
1037 date: Thu Jan 01 00:00:00 1970 +0000
1038 summary: create foo, related
1038 summary: create foo, related
1039
1039
1040 changeset: 4:88176d361b69
1040 changeset: 4:88176d361b69
1041 user: test
1041 user: test
1042 date: Thu Jan 01 00:00:00 1970 +0000
1042 date: Thu Jan 01 00:00:00 1970 +0000
1043 summary: add foo, related
1043 summary: add foo, related
1044
1044
1045
1045
1046 Also check when maxrev < lastrevfilelog
1046 Also check when maxrev < lastrevfilelog
1047
1047
1048 $ hg --traceback log -f -r4 foo
1048 $ hg --traceback log -f -r4 foo
1049 changeset: 4:88176d361b69
1049 changeset: 4:88176d361b69
1050 user: test
1050 user: test
1051 date: Thu Jan 01 00:00:00 1970 +0000
1051 date: Thu Jan 01 00:00:00 1970 +0000
1052 summary: add foo, related
1052 summary: add foo, related
1053
1053
1054 $ cd ..
1054 $ cd ..
1055
1055
1056 Issue2383: hg log showing _less_ differences than hg diff
1056 Issue2383: hg log showing _less_ differences than hg diff
1057
1057
1058 $ hg init issue2383
1058 $ hg init issue2383
1059 $ cd issue2383
1059 $ cd issue2383
1060
1060
1061 Create a test repo:
1061 Create a test repo:
1062
1062
1063 $ echo a > a
1063 $ echo a > a
1064 $ hg ci -Am0
1064 $ hg ci -Am0
1065 adding a
1065 adding a
1066 $ echo b > b
1066 $ echo b > b
1067 $ hg ci -Am1
1067 $ hg ci -Am1
1068 adding b
1068 adding b
1069 $ hg co 0
1069 $ hg co 0
1070 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1070 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1071 $ echo b > a
1071 $ echo b > a
1072 $ hg ci -m2
1072 $ hg ci -m2
1073 created new head
1073 created new head
1074
1074
1075 Merge:
1075 Merge:
1076
1076
1077 $ hg merge
1077 $ hg merge
1078 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1078 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1079 (branch merge, don't forget to commit)
1079 (branch merge, don't forget to commit)
1080
1080
1081 Make sure there's a file listed in the merge to trigger the bug:
1081 Make sure there's a file listed in the merge to trigger the bug:
1082
1082
1083 $ echo c > a
1083 $ echo c > a
1084 $ hg ci -m3
1084 $ hg ci -m3
1085
1085
1086 Two files shown here in diff:
1086 Two files shown here in diff:
1087
1087
1088 $ hg diff --rev 2:3
1088 $ hg diff --rev 2:3
1089 diff -r b09be438c43a -r 8e07aafe1edc a
1089 diff -r b09be438c43a -r 8e07aafe1edc a
1090 --- a/a Thu Jan 01 00:00:00 1970 +0000
1090 --- a/a Thu Jan 01 00:00:00 1970 +0000
1091 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1091 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1092 @@ -1,1 +1,1 @@
1092 @@ -1,1 +1,1 @@
1093 -b
1093 -b
1094 +c
1094 +c
1095 diff -r b09be438c43a -r 8e07aafe1edc b
1095 diff -r b09be438c43a -r 8e07aafe1edc b
1096 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1096 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1097 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1097 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1098 @@ -0,0 +1,1 @@
1098 @@ -0,0 +1,1 @@
1099 +b
1099 +b
1100
1100
1101 Diff here should be the same:
1101 Diff here should be the same:
1102
1102
1103 $ hg log -vpr 3
1103 $ hg log -vpr 3
1104 changeset: 3:8e07aafe1edc
1104 changeset: 3:8e07aafe1edc
1105 tag: tip
1105 tag: tip
1106 parent: 2:b09be438c43a
1106 parent: 2:b09be438c43a
1107 parent: 1:925d80f479bb
1107 parent: 1:925d80f479bb
1108 user: test
1108 user: test
1109 date: Thu Jan 01 00:00:00 1970 +0000
1109 date: Thu Jan 01 00:00:00 1970 +0000
1110 files: a
1110 files: a
1111 description:
1111 description:
1112 3
1112 3
1113
1113
1114
1114
1115 diff -r b09be438c43a -r 8e07aafe1edc a
1115 diff -r b09be438c43a -r 8e07aafe1edc a
1116 --- a/a Thu Jan 01 00:00:00 1970 +0000
1116 --- a/a Thu Jan 01 00:00:00 1970 +0000
1117 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1117 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1118 @@ -1,1 +1,1 @@
1118 @@ -1,1 +1,1 @@
1119 -b
1119 -b
1120 +c
1120 +c
1121 diff -r b09be438c43a -r 8e07aafe1edc b
1121 diff -r b09be438c43a -r 8e07aafe1edc b
1122 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1122 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1123 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1123 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1124 @@ -0,0 +1,1 @@
1124 @@ -0,0 +1,1 @@
1125 +b
1125 +b
1126
1126
1127 $ cd ..
1127 $ cd ..
1128
1128
1129 'hg log -r rev fn' when last(filelog(fn)) != rev
1129 'hg log -r rev fn' when last(filelog(fn)) != rev
1130
1130
1131 $ hg init simplelog
1131 $ hg init simplelog
1132 $ cd simplelog
1132 $ cd simplelog
1133 $ echo f > a
1133 $ echo f > a
1134 $ hg ci -Am'a' -d '0 0'
1134 $ hg ci -Am'a' -d '0 0'
1135 adding a
1135 adding a
1136 $ echo f >> a
1136 $ echo f >> a
1137 $ hg ci -Am'a bis' -d '1 0'
1137 $ hg ci -Am'a bis' -d '1 0'
1138
1138
1139 $ hg log -r0 a
1139 $ hg log -r0 a
1140 changeset: 0:9f758d63dcde
1140 changeset: 0:9f758d63dcde
1141 user: test
1141 user: test
1142 date: Thu Jan 01 00:00:00 1970 +0000
1142 date: Thu Jan 01 00:00:00 1970 +0000
1143 summary: a
1143 summary: a
1144
1144
1145 enable obsolete to test hidden feature
1145 enable obsolete to test hidden feature
1146
1146
1147 $ cat > ${TESTTMP}/obs.py << EOF
1147 $ cat > ${TESTTMP}/obs.py << EOF
1148 > import mercurial.obsolete
1148 > import mercurial.obsolete
1149 > mercurial.obsolete._enabled = True
1149 > mercurial.obsolete._enabled = True
1150 > EOF
1150 > EOF
1151 $ echo '[extensions]' >> $HGRCPATH
1151 $ echo '[extensions]' >> $HGRCPATH
1152 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
1152 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
1153
1153
1154 $ hg log --template='{rev}:{node}\n'
1154 $ hg log --template='{rev}:{node}\n'
1155 1:a765632148dc55d38c35c4f247c618701886cb2f
1155 1:a765632148dc55d38c35c4f247c618701886cb2f
1156 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1156 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1157 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1157 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
1158 $ hg up null -q
1158 $ hg up null -q
1159 $ hg log --template='{rev}:{node}\n'
1159 $ hg log --template='{rev}:{node}\n'
1160 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1160 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1161 $ hg log --template='{rev}:{node}\n' --hidden
1161 $ hg log --template='{rev}:{node}\n' --hidden
1162 1:a765632148dc55d38c35c4f247c618701886cb2f
1162 1:a765632148dc55d38c35c4f247c618701886cb2f
1163 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1163 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1164
1164
1165 test that parent prevent a changeset to be hidden
1166
1167 $ hg up 1 -q
1168 $ hg log --template='{rev}:{node}\n'
1169 1:a765632148dc55d38c35c4f247c618701886cb2f
1170 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1171
1172 test that second parent prevent a changeset to be hidden too
1173
1174 $ hg debugsetparents 0 1 # nothing suitable to merge here
1175 $ hg log --template='{rev}:{node}\n'
1176 1:a765632148dc55d38c35c4f247c618701886cb2f
1177 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
1178
1165 clear extensions configuration
1179 clear extensions configuration
1166 $ echo '[extensions]' >> $HGRCPATH
1180 $ echo '[extensions]' >> $HGRCPATH
1167 $ echo "obs=!" >> $HGRCPATH
1181 $ echo "obs=!" >> $HGRCPATH
1168 $ cd ..
1182 $ cd ..
1169
1183
1170 test -u/-k for problematic encoding
1184 test -u/-k for problematic encoding
1171 # unicode: cp932:
1185 # unicode: cp932:
1172 # u30A2 0x83 0x41(= 'A')
1186 # u30A2 0x83 0x41(= 'A')
1173 # u30C2 0x83 0x61(= 'a')
1187 # u30C2 0x83 0x61(= 'a')
1174
1188
1175 $ hg init problematicencoding
1189 $ hg init problematicencoding
1176 $ cd problematicencoding
1190 $ cd problematicencoding
1177
1191
1178 $ python > setup.sh <<EOF
1192 $ python > setup.sh <<EOF
1179 > print u'''
1193 > print u'''
1180 > echo a > text
1194 > echo a > text
1181 > hg add text
1195 > hg add text
1182 > hg --encoding utf-8 commit -u '\u30A2' -m none
1196 > hg --encoding utf-8 commit -u '\u30A2' -m none
1183 > echo b > text
1197 > echo b > text
1184 > hg --encoding utf-8 commit -u '\u30C2' -m none
1198 > hg --encoding utf-8 commit -u '\u30C2' -m none
1185 > echo c > text
1199 > echo c > text
1186 > hg --encoding utf-8 commit -u none -m '\u30A2'
1200 > hg --encoding utf-8 commit -u none -m '\u30A2'
1187 > echo d > text
1201 > echo d > text
1188 > hg --encoding utf-8 commit -u none -m '\u30C2'
1202 > hg --encoding utf-8 commit -u none -m '\u30C2'
1189 > '''.encode('utf-8')
1203 > '''.encode('utf-8')
1190 > EOF
1204 > EOF
1191 $ sh < setup.sh
1205 $ sh < setup.sh
1192
1206
1193 test in problematic encoding
1207 test in problematic encoding
1194 $ python > test.sh <<EOF
1208 $ python > test.sh <<EOF
1195 > print u'''
1209 > print u'''
1196 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1210 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
1197 > echo ====
1211 > echo ====
1198 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1212 > hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
1199 > echo ====
1213 > echo ====
1200 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1214 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
1201 > echo ====
1215 > echo ====
1202 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1216 > hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
1203 > '''.encode('cp932')
1217 > '''.encode('cp932')
1204 > EOF
1218 > EOF
1205 $ sh < test.sh
1219 $ sh < test.sh
1206 0
1220 0
1207 ====
1221 ====
1208 1
1222 1
1209 ====
1223 ====
1210 2
1224 2
1211 0
1225 0
1212 ====
1226 ====
1213 3
1227 3
1214 1
1228 1
1215
1229
1216 $ cd ..
1230 $ cd ..
1217
1231
1218 test hg log on non-existent files and on directories
1232 test hg log on non-existent files and on directories
1219 $ hg init issue1340
1233 $ hg init issue1340
1220 $ cd issue1340
1234 $ cd issue1340
1221 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1235 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
1222 $ echo 1 > d1/f1
1236 $ echo 1 > d1/f1
1223 $ echo 1 > D2/f1
1237 $ echo 1 > D2/f1
1224 $ echo 1 > D3.i/f1
1238 $ echo 1 > D3.i/f1
1225 $ echo 1 > d4.hg/f1
1239 $ echo 1 > d4.hg/f1
1226 $ echo 1 > d5.d/f1
1240 $ echo 1 > d5.d/f1
1227 $ echo 1 > .d6/f1
1241 $ echo 1 > .d6/f1
1228 $ hg -q add .
1242 $ hg -q add .
1229 $ hg commit -m "a bunch of weird directories"
1243 $ hg commit -m "a bunch of weird directories"
1230 $ hg log -l1 d1/f1 | grep changeset
1244 $ hg log -l1 d1/f1 | grep changeset
1231 changeset: 0:65624cd9070a
1245 changeset: 0:65624cd9070a
1232 $ hg log -l1 f1
1246 $ hg log -l1 f1
1233 $ hg log -l1 . | grep changeset
1247 $ hg log -l1 . | grep changeset
1234 changeset: 0:65624cd9070a
1248 changeset: 0:65624cd9070a
1235 $ hg log -l1 ./ | grep changeset
1249 $ hg log -l1 ./ | grep changeset
1236 changeset: 0:65624cd9070a
1250 changeset: 0:65624cd9070a
1237 $ hg log -l1 d1 | grep changeset
1251 $ hg log -l1 d1 | grep changeset
1238 changeset: 0:65624cd9070a
1252 changeset: 0:65624cd9070a
1239 $ hg log -l1 D2 | grep changeset
1253 $ hg log -l1 D2 | grep changeset
1240 changeset: 0:65624cd9070a
1254 changeset: 0:65624cd9070a
1241 $ hg log -l1 D2/f1 | grep changeset
1255 $ hg log -l1 D2/f1 | grep changeset
1242 changeset: 0:65624cd9070a
1256 changeset: 0:65624cd9070a
1243 $ hg log -l1 D3.i | grep changeset
1257 $ hg log -l1 D3.i | grep changeset
1244 changeset: 0:65624cd9070a
1258 changeset: 0:65624cd9070a
1245 $ hg log -l1 D3.i/f1 | grep changeset
1259 $ hg log -l1 D3.i/f1 | grep changeset
1246 changeset: 0:65624cd9070a
1260 changeset: 0:65624cd9070a
1247 $ hg log -l1 d4.hg | grep changeset
1261 $ hg log -l1 d4.hg | grep changeset
1248 changeset: 0:65624cd9070a
1262 changeset: 0:65624cd9070a
1249 $ hg log -l1 d4.hg/f1 | grep changeset
1263 $ hg log -l1 d4.hg/f1 | grep changeset
1250 changeset: 0:65624cd9070a
1264 changeset: 0:65624cd9070a
1251 $ hg log -l1 d5.d | grep changeset
1265 $ hg log -l1 d5.d | grep changeset
1252 changeset: 0:65624cd9070a
1266 changeset: 0:65624cd9070a
1253 $ hg log -l1 d5.d/f1 | grep changeset
1267 $ hg log -l1 d5.d/f1 | grep changeset
1254 changeset: 0:65624cd9070a
1268 changeset: 0:65624cd9070a
1255 $ hg log -l1 .d6 | grep changeset
1269 $ hg log -l1 .d6 | grep changeset
1256 changeset: 0:65624cd9070a
1270 changeset: 0:65624cd9070a
1257 $ hg log -l1 .d6/f1 | grep changeset
1271 $ hg log -l1 .d6/f1 | grep changeset
1258 changeset: 0:65624cd9070a
1272 changeset: 0:65624cd9070a
1259 $ cd ..
1273 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now