##// END OF EJS Templates
documentation: update to new filter names...
Pierre-Yves David -
r18462:593eb378 stable
parent child Browse files
Show More
@@ -1,219 +1,219 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 import obsolete, bookmarks, revset
12 import obsolete, bookmarks, revset
13
13
14
14
15 def hideablerevs(repo):
15 def hideablerevs(repo):
16 """Revisions candidates to be hidden
16 """Revisions candidates to be hidden
17
17
18 This is a standalone function to help extensions to wrap it."""
18 This is a standalone function to help extensions to wrap it."""
19 return obsolete.getrevs(repo, 'obsolete')
19 return obsolete.getrevs(repo, 'obsolete')
20
20
21 def computehidden(repo):
21 def computehidden(repo):
22 """compute the set of hidden revision to filter
22 """compute the set of hidden revision to filter
23
23
24 During most operation hidden should be filtered."""
24 During most operation hidden should be filtered."""
25 assert not repo.changelog.filteredrevs
25 assert not repo.changelog.filteredrevs
26 hideable = hideablerevs(repo)
26 hideable = hideablerevs(repo)
27 if hideable:
27 if hideable:
28 cl = repo.changelog
28 cl = repo.changelog
29 firsthideable = min(hideable)
29 firsthideable = min(hideable)
30 revs = cl.revs(start=firsthideable)
30 revs = cl.revs(start=firsthideable)
31 blockers = [r for r in revset._children(repo, revs, hideable)
31 blockers = [r for r in revset._children(repo, revs, hideable)
32 if r not in hideable]
32 if r not in hideable]
33 for par in repo[None].parents():
33 for par in repo[None].parents():
34 blockers.append(par.rev())
34 blockers.append(par.rev())
35 for bm in bookmarks.listbookmarks(repo).values():
35 for bm in bookmarks.listbookmarks(repo).values():
36 blockers.append(repo[bm].rev())
36 blockers.append(repo[bm].rev())
37 blocked = cl.ancestors(blockers, inclusive=True)
37 blocked = cl.ancestors(blockers, inclusive=True)
38 return frozenset(r for r in hideable if r not in blocked)
38 return frozenset(r for r in hideable if r not in blocked)
39 return frozenset()
39 return frozenset()
40
40
41 def computeunserved(repo):
41 def computeunserved(repo):
42 """compute the set of revision that should be filtered when used a server
42 """compute the set of revision that should be filtered when used a server
43
43
44 Secret and hidden changeset should not pretend to be here."""
44 Secret and hidden changeset should not pretend to be here."""
45 assert not repo.changelog.filteredrevs
45 assert not repo.changelog.filteredrevs
46 # fast path in simple case to avoid impact of non optimised code
46 # fast path in simple case to avoid impact of non optimised code
47 hiddens = filterrevs(repo, 'visible')
47 hiddens = filterrevs(repo, 'visible')
48 if phases.hassecret(repo):
48 if phases.hassecret(repo):
49 cl = repo.changelog
49 cl = repo.changelog
50 secret = phases.secret
50 secret = phases.secret
51 getphase = repo._phasecache.phase
51 getphase = repo._phasecache.phase
52 first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret])
52 first = min(cl.rev(n) for n in repo._phasecache.phaseroots[secret])
53 revs = cl.revs(start=first)
53 revs = cl.revs(start=first)
54 secrets = set(r for r in revs if getphase(repo, r) >= secret)
54 secrets = set(r for r in revs if getphase(repo, r) >= secret)
55 return frozenset(hiddens | secrets)
55 return frozenset(hiddens | secrets)
56 else:
56 else:
57 return hiddens
57 return hiddens
58 return frozenset()
58 return frozenset()
59
59
60 def computemutable(repo):
60 def computemutable(repo):
61 """compute the set of revision that should be filtered when used a server
61 """compute the set of revision that should be filtered when used a server
62
62
63 Secret and hidden changeset should not pretend to be here."""
63 Secret and hidden changeset should not pretend to be here."""
64 assert not repo.changelog.filteredrevs
64 assert not repo.changelog.filteredrevs
65 # fast check to avoid revset call on huge repo
65 # fast check to avoid revset call on huge repo
66 if util.any(repo._phasecache.phaseroots[1:]):
66 if util.any(repo._phasecache.phaseroots[1:]):
67 getphase = repo._phasecache.phase
67 getphase = repo._phasecache.phase
68 maymutable = filterrevs(repo, 'base')
68 maymutable = filterrevs(repo, 'base')
69 return frozenset(r for r in maymutable if getphase(repo, r))
69 return frozenset(r for r in maymutable if getphase(repo, r))
70 return frozenset()
70 return frozenset()
71
71
72 def computeimpactable(repo):
72 def computeimpactable(repo):
73 """Everything impactable by mutable revision
73 """Everything impactable by mutable revision
74
74
75 The mutable filter still have some chance to get invalidated. This will
75 The immutable filter still have some chance to get invalidated. This will
76 happen when:
76 happen when:
77
77
78 - you garbage collect hidden changeset,
78 - you garbage collect hidden changeset,
79 - public phase is moved backward,
79 - public phase is moved backward,
80 - something is changed in the filtering (this could be fixed)
80 - something is changed in the filtering (this could be fixed)
81
81
82 This filter out any mutable changeset and any public changeset that may be
82 This filter out any mutable changeset and any public changeset that may be
83 impacted by something happening to a mutable revision.
83 impacted by something happening to a mutable revision.
84
84
85 This is achieved by filtered everything with a revision number egal or
85 This is achieved by filtered everything with a revision number egal or
86 higher than the first mutable changeset is filtered."""
86 higher than the first mutable changeset is filtered."""
87 assert not repo.changelog.filteredrevs
87 assert not repo.changelog.filteredrevs
88 cl = repo.changelog
88 cl = repo.changelog
89 firstmutable = len(cl)
89 firstmutable = len(cl)
90 for roots in repo._phasecache.phaseroots[1:]:
90 for roots in repo._phasecache.phaseroots[1:]:
91 if roots:
91 if roots:
92 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
92 firstmutable = min(firstmutable, min(cl.rev(r) for r in roots))
93 # protect from nullrev root
93 # protect from nullrev root
94 firstmutable = max(0, firstmutable)
94 firstmutable = max(0, firstmutable)
95 return frozenset(xrange(firstmutable, len(cl)))
95 return frozenset(xrange(firstmutable, len(cl)))
96
96
97 # function to compute filtered set
97 # function to compute filtered set
98 filtertable = {'visible': computehidden,
98 filtertable = {'visible': computehidden,
99 'served': computeunserved,
99 'served': computeunserved,
100 'immutable': computemutable,
100 'immutable': computemutable,
101 'base': computeimpactable}
101 'base': computeimpactable}
102 ### Nearest subset relation
102 ### Nearest subset relation
103 # Nearest subset of filter X is a filter Y so that:
103 # Nearest subset of filter X is a filter Y so that:
104 # * Y is included in X,
104 # * Y is included in X,
105 # * X - Y is as small as possible.
105 # * X - Y is as small as possible.
106 # This create and ordering used for branchmap purpose.
106 # This create and ordering used for branchmap purpose.
107 # the ordering may be partial
107 # the ordering may be partial
108 subsettable = {None: 'visible',
108 subsettable = {None: 'visible',
109 'visible': 'served',
109 'visible': 'served',
110 'served': 'immutable',
110 'served': 'immutable',
111 'immutable': 'base'}
111 'immutable': 'base'}
112
112
113 def filterrevs(repo, filtername):
113 def filterrevs(repo, filtername):
114 """returns set of filtered revision for this filter name"""
114 """returns set of filtered revision for this filter name"""
115 if filtername not in repo.filteredrevcache:
115 if filtername not in repo.filteredrevcache:
116 func = filtertable[filtername]
116 func = filtertable[filtername]
117 repo.filteredrevcache[filtername] = func(repo.unfiltered())
117 repo.filteredrevcache[filtername] = func(repo.unfiltered())
118 return repo.filteredrevcache[filtername]
118 return repo.filteredrevcache[filtername]
119
119
120 class repoview(object):
120 class repoview(object):
121 """Provide a read/write view of a repo through a filtered changelog
121 """Provide a read/write view of a repo through a filtered changelog
122
122
123 This object is used to access a filtered version of a repository without
123 This object is used to access a filtered version of a repository without
124 altering the original repository object itself. We can not alter the
124 altering the original repository object itself. We can not alter the
125 original object for two main reasons:
125 original object for two main reasons:
126 - It prevents the use of a repo with multiple filters at the same time. In
126 - It prevents the use of a repo with multiple filters at the same time. In
127 particular when multiple threads are involved.
127 particular when multiple threads are involved.
128 - It makes scope of the filtering harder to control.
128 - It makes scope of the filtering harder to control.
129
129
130 This object behaves very closely to the original repository. All attribute
130 This object behaves very closely to the original repository. All attribute
131 operations are done on the original repository:
131 operations are done on the original repository:
132 - An access to `repoview.someattr` actually returns `repo.someattr`,
132 - An access to `repoview.someattr` actually returns `repo.someattr`,
133 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
133 - A write to `repoview.someattr` actually sets value of `repo.someattr`,
134 - A deletion of `repoview.someattr` actually drops `someattr`
134 - A deletion of `repoview.someattr` actually drops `someattr`
135 from `repo.__dict__`.
135 from `repo.__dict__`.
136
136
137 The only exception is the `changelog` property. It is overridden to return
137 The only exception is the `changelog` property. It is overridden to return
138 a (surface) copy of `repo.changelog` with some revisions filtered. The
138 a (surface) copy of `repo.changelog` with some revisions filtered. The
139 `filtername` attribute of the view control the revisions that need to be
139 `filtername` attribute of the view control the revisions that need to be
140 filtered. (the fact the changelog is copied is an implementation detail).
140 filtered. (the fact the changelog is copied is an implementation detail).
141
141
142 Unlike attributes, this object intercepts all method calls. This means that
142 Unlike attributes, this object intercepts all method calls. This means that
143 all methods are run on the `repoview` object with the filtered `changelog`
143 all methods are run on the `repoview` object with the filtered `changelog`
144 property. For this purpose the simple `repoview` class must be mixed with
144 property. For this purpose the simple `repoview` class must be mixed with
145 the actual class of the repository. This ensures that the resulting
145 the actual class of the repository. This ensures that the resulting
146 `repoview` object have the very same methods than the repo object. This
146 `repoview` object have the very same methods than the repo object. This
147 leads to the property below.
147 leads to the property below.
148
148
149 repoview.method() --> repo.__class__.method(repoview)
149 repoview.method() --> repo.__class__.method(repoview)
150
150
151 The inheritance has to be done dynamically because `repo` can be of any
151 The inheritance has to be done dynamically because `repo` can be of any
152 subclasses of `localrepo`. Eg: `bundlerepo` or `httprepo`.
152 subclasses of `localrepo`. Eg: `bundlerepo` or `httprepo`.
153 """
153 """
154
154
155 def __init__(self, repo, filtername):
155 def __init__(self, repo, filtername):
156 object.__setattr__(self, '_unfilteredrepo', repo)
156 object.__setattr__(self, '_unfilteredrepo', repo)
157 object.__setattr__(self, 'filtername', filtername)
157 object.__setattr__(self, 'filtername', filtername)
158 object.__setattr__(self, '_clcachekey', None)
158 object.__setattr__(self, '_clcachekey', None)
159 object.__setattr__(self, '_clcache', None)
159 object.__setattr__(self, '_clcache', None)
160
160
161 # not a cacheproperty on purpose we shall implement a proper cache later
161 # not a cacheproperty on purpose we shall implement a proper cache later
162 @property
162 @property
163 def changelog(self):
163 def changelog(self):
164 """return a filtered version of the changeset
164 """return a filtered version of the changeset
165
165
166 this changelog must not be used for writing"""
166 this changelog must not be used for writing"""
167 # some cache may be implemented later
167 # some cache may be implemented later
168 unfi = self._unfilteredrepo
168 unfi = self._unfilteredrepo
169 unfichangelog = unfi.changelog
169 unfichangelog = unfi.changelog
170 revs = filterrevs(unfi, self.filtername)
170 revs = filterrevs(unfi, self.filtername)
171 cl = self._clcache
171 cl = self._clcache
172 newkey = (len(unfichangelog), unfichangelog.tip(), hash(revs))
172 newkey = (len(unfichangelog), unfichangelog.tip(), hash(revs))
173 if cl is not None:
173 if cl is not None:
174 # we need to check curkey too for some obscure reason.
174 # we need to check curkey too for some obscure reason.
175 # MQ test show a corruption of the underlying repo (in _clcache)
175 # MQ test show a corruption of the underlying repo (in _clcache)
176 # without change in the cachekey.
176 # without change in the cachekey.
177 oldfilter = cl.filteredrevs
177 oldfilter = cl.filteredrevs
178 try:
178 try:
179 cl.filterrevs = () # disable filtering for tip
179 cl.filterrevs = () # disable filtering for tip
180 curkey = (len(cl), cl.tip(), hash(oldfilter))
180 curkey = (len(cl), cl.tip(), hash(oldfilter))
181 finally:
181 finally:
182 cl.filteredrevs = oldfilter
182 cl.filteredrevs = oldfilter
183 if newkey != self._clcachekey or newkey != curkey:
183 if newkey != self._clcachekey or newkey != curkey:
184 cl = None
184 cl = None
185 # could have been made None by the previous if
185 # could have been made None by the previous if
186 if cl is None:
186 if cl is None:
187 cl = copy.copy(unfichangelog)
187 cl = copy.copy(unfichangelog)
188 cl.filteredrevs = revs
188 cl.filteredrevs = revs
189 object.__setattr__(self, '_clcache', cl)
189 object.__setattr__(self, '_clcache', cl)
190 object.__setattr__(self, '_clcachekey', newkey)
190 object.__setattr__(self, '_clcachekey', newkey)
191 return cl
191 return cl
192
192
193 def unfiltered(self):
193 def unfiltered(self):
194 """Return an unfiltered version of a repo"""
194 """Return an unfiltered version of a repo"""
195 return self._unfilteredrepo
195 return self._unfilteredrepo
196
196
197 def filtered(self, name):
197 def filtered(self, name):
198 """Return a filtered version of a repository"""
198 """Return a filtered version of a repository"""
199 if name == self.filtername:
199 if name == self.filtername:
200 return self
200 return self
201 return self.unfiltered().filtered(name)
201 return self.unfiltered().filtered(name)
202
202
203 # everything access are forwarded to the proxied repo
203 # everything access are forwarded to the proxied repo
204 def __getattr__(self, attr):
204 def __getattr__(self, attr):
205 return getattr(self._unfilteredrepo, attr)
205 return getattr(self._unfilteredrepo, attr)
206
206
207 def __setattr__(self, attr, value):
207 def __setattr__(self, attr, value):
208 return setattr(self._unfilteredrepo, attr, value)
208 return setattr(self._unfilteredrepo, attr, value)
209
209
210 def __delattr__(self, attr):
210 def __delattr__(self, attr):
211 return delattr(self._unfilteredrepo, attr)
211 return delattr(self._unfilteredrepo, attr)
212
212
213 # The `requirement` attribut is initialiazed during __init__. But
213 # The `requirement` attribut is initialiazed during __init__. But
214 # __getattr__ won't be called as it also exists on the class. We need
214 # __getattr__ won't be called as it also exists on the class. We need
215 # explicit forwarding to main repo here
215 # explicit forwarding to main repo here
216 @property
216 @property
217 def requirements(self):
217 def requirements(self):
218 return self._unfilteredrepo.requirements
218 return self._unfilteredrepo.requirements
219
219
@@ -1,1154 +1,1154 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > keyword =
3 > keyword =
4 > mq =
4 > mq =
5 > notify =
5 > notify =
6 > record =
6 > record =
7 > transplant =
7 > transplant =
8 > [ui]
8 > [ui]
9 > interactive = true
9 > interactive = true
10 > EOF
10 > EOF
11
11
12 hide outer repo
12 hide outer repo
13 $ hg init
13 $ hg init
14
14
15 Run kwdemo before [keyword] files are set up
15 Run kwdemo before [keyword] files are set up
16 as it would succeed without uisetup otherwise
16 as it would succeed without uisetup otherwise
17
17
18 $ hg --quiet kwdemo
18 $ hg --quiet kwdemo
19 [extensions]
19 [extensions]
20 keyword =
20 keyword =
21 [keyword]
21 [keyword]
22 demo.txt =
22 demo.txt =
23 [keywordset]
23 [keywordset]
24 svn = False
24 svn = False
25 [keywordmaps]
25 [keywordmaps]
26 Author = {author|user}
26 Author = {author|user}
27 Date = {date|utcdate}
27 Date = {date|utcdate}
28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
28 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
29 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
30 RCSFile = {file|basename},v
30 RCSFile = {file|basename},v
31 RCSfile = {file|basename},v
31 RCSfile = {file|basename},v
32 Revision = {node|short}
32 Revision = {node|short}
33 Source = {root}/{file},v
33 Source = {root}/{file},v
34 $Author: test $
34 $Author: test $
35 $Date: ????/??/?? ??:??:?? $ (glob)
35 $Date: ????/??/?? ??:??:?? $ (glob)
36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
38 $RCSFile: demo.txt,v $
38 $RCSFile: demo.txt,v $
39 $RCSfile: demo.txt,v $
39 $RCSfile: demo.txt,v $
40 $Revision: ???????????? $ (glob)
40 $Revision: ???????????? $ (glob)
41 $Source: */demo.txt,v $ (glob)
41 $Source: */demo.txt,v $ (glob)
42
42
43 $ hg --quiet kwdemo "Branch = {branches}"
43 $ hg --quiet kwdemo "Branch = {branches}"
44 [extensions]
44 [extensions]
45 keyword =
45 keyword =
46 [keyword]
46 [keyword]
47 demo.txt =
47 demo.txt =
48 [keywordset]
48 [keywordset]
49 svn = False
49 svn = False
50 [keywordmaps]
50 [keywordmaps]
51 Branch = {branches}
51 Branch = {branches}
52 $Branch: demobranch $
52 $Branch: demobranch $
53
53
54 $ cat <<EOF >> $HGRCPATH
54 $ cat <<EOF >> $HGRCPATH
55 > [keyword]
55 > [keyword]
56 > ** =
56 > ** =
57 > b = ignore
57 > b = ignore
58 > i = ignore
58 > i = ignore
59 > [hooks]
59 > [hooks]
60 > EOF
60 > EOF
61 $ cp $HGRCPATH $HGRCPATH.nohooks
61 $ cp $HGRCPATH $HGRCPATH.nohooks
62 > cat <<EOF >> $HGRCPATH
62 > cat <<EOF >> $HGRCPATH
63 > commit=
63 > commit=
64 > commit.test=cp a hooktest
64 > commit.test=cp a hooktest
65 > EOF
65 > EOF
66
66
67 $ hg init Test-bndl
67 $ hg init Test-bndl
68 $ cd Test-bndl
68 $ cd Test-bndl
69
69
70 kwshrink should exit silently in empty/invalid repo
70 kwshrink should exit silently in empty/invalid repo
71
71
72 $ hg kwshrink
72 $ hg kwshrink
73
73
74 Symlinks cannot be created on Windows.
74 Symlinks cannot be created on Windows.
75 A bundle to test this was made with:
75 A bundle to test this was made with:
76 hg init t
76 hg init t
77 cd t
77 cd t
78 echo a > a
78 echo a > a
79 ln -s a sym
79 ln -s a sym
80 hg add sym
80 hg add sym
81 hg ci -m addsym -u mercurial
81 hg ci -m addsym -u mercurial
82 hg bundle --base null ../test-keyword.hg
82 hg bundle --base null ../test-keyword.hg
83
83
84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
84 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
85 pulling from *test-keyword.hg (glob)
85 pulling from *test-keyword.hg (glob)
86 requesting all changes
86 requesting all changes
87 adding changesets
87 adding changesets
88 adding manifests
88 adding manifests
89 adding file changes
89 adding file changes
90 added 1 changesets with 1 changes to 1 files
90 added 1 changesets with 1 changes to 1 files
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92
92
93 $ echo 'expand $Id$' > a
93 $ echo 'expand $Id$' > a
94 $ echo 'do not process $Id:' >> a
94 $ echo 'do not process $Id:' >> a
95 $ echo 'xxx $' >> a
95 $ echo 'xxx $' >> a
96 $ echo 'ignore $Id$' > b
96 $ echo 'ignore $Id$' > b
97
97
98 Output files as they were created
98 Output files as they were created
99
99
100 $ cat a b
100 $ cat a b
101 expand $Id$
101 expand $Id$
102 do not process $Id:
102 do not process $Id:
103 xxx $
103 xxx $
104 ignore $Id$
104 ignore $Id$
105
105
106 no kwfiles
106 no kwfiles
107
107
108 $ hg kwfiles
108 $ hg kwfiles
109
109
110 untracked candidates
110 untracked candidates
111
111
112 $ hg -v kwfiles --unknown
112 $ hg -v kwfiles --unknown
113 k a
113 k a
114
114
115 Add files and check status
115 Add files and check status
116
116
117 $ hg addremove
117 $ hg addremove
118 adding a
118 adding a
119 adding b
119 adding b
120 $ hg status
120 $ hg status
121 A a
121 A a
122 A b
122 A b
123
123
124
124
125 Default keyword expansion including commit hook
125 Default keyword expansion including commit hook
126 Interrupted commit should not change state or run commit hook
126 Interrupted commit should not change state or run commit hook
127
127
128 $ hg --debug commit
128 $ hg --debug commit
129 abort: empty commit message
129 abort: empty commit message
130 [255]
130 [255]
131 $ hg status
131 $ hg status
132 A a
132 A a
133 A b
133 A b
134
134
135 Commit with several checks
135 Commit with several checks
136
136
137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
137 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
138 a
138 a
139 b
139 b
140 overwriting a expanding keywords
140 overwriting a expanding keywords
141 running hook commit.test: cp a hooktest
141 running hook commit.test: cp a hooktest
142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
142 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
143 $ hg status
143 $ hg status
144 ? hooktest
144 ? hooktest
145 $ hg debugrebuildstate
145 $ hg debugrebuildstate
146 $ hg --quiet identify
146 $ hg --quiet identify
147 ef63ca68695b
147 ef63ca68695b
148
148
149 cat files in working directory with keywords expanded
149 cat files in working directory with keywords expanded
150
150
151 $ cat a b
151 $ cat a b
152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
152 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
153 do not process $Id:
153 do not process $Id:
154 xxx $
154 xxx $
155 ignore $Id$
155 ignore $Id$
156
156
157 hg cat files and symlink, no expansion
157 hg cat files and symlink, no expansion
158
158
159 $ hg cat sym a b && echo
159 $ hg cat sym a b && echo
160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
160 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
161 do not process $Id:
161 do not process $Id:
162 xxx $
162 xxx $
163 ignore $Id$
163 ignore $Id$
164 a
164 a
165
165
166 $ diff a hooktest
166 $ diff a hooktest
167
167
168 $ cp $HGRCPATH.nohooks $HGRCPATH
168 $ cp $HGRCPATH.nohooks $HGRCPATH
169 $ rm hooktest
169 $ rm hooktest
170
170
171 hg status of kw-ignored binary file starting with '\1\n'
171 hg status of kw-ignored binary file starting with '\1\n'
172
172
173 >>> open("i", "wb").write("\1\nfoo")
173 >>> open("i", "wb").write("\1\nfoo")
174 $ hg -q commit -Am metasep i
174 $ hg -q commit -Am metasep i
175 $ hg status
175 $ hg status
176 >>> open("i", "wb").write("\1\nbar")
176 >>> open("i", "wb").write("\1\nbar")
177 $ hg status
177 $ hg status
178 M i
178 M i
179 $ hg -q commit -m "modify metasep" i
179 $ hg -q commit -m "modify metasep" i
180 $ hg status --rev 2:3
180 $ hg status --rev 2:3
181 M i
181 M i
182 $ touch empty
182 $ touch empty
183 $ hg -q commit -A -m "another file"
183 $ hg -q commit -A -m "another file"
184 $ hg status -A --rev 3:4 i
184 $ hg status -A --rev 3:4 i
185 C i
185 C i
186
186
187 $ hg -q strip -n 2
187 $ hg -q strip -n 2
188
188
189 Test hook execution
189 Test hook execution
190
190
191 bundle
191 bundle
192
192
193 $ hg bundle --base null ../kw.hg
193 $ hg bundle --base null ../kw.hg
194 2 changesets found
194 2 changesets found
195 $ cd ..
195 $ cd ..
196 $ hg init Test
196 $ hg init Test
197 $ cd Test
197 $ cd Test
198
198
199 Notify on pull to check whether keywords stay as is in email
199 Notify on pull to check whether keywords stay as is in email
200 ie. if patch.diff wrapper acts as it should
200 ie. if patch.diff wrapper acts as it should
201
201
202 $ cat <<EOF >> $HGRCPATH
202 $ cat <<EOF >> $HGRCPATH
203 > [hooks]
203 > [hooks]
204 > incoming.notify = python:hgext.notify.hook
204 > incoming.notify = python:hgext.notify.hook
205 > [notify]
205 > [notify]
206 > sources = pull
206 > sources = pull
207 > diffstat = False
207 > diffstat = False
208 > maxsubject = 15
208 > maxsubject = 15
209 > [reposubs]
209 > [reposubs]
210 > * = Test
210 > * = Test
211 > EOF
211 > EOF
212
212
213 Pull from bundle and trigger notify
213 Pull from bundle and trigger notify
214
214
215 $ hg pull -u ../kw.hg
215 $ hg pull -u ../kw.hg
216 pulling from ../kw.hg
216 pulling from ../kw.hg
217 requesting all changes
217 requesting all changes
218 adding changesets
218 adding changesets
219 adding manifests
219 adding manifests
220 adding file changes
220 adding file changes
221 added 2 changesets with 3 changes to 3 files
221 added 2 changesets with 3 changes to 3 files
222 Content-Type: text/plain; charset="us-ascii"
222 Content-Type: text/plain; charset="us-ascii"
223 MIME-Version: 1.0
223 MIME-Version: 1.0
224 Content-Transfer-Encoding: 7bit
224 Content-Transfer-Encoding: 7bit
225 Date: * (glob)
225 Date: * (glob)
226 Subject: changeset in...
226 Subject: changeset in...
227 From: mercurial
227 From: mercurial
228 X-Hg-Notification: changeset a2392c293916
228 X-Hg-Notification: changeset a2392c293916
229 Message-Id: <hg.a2392c293916*> (glob)
229 Message-Id: <hg.a2392c293916*> (glob)
230 To: Test
230 To: Test
231
231
232 changeset a2392c293916 in $TESTTMP/Test (glob)
232 changeset a2392c293916 in $TESTTMP/Test (glob)
233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
233 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
234 description:
234 description:
235 addsym
235 addsym
236
236
237 diffs (6 lines):
237 diffs (6 lines):
238
238
239 diff -r 000000000000 -r a2392c293916 sym
239 diff -r 000000000000 -r a2392c293916 sym
240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
240 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
241 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
242 @@ -0,0 +1,1 @@
242 @@ -0,0 +1,1 @@
243 +a
243 +a
244 \ No newline at end of file
244 \ No newline at end of file
245 Content-Type: text/plain; charset="us-ascii"
245 Content-Type: text/plain; charset="us-ascii"
246 MIME-Version: 1.0
246 MIME-Version: 1.0
247 Content-Transfer-Encoding: 7bit
247 Content-Transfer-Encoding: 7bit
248 Date:* (glob)
248 Date:* (glob)
249 Subject: changeset in...
249 Subject: changeset in...
250 From: User Name <user@example.com>
250 From: User Name <user@example.com>
251 X-Hg-Notification: changeset ef63ca68695b
251 X-Hg-Notification: changeset ef63ca68695b
252 Message-Id: <hg.ef63ca68695b*> (glob)
252 Message-Id: <hg.ef63ca68695b*> (glob)
253 To: Test
253 To: Test
254
254
255 changeset ef63ca68695b in $TESTTMP/Test (glob)
255 changeset ef63ca68695b in $TESTTMP/Test (glob)
256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
256 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
257 description:
257 description:
258 absym
258 absym
259
259
260 diffs (12 lines):
260 diffs (12 lines):
261
261
262 diff -r a2392c293916 -r ef63ca68695b a
262 diff -r a2392c293916 -r ef63ca68695b a
263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
263 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
264 +++ b/a Thu Jan 01 00:00:00 1970 +0000
265 @@ -0,0 +1,3 @@
265 @@ -0,0 +1,3 @@
266 +expand $Id$
266 +expand $Id$
267 +do not process $Id:
267 +do not process $Id:
268 +xxx $
268 +xxx $
269 diff -r a2392c293916 -r ef63ca68695b b
269 diff -r a2392c293916 -r ef63ca68695b b
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
271 +++ b/b Thu Jan 01 00:00:00 1970 +0000
272 @@ -0,0 +1,1 @@
272 @@ -0,0 +1,1 @@
273 +ignore $Id$
273 +ignore $Id$
274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
275
275
276 $ cp $HGRCPATH.nohooks $HGRCPATH
276 $ cp $HGRCPATH.nohooks $HGRCPATH
277
277
278 Touch files and check with status
278 Touch files and check with status
279
279
280 $ touch a b
280 $ touch a b
281 $ hg status
281 $ hg status
282
282
283 Update and expand
283 Update and expand
284
284
285 $ rm sym a b
285 $ rm sym a b
286 $ hg update -C
286 $ hg update -C
287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ cat a b
288 $ cat a b
289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
289 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
290 do not process $Id:
290 do not process $Id:
291 xxx $
291 xxx $
292 ignore $Id$
292 ignore $Id$
293
293
294 Check whether expansion is filewise and file mode is preserved
294 Check whether expansion is filewise and file mode is preserved
295
295
296 $ echo '$Id$' > c
296 $ echo '$Id$' > c
297 $ echo 'tests for different changenodes' >> c
297 $ echo 'tests for different changenodes' >> c
298 #if unix-permissions
298 #if unix-permissions
299 $ chmod 600 c
299 $ chmod 600 c
300 $ ls -l c | cut -b 1-10
300 $ ls -l c | cut -b 1-10
301 -rw-------
301 -rw-------
302 #endif
302 #endif
303
303
304 commit file c
304 commit file c
305
305
306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
306 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
307 adding c
307 adding c
308 #if unix-permissions
308 #if unix-permissions
309 $ ls -l c | cut -b 1-10
309 $ ls -l c | cut -b 1-10
310 -rw-------
310 -rw-------
311 #endif
311 #endif
312
312
313 force expansion
313 force expansion
314
314
315 $ hg -v kwexpand
315 $ hg -v kwexpand
316 overwriting a expanding keywords
316 overwriting a expanding keywords
317 overwriting c expanding keywords
317 overwriting c expanding keywords
318
318
319 compare changenodes in a and c
319 compare changenodes in a and c
320
320
321 $ cat a c
321 $ cat a c
322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
322 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
323 do not process $Id:
323 do not process $Id:
324 xxx $
324 xxx $
325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
325 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
326 tests for different changenodes
326 tests for different changenodes
327
327
328 record
328 record
329
329
330 $ echo '$Id$' > r
330 $ echo '$Id$' > r
331 $ hg add r
331 $ hg add r
332
332
333 record chunk
333 record chunk
334
334
335 >>> lines = open('a', 'rb').readlines()
335 >>> lines = open('a', 'rb').readlines()
336 >>> lines.insert(1, 'foo\n')
336 >>> lines.insert(1, 'foo\n')
337 >>> lines.append('bar\n')
337 >>> lines.append('bar\n')
338 >>> open('a', 'wb').writelines(lines)
338 >>> open('a', 'wb').writelines(lines)
339 $ hg record -d '10 1' -m rectest a<<EOF
339 $ hg record -d '10 1' -m rectest a<<EOF
340 > y
340 > y
341 > y
341 > y
342 > n
342 > n
343 > EOF
343 > EOF
344 diff --git a/a b/a
344 diff --git a/a b/a
345 2 hunks, 2 lines changed
345 2 hunks, 2 lines changed
346 examine changes to 'a'? [Ynesfdaq?]
346 examine changes to 'a'? [Ynesfdaq?]
347 @@ -1,3 +1,4 @@
347 @@ -1,3 +1,4 @@
348 expand $Id$
348 expand $Id$
349 +foo
349 +foo
350 do not process $Id:
350 do not process $Id:
351 xxx $
351 xxx $
352 record change 1/2 to 'a'? [Ynesfdaq?]
352 record change 1/2 to 'a'? [Ynesfdaq?]
353 @@ -2,2 +3,3 @@
353 @@ -2,2 +3,3 @@
354 do not process $Id:
354 do not process $Id:
355 xxx $
355 xxx $
356 +bar
356 +bar
357 record change 2/2 to 'a'? [Ynesfdaq?]
357 record change 2/2 to 'a'? [Ynesfdaq?]
358
358
359 $ hg identify
359 $ hg identify
360 5f5eb23505c3+ tip
360 5f5eb23505c3+ tip
361 $ hg status
361 $ hg status
362 M a
362 M a
363 A r
363 A r
364
364
365 Cat modified file a
365 Cat modified file a
366
366
367 $ cat a
367 $ cat a
368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
368 expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $
369 foo
369 foo
370 do not process $Id:
370 do not process $Id:
371 xxx $
371 xxx $
372 bar
372 bar
373
373
374 Diff remaining chunk
374 Diff remaining chunk
375
375
376 $ hg diff a
376 $ hg diff a
377 diff -r 5f5eb23505c3 a
377 diff -r 5f5eb23505c3 a
378 --- a/a Thu Jan 01 00:00:09 1970 -0000
378 --- a/a Thu Jan 01 00:00:09 1970 -0000
379 +++ b/a * (glob)
379 +++ b/a * (glob)
380 @@ -2,3 +2,4 @@
380 @@ -2,3 +2,4 @@
381 foo
381 foo
382 do not process $Id:
382 do not process $Id:
383 xxx $
383 xxx $
384 +bar
384 +bar
385
385
386 $ hg rollback
386 $ hg rollback
387 repository tip rolled back to revision 2 (undo commit)
387 repository tip rolled back to revision 2 (undo commit)
388 working directory now based on revision 2
388 working directory now based on revision 2
389
389
390 Record all chunks in file a
390 Record all chunks in file a
391
391
392 $ echo foo > msg
392 $ echo foo > msg
393
393
394 - do not use "hg record -m" here!
394 - do not use "hg record -m" here!
395
395
396 $ hg record -l msg -d '11 1' a<<EOF
396 $ hg record -l msg -d '11 1' a<<EOF
397 > y
397 > y
398 > y
398 > y
399 > y
399 > y
400 > EOF
400 > EOF
401 diff --git a/a b/a
401 diff --git a/a b/a
402 2 hunks, 2 lines changed
402 2 hunks, 2 lines changed
403 examine changes to 'a'? [Ynesfdaq?]
403 examine changes to 'a'? [Ynesfdaq?]
404 @@ -1,3 +1,4 @@
404 @@ -1,3 +1,4 @@
405 expand $Id$
405 expand $Id$
406 +foo
406 +foo
407 do not process $Id:
407 do not process $Id:
408 xxx $
408 xxx $
409 record change 1/2 to 'a'? [Ynesfdaq?]
409 record change 1/2 to 'a'? [Ynesfdaq?]
410 @@ -2,2 +3,3 @@
410 @@ -2,2 +3,3 @@
411 do not process $Id:
411 do not process $Id:
412 xxx $
412 xxx $
413 +bar
413 +bar
414 record change 2/2 to 'a'? [Ynesfdaq?]
414 record change 2/2 to 'a'? [Ynesfdaq?]
415
415
416 File a should be clean
416 File a should be clean
417
417
418 $ hg status -A a
418 $ hg status -A a
419 C a
419 C a
420
420
421 rollback and revert expansion
421 rollback and revert expansion
422
422
423 $ cat a
423 $ cat a
424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
424 expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $
425 foo
425 foo
426 do not process $Id:
426 do not process $Id:
427 xxx $
427 xxx $
428 bar
428 bar
429 $ hg --verbose rollback
429 $ hg --verbose rollback
430 repository tip rolled back to revision 2 (undo commit)
430 repository tip rolled back to revision 2 (undo commit)
431 working directory now based on revision 2
431 working directory now based on revision 2
432 overwriting a expanding keywords
432 overwriting a expanding keywords
433 $ hg status a
433 $ hg status a
434 M a
434 M a
435 $ cat a
435 $ cat a
436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
436 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
437 foo
437 foo
438 do not process $Id:
438 do not process $Id:
439 xxx $
439 xxx $
440 bar
440 bar
441 $ echo '$Id$' > y
441 $ echo '$Id$' > y
442 $ echo '$Id$' > z
442 $ echo '$Id$' > z
443 $ hg add y
443 $ hg add y
444 $ hg commit -Am "rollback only" z
444 $ hg commit -Am "rollback only" z
445 $ cat z
445 $ cat z
446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
446 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
447 $ hg --verbose rollback
447 $ hg --verbose rollback
448 repository tip rolled back to revision 2 (undo commit)
448 repository tip rolled back to revision 2 (undo commit)
449 working directory now based on revision 2
449 working directory now based on revision 2
450 overwriting z shrinking keywords
450 overwriting z shrinking keywords
451
451
452 Only z should be overwritten
452 Only z should be overwritten
453
453
454 $ hg status a y z
454 $ hg status a y z
455 M a
455 M a
456 A y
456 A y
457 A z
457 A z
458 $ cat z
458 $ cat z
459 $Id$
459 $Id$
460 $ hg forget y z
460 $ hg forget y z
461 $ rm y z
461 $ rm y z
462
462
463 record added file alone
463 record added file alone
464
464
465 $ hg -v record -l msg -d '12 2' r<<EOF
465 $ hg -v record -l msg -d '12 2' r<<EOF
466 > y
466 > y
467 > EOF
467 > EOF
468 diff --git a/r b/r
468 diff --git a/r b/r
469 new file mode 100644
469 new file mode 100644
470 examine changes to 'r'? [Ynesfdaq?]
470 examine changes to 'r'? [Ynesfdaq?]
471 r
471 r
472 committed changeset 3:82a2f715724d
472 committed changeset 3:82a2f715724d
473 overwriting r expanding keywords
473 overwriting r expanding keywords
474 - status call required for dirstate.normallookup() check
474 - status call required for dirstate.normallookup() check
475 $ hg status r
475 $ hg status r
476 $ hg --verbose rollback
476 $ hg --verbose rollback
477 repository tip rolled back to revision 2 (undo commit)
477 repository tip rolled back to revision 2 (undo commit)
478 working directory now based on revision 2
478 working directory now based on revision 2
479 overwriting r shrinking keywords
479 overwriting r shrinking keywords
480 $ hg forget r
480 $ hg forget r
481 $ rm msg r
481 $ rm msg r
482 $ hg update -C
482 $ hg update -C
483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
484
484
485 record added keyword ignored file
485 record added keyword ignored file
486
486
487 $ echo '$Id$' > i
487 $ echo '$Id$' > i
488 $ hg add i
488 $ hg add i
489 $ hg --verbose record -d '13 1' -m recignored<<EOF
489 $ hg --verbose record -d '13 1' -m recignored<<EOF
490 > y
490 > y
491 > EOF
491 > EOF
492 diff --git a/i b/i
492 diff --git a/i b/i
493 new file mode 100644
493 new file mode 100644
494 examine changes to 'i'? [Ynesfdaq?]
494 examine changes to 'i'? [Ynesfdaq?]
495 i
495 i
496 committed changeset 3:9f40ceb5a072
496 committed changeset 3:9f40ceb5a072
497 $ cat i
497 $ cat i
498 $Id$
498 $Id$
499 $ hg -q rollback
499 $ hg -q rollback
500 $ hg forget i
500 $ hg forget i
501 $ rm i
501 $ rm i
502
502
503 amend
503 amend
504
504
505 $ echo amend >> a
505 $ echo amend >> a
506 $ echo amend >> b
506 $ echo amend >> b
507 $ hg -q commit -d '14 1' -m 'prepare amend'
507 $ hg -q commit -d '14 1' -m 'prepare amend'
508
508
509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
509 $ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords
510 invalid branchheads cache (served): tip differs
510 invalid branchheads cache (served): tip differs
511 overwriting a expanding keywords
511 overwriting a expanding keywords
512 $ hg -q id
512 $ hg -q id
513 67d8c481a6be
513 67d8c481a6be
514 $ head -1 a
514 $ head -1 a
515 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
515 expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $
516
516
517 $ hg -q strip -n tip
517 $ hg -q strip -n tip
518
518
519 Test patch queue repo
519 Test patch queue repo
520
520
521 $ hg init --mq
521 $ hg init --mq
522 $ hg qimport -r tip -n mqtest.diff
522 $ hg qimport -r tip -n mqtest.diff
523 $ hg commit --mq -m mqtest
523 $ hg commit --mq -m mqtest
524
524
525 Keywords should not be expanded in patch
525 Keywords should not be expanded in patch
526
526
527 $ cat .hg/patches/mqtest.diff
527 $ cat .hg/patches/mqtest.diff
528 # HG changeset patch
528 # HG changeset patch
529 # User User Name <user@example.com>
529 # User User Name <user@example.com>
530 # Date 1 0
530 # Date 1 0
531 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
531 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
532 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
532 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
533 cndiff
533 cndiff
534
534
535 diff -r ef63ca68695b -r 40a904bbbe4c c
535 diff -r ef63ca68695b -r 40a904bbbe4c c
536 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
536 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
537 +++ b/c Thu Jan 01 00:00:01 1970 +0000
537 +++ b/c Thu Jan 01 00:00:01 1970 +0000
538 @@ -0,0 +1,2 @@
538 @@ -0,0 +1,2 @@
539 +$Id$
539 +$Id$
540 +tests for different changenodes
540 +tests for different changenodes
541
541
542 $ hg qpop
542 $ hg qpop
543 popping mqtest.diff
543 popping mqtest.diff
544 patch queue now empty
544 patch queue now empty
545
545
546 qgoto, implying qpush, should expand
546 qgoto, implying qpush, should expand
547
547
548 $ hg qgoto mqtest.diff
548 $ hg qgoto mqtest.diff
549 applying mqtest.diff
549 applying mqtest.diff
550 now at: mqtest.diff
550 now at: mqtest.diff
551 $ cat c
551 $ cat c
552 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
552 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
553 tests for different changenodes
553 tests for different changenodes
554 $ hg cat c
554 $ hg cat c
555 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
555 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
556 tests for different changenodes
556 tests for different changenodes
557
557
558 Keywords should not be expanded in filelog
558 Keywords should not be expanded in filelog
559
559
560 $ hg --config 'extensions.keyword=!' cat c
560 $ hg --config 'extensions.keyword=!' cat c
561 $Id$
561 $Id$
562 tests for different changenodes
562 tests for different changenodes
563
563
564 qpop and move on
564 qpop and move on
565
565
566 $ hg qpop
566 $ hg qpop
567 popping mqtest.diff
567 popping mqtest.diff
568 patch queue now empty
568 patch queue now empty
569
569
570 Copy and show added kwfiles
570 Copy and show added kwfiles
571
571
572 $ hg cp a c
572 $ hg cp a c
573 $ hg kwfiles
573 $ hg kwfiles
574 a
574 a
575 c
575 c
576
576
577 Commit and show expansion in original and copy
577 Commit and show expansion in original and copy
578
578
579 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
579 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
580 invalid branchheads cache (served): tip differs
580 invalid branchheads cache (served): tip differs
581 c
581 c
582 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
582 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
583 invalid branchheads cache (served): tip differs
583 invalid branchheads cache (served): tip differs
584 overwriting c expanding keywords
584 overwriting c expanding keywords
585 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
585 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
586 $ cat a c
586 $ cat a c
587 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
587 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
588 do not process $Id:
588 do not process $Id:
589 xxx $
589 xxx $
590 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
590 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
591 do not process $Id:
591 do not process $Id:
592 xxx $
592 xxx $
593
593
594 Touch copied c and check its status
594 Touch copied c and check its status
595
595
596 $ touch c
596 $ touch c
597 $ hg status
597 $ hg status
598
598
599 Copy kwfile to keyword ignored file unexpanding keywords
599 Copy kwfile to keyword ignored file unexpanding keywords
600
600
601 $ hg --verbose copy a i
601 $ hg --verbose copy a i
602 copying a to i
602 copying a to i
603 overwriting i shrinking keywords
603 overwriting i shrinking keywords
604 $ head -n 1 i
604 $ head -n 1 i
605 expand $Id$
605 expand $Id$
606 $ hg forget i
606 $ hg forget i
607 $ rm i
607 $ rm i
608
608
609 Copy ignored file to ignored file: no overwriting
609 Copy ignored file to ignored file: no overwriting
610
610
611 $ hg --verbose copy b i
611 $ hg --verbose copy b i
612 copying b to i
612 copying b to i
613 $ hg forget i
613 $ hg forget i
614 $ rm i
614 $ rm i
615
615
616 cp symlink file; hg cp -A symlink file (part1)
616 cp symlink file; hg cp -A symlink file (part1)
617 - copied symlink points to kwfile: overwrite
617 - copied symlink points to kwfile: overwrite
618
618
619 #if symlink
619 #if symlink
620 $ cp sym i
620 $ cp sym i
621 $ ls -l i
621 $ ls -l i
622 -rw-r--r--* (glob)
622 -rw-r--r--* (glob)
623 $ head -1 i
623 $ head -1 i
624 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
624 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
625 $ hg copy --after --verbose sym i
625 $ hg copy --after --verbose sym i
626 copying sym to i
626 copying sym to i
627 overwriting i shrinking keywords
627 overwriting i shrinking keywords
628 $ head -1 i
628 $ head -1 i
629 expand $Id$
629 expand $Id$
630 $ hg forget i
630 $ hg forget i
631 $ rm i
631 $ rm i
632 #endif
632 #endif
633
633
634 Test different options of hg kwfiles
634 Test different options of hg kwfiles
635
635
636 $ hg kwfiles
636 $ hg kwfiles
637 a
637 a
638 c
638 c
639 $ hg -v kwfiles --ignore
639 $ hg -v kwfiles --ignore
640 I b
640 I b
641 I sym
641 I sym
642 $ hg kwfiles --all
642 $ hg kwfiles --all
643 K a
643 K a
644 K c
644 K c
645 I b
645 I b
646 I sym
646 I sym
647
647
648 Diff specific revision
648 Diff specific revision
649
649
650 $ hg diff --rev 1
650 $ hg diff --rev 1
651 diff -r ef63ca68695b c
651 diff -r ef63ca68695b c
652 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
652 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
653 +++ b/c * (glob)
653 +++ b/c * (glob)
654 @@ -0,0 +1,3 @@
654 @@ -0,0 +1,3 @@
655 +expand $Id$
655 +expand $Id$
656 +do not process $Id:
656 +do not process $Id:
657 +xxx $
657 +xxx $
658
658
659 Status after rollback:
659 Status after rollback:
660
660
661 $ hg rollback
661 $ hg rollback
662 repository tip rolled back to revision 1 (undo commit)
662 repository tip rolled back to revision 1 (undo commit)
663 working directory now based on revision 1
663 working directory now based on revision 1
664 $ hg status
664 $ hg status
665 A c
665 A c
666 $ hg update --clean
666 $ hg update --clean
667 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
667 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
668
668
669 #if symlink
669 #if symlink
670
670
671 cp symlink file; hg cp -A symlink file (part2)
671 cp symlink file; hg cp -A symlink file (part2)
672 - copied symlink points to kw ignored file: do not overwrite
672 - copied symlink points to kw ignored file: do not overwrite
673
673
674 $ cat a > i
674 $ cat a > i
675 $ ln -s i symignored
675 $ ln -s i symignored
676 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
676 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
677 $ cp symignored x
677 $ cp symignored x
678 $ hg copy --after --verbose symignored x
678 $ hg copy --after --verbose symignored x
679 copying symignored to x
679 copying symignored to x
680 $ head -n 1 x
680 $ head -n 1 x
681 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
681 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
682 $ hg forget x
682 $ hg forget x
683 $ rm x
683 $ rm x
684
684
685 $ hg rollback
685 $ hg rollback
686 repository tip rolled back to revision 1 (undo commit)
686 repository tip rolled back to revision 1 (undo commit)
687 working directory now based on revision 1
687 working directory now based on revision 1
688 $ hg update --clean
688 $ hg update --clean
689 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
689 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
690 $ rm i symignored
690 $ rm i symignored
691
691
692 #endif
692 #endif
693
693
694 Custom keywordmaps as argument to kwdemo
694 Custom keywordmaps as argument to kwdemo
695
695
696 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
696 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
697 [extensions]
697 [extensions]
698 keyword =
698 keyword =
699 [keyword]
699 [keyword]
700 ** =
700 ** =
701 b = ignore
701 b = ignore
702 demo.txt =
702 demo.txt =
703 i = ignore
703 i = ignore
704 [keywordset]
704 [keywordset]
705 svn = False
705 svn = False
706 [keywordmaps]
706 [keywordmaps]
707 Xinfo = {author}: {desc}
707 Xinfo = {author}: {desc}
708 $Xinfo: test: hg keyword configuration and expansion example $
708 $Xinfo: test: hg keyword configuration and expansion example $
709
709
710 Configure custom keywordmaps
710 Configure custom keywordmaps
711
711
712 $ cat <<EOF >>$HGRCPATH
712 $ cat <<EOF >>$HGRCPATH
713 > [keywordmaps]
713 > [keywordmaps]
714 > Id = {file} {node|short} {date|rfc822date} {author|user}
714 > Id = {file} {node|short} {date|rfc822date} {author|user}
715 > Xinfo = {author}: {desc}
715 > Xinfo = {author}: {desc}
716 > EOF
716 > EOF
717
717
718 Cat and hg cat files before custom expansion
718 Cat and hg cat files before custom expansion
719
719
720 $ cat a b
720 $ cat a b
721 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
721 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
722 do not process $Id:
722 do not process $Id:
723 xxx $
723 xxx $
724 ignore $Id$
724 ignore $Id$
725 $ hg cat sym a b && echo
725 $ hg cat sym a b && echo
726 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
726 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
727 do not process $Id:
727 do not process $Id:
728 xxx $
728 xxx $
729 ignore $Id$
729 ignore $Id$
730 a
730 a
731
731
732 Write custom keyword and prepare multi-line commit message
732 Write custom keyword and prepare multi-line commit message
733
733
734 $ echo '$Xinfo$' >> a
734 $ echo '$Xinfo$' >> a
735 $ cat <<EOF >> log
735 $ cat <<EOF >> log
736 > firstline
736 > firstline
737 > secondline
737 > secondline
738 > EOF
738 > EOF
739
739
740 Interrupted commit should not change state
740 Interrupted commit should not change state
741
741
742 $ hg commit
742 $ hg commit
743 abort: empty commit message
743 abort: empty commit message
744 [255]
744 [255]
745 $ hg status
745 $ hg status
746 M a
746 M a
747 ? c
747 ? c
748 ? log
748 ? log
749
749
750 Commit with multi-line message and custom expansion
750 Commit with multi-line message and custom expansion
751
751
752 |Note:
752 |Note:
753 |
753 |
754 | After the last rollback, the "unserved" branchheads cache became invalid, but
754 | After the last rollback, the "served" branchheads cache became invalid, but
755 | all changesets in the repo were public. For filtering this means:
755 | all changesets in the repo were public. For filtering this means:
756 | "mutable" == "unserved" == ΓΈ.
756 | "immutable" == "served" == ΓΈ.
757 |
757 |
758 | As the "unserved" cache is invalid, we fall back to the "mutable" cache. But
758 | As the "served" cache is invalid, we fall back to the "immutable" cache. But
759 | no update is needed between "mutable" and "unserved" and the "unserved" cache
759 | no update is needed between "immutable" and "served" and the "served" cache
760 | is not updated on disk. The on-disk version therefore stays invalid for some
760 | is not updated on disk. The on-disk version therefore stays invalid for some
761 | time. This explains why the "unserved" branchheads cache is detected as
761 | time. This explains why the "served" branchheads cache is detected as
762 | invalid here.
762 | invalid here.
763
763
764 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
764 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
765 invalid branchheads cache (served): tip differs
765 invalid branchheads cache (served): tip differs
766 a
766 a
767 invalid branchheads cache (served): tip differs
767 invalid branchheads cache (served): tip differs
768 overwriting a expanding keywords
768 overwriting a expanding keywords
769 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
769 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
770 $ rm log
770 $ rm log
771
771
772 Stat, verify and show custom expansion (firstline)
772 Stat, verify and show custom expansion (firstline)
773
773
774 $ hg status
774 $ hg status
775 ? c
775 ? c
776 $ hg verify
776 $ hg verify
777 checking changesets
777 checking changesets
778 checking manifests
778 checking manifests
779 crosschecking files in changesets and manifests
779 crosschecking files in changesets and manifests
780 checking files
780 checking files
781 3 files, 3 changesets, 4 total revisions
781 3 files, 3 changesets, 4 total revisions
782 $ cat a b
782 $ cat a b
783 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
783 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
784 do not process $Id:
784 do not process $Id:
785 xxx $
785 xxx $
786 $Xinfo: User Name <user@example.com>: firstline $
786 $Xinfo: User Name <user@example.com>: firstline $
787 ignore $Id$
787 ignore $Id$
788 $ hg cat sym a b && echo
788 $ hg cat sym a b && echo
789 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
789 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
790 do not process $Id:
790 do not process $Id:
791 xxx $
791 xxx $
792 $Xinfo: User Name <user@example.com>: firstline $
792 $Xinfo: User Name <user@example.com>: firstline $
793 ignore $Id$
793 ignore $Id$
794 a
794 a
795
795
796 annotate
796 annotate
797
797
798 $ hg annotate a
798 $ hg annotate a
799 1: expand $Id$
799 1: expand $Id$
800 1: do not process $Id:
800 1: do not process $Id:
801 1: xxx $
801 1: xxx $
802 2: $Xinfo$
802 2: $Xinfo$
803
803
804 remove with status checks
804 remove with status checks
805
805
806 $ hg debugrebuildstate
806 $ hg debugrebuildstate
807 $ hg remove a
807 $ hg remove a
808 $ hg --debug commit -m rma
808 $ hg --debug commit -m rma
809 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
809 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
810 $ hg status
810 $ hg status
811 ? c
811 ? c
812
812
813 Rollback, revert, and check expansion
813 Rollback, revert, and check expansion
814
814
815 $ hg rollback
815 $ hg rollback
816 repository tip rolled back to revision 2 (undo commit)
816 repository tip rolled back to revision 2 (undo commit)
817 working directory now based on revision 2
817 working directory now based on revision 2
818 $ hg status
818 $ hg status
819 R a
819 R a
820 ? c
820 ? c
821 $ hg revert --no-backup --rev tip a
821 $ hg revert --no-backup --rev tip a
822 $ cat a
822 $ cat a
823 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
823 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
824 do not process $Id:
824 do not process $Id:
825 xxx $
825 xxx $
826 $Xinfo: User Name <user@example.com>: firstline $
826 $Xinfo: User Name <user@example.com>: firstline $
827
827
828 Clone to test global and local configurations
828 Clone to test global and local configurations
829
829
830 $ cd ..
830 $ cd ..
831
831
832 Expansion in destination with global configuration
832 Expansion in destination with global configuration
833
833
834 $ hg --quiet clone Test globalconf
834 $ hg --quiet clone Test globalconf
835 $ cat globalconf/a
835 $ cat globalconf/a
836 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
836 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
837 do not process $Id:
837 do not process $Id:
838 xxx $
838 xxx $
839 $Xinfo: User Name <user@example.com>: firstline $
839 $Xinfo: User Name <user@example.com>: firstline $
840
840
841 No expansion in destination with local configuration in origin only
841 No expansion in destination with local configuration in origin only
842
842
843 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
843 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
844 $ cat localconf/a
844 $ cat localconf/a
845 expand $Id$
845 expand $Id$
846 do not process $Id:
846 do not process $Id:
847 xxx $
847 xxx $
848 $Xinfo$
848 $Xinfo$
849
849
850 Clone to test incoming
850 Clone to test incoming
851
851
852 $ hg clone -r1 Test Test-a
852 $ hg clone -r1 Test Test-a
853 adding changesets
853 adding changesets
854 adding manifests
854 adding manifests
855 adding file changes
855 adding file changes
856 added 2 changesets with 3 changes to 3 files
856 added 2 changesets with 3 changes to 3 files
857 updating to branch default
857 updating to branch default
858 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
858 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 $ cd Test-a
859 $ cd Test-a
860 $ cat <<EOF >> .hg/hgrc
860 $ cat <<EOF >> .hg/hgrc
861 > [paths]
861 > [paths]
862 > default = ../Test
862 > default = ../Test
863 > EOF
863 > EOF
864 $ hg incoming
864 $ hg incoming
865 comparing with $TESTTMP/Test (glob)
865 comparing with $TESTTMP/Test (glob)
866 searching for changes
866 searching for changes
867 changeset: 2:bb948857c743
867 changeset: 2:bb948857c743
868 tag: tip
868 tag: tip
869 user: User Name <user@example.com>
869 user: User Name <user@example.com>
870 date: Thu Jan 01 00:00:02 1970 +0000
870 date: Thu Jan 01 00:00:02 1970 +0000
871 summary: firstline
871 summary: firstline
872
872
873 Imported patch should not be rejected
873 Imported patch should not be rejected
874
874
875 >>> import re
875 >>> import re
876 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
876 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
877 >>> open('a', 'wb').write(text)
877 >>> open('a', 'wb').write(text)
878 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
878 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
879 a
879 a
880 overwriting a expanding keywords
880 overwriting a expanding keywords
881 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
881 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
882 $ hg export -o ../rejecttest.diff tip
882 $ hg export -o ../rejecttest.diff tip
883 $ cd ../Test
883 $ cd ../Test
884 $ hg import ../rejecttest.diff
884 $ hg import ../rejecttest.diff
885 applying ../rejecttest.diff
885 applying ../rejecttest.diff
886 $ cat a b
886 $ cat a b
887 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
887 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
888 do not process $Id: rejecttest
888 do not process $Id: rejecttest
889 xxx $
889 xxx $
890 $Xinfo: User Name <user@example.com>: rejects? $
890 $Xinfo: User Name <user@example.com>: rejects? $
891 ignore $Id$
891 ignore $Id$
892
892
893 $ hg rollback
893 $ hg rollback
894 repository tip rolled back to revision 2 (undo import)
894 repository tip rolled back to revision 2 (undo import)
895 working directory now based on revision 2
895 working directory now based on revision 2
896 $ hg update --clean
896 $ hg update --clean
897 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
897 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
898
898
899 kwexpand/kwshrink on selected files
899 kwexpand/kwshrink on selected files
900
900
901 $ mkdir x
901 $ mkdir x
902 $ hg copy a x/a
902 $ hg copy a x/a
903 $ hg --verbose kwshrink a
903 $ hg --verbose kwshrink a
904 overwriting a shrinking keywords
904 overwriting a shrinking keywords
905 - sleep required for dirstate.normal() check
905 - sleep required for dirstate.normal() check
906 $ sleep 1
906 $ sleep 1
907 $ hg status a
907 $ hg status a
908 $ hg --verbose kwexpand a
908 $ hg --verbose kwexpand a
909 overwriting a expanding keywords
909 overwriting a expanding keywords
910 $ hg status a
910 $ hg status a
911
911
912 kwexpand x/a should abort
912 kwexpand x/a should abort
913
913
914 $ hg --verbose kwexpand x/a
914 $ hg --verbose kwexpand x/a
915 abort: outstanding uncommitted changes
915 abort: outstanding uncommitted changes
916 [255]
916 [255]
917 $ cd x
917 $ cd x
918 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
918 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
919 x/a
919 x/a
920 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
920 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
921 overwriting x/a expanding keywords
921 overwriting x/a expanding keywords
922 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
922 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
923 $ cat a
923 $ cat a
924 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
924 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
925 do not process $Id:
925 do not process $Id:
926 xxx $
926 xxx $
927 $Xinfo: User Name <user@example.com>: xa $
927 $Xinfo: User Name <user@example.com>: xa $
928
928
929 kwshrink a inside directory x
929 kwshrink a inside directory x
930
930
931 $ hg --verbose kwshrink a
931 $ hg --verbose kwshrink a
932 overwriting x/a shrinking keywords
932 overwriting x/a shrinking keywords
933 $ cat a
933 $ cat a
934 expand $Id$
934 expand $Id$
935 do not process $Id:
935 do not process $Id:
936 xxx $
936 xxx $
937 $Xinfo$
937 $Xinfo$
938 $ cd ..
938 $ cd ..
939
939
940 kwexpand nonexistent
940 kwexpand nonexistent
941
941
942 $ hg kwexpand nonexistent
942 $ hg kwexpand nonexistent
943 nonexistent:* (glob)
943 nonexistent:* (glob)
944
944
945
945
946 #if serve
946 #if serve
947 hg serve
947 hg serve
948 - expand with hgweb file
948 - expand with hgweb file
949 - no expansion with hgweb annotate/changeset/filediff
949 - no expansion with hgweb annotate/changeset/filediff
950 - check errors
950 - check errors
951
951
952 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
952 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
953 $ cat hg.pid >> $DAEMON_PIDS
953 $ cat hg.pid >> $DAEMON_PIDS
954 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
954 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'file/tip/a/?style=raw'
955 200 Script output follows
955 200 Script output follows
956
956
957 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
957 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
958 do not process $Id:
958 do not process $Id:
959 xxx $
959 xxx $
960 $Xinfo: User Name <user@example.com>: firstline $
960 $Xinfo: User Name <user@example.com>: firstline $
961 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
961 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'annotate/tip/a/?style=raw'
962 200 Script output follows
962 200 Script output follows
963
963
964
964
965 user@1: expand $Id$
965 user@1: expand $Id$
966 user@1: do not process $Id:
966 user@1: do not process $Id:
967 user@1: xxx $
967 user@1: xxx $
968 user@2: $Xinfo$
968 user@2: $Xinfo$
969
969
970
970
971
971
972
972
973 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
973 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'rev/tip/?style=raw'
974 200 Script output follows
974 200 Script output follows
975
975
976
976
977 # HG changeset patch
977 # HG changeset patch
978 # User User Name <user@example.com>
978 # User User Name <user@example.com>
979 # Date 3 0
979 # Date 3 0
980 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
980 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
981 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
981 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
982 xa
982 xa
983
983
984 diff -r bb948857c743 -r b4560182a3f9 x/a
984 diff -r bb948857c743 -r b4560182a3f9 x/a
985 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
985 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
986 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
986 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
987 @@ -0,0 +1,4 @@
987 @@ -0,0 +1,4 @@
988 +expand $Id$
988 +expand $Id$
989 +do not process $Id:
989 +do not process $Id:
990 +xxx $
990 +xxx $
991 +$Xinfo$
991 +$Xinfo$
992
992
993 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
993 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'diff/bb948857c743/a?style=raw'
994 200 Script output follows
994 200 Script output follows
995
995
996
996
997 diff -r ef63ca68695b -r bb948857c743 a
997 diff -r ef63ca68695b -r bb948857c743 a
998 --- a/a Thu Jan 01 00:00:00 1970 +0000
998 --- a/a Thu Jan 01 00:00:00 1970 +0000
999 +++ b/a Thu Jan 01 00:00:02 1970 +0000
999 +++ b/a Thu Jan 01 00:00:02 1970 +0000
1000 @@ -1,3 +1,4 @@
1000 @@ -1,3 +1,4 @@
1001 expand $Id$
1001 expand $Id$
1002 do not process $Id:
1002 do not process $Id:
1003 xxx $
1003 xxx $
1004 +$Xinfo$
1004 +$Xinfo$
1005
1005
1006
1006
1007
1007
1008
1008
1009 $ cat errors.log
1009 $ cat errors.log
1010 #endif
1010 #endif
1011
1011
1012 Prepare merge and resolve tests
1012 Prepare merge and resolve tests
1013
1013
1014 $ echo '$Id$' > m
1014 $ echo '$Id$' > m
1015 $ hg add m
1015 $ hg add m
1016 $ hg commit -m 4kw
1016 $ hg commit -m 4kw
1017 $ echo foo >> m
1017 $ echo foo >> m
1018 $ hg commit -m 5foo
1018 $ hg commit -m 5foo
1019
1019
1020 simplemerge
1020 simplemerge
1021
1021
1022 $ hg update 4
1022 $ hg update 4
1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 $ echo foo >> m
1024 $ echo foo >> m
1025 $ hg commit -m 6foo
1025 $ hg commit -m 6foo
1026 created new head
1026 created new head
1027 $ hg merge
1027 $ hg merge
1028 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1028 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1029 (branch merge, don't forget to commit)
1029 (branch merge, don't forget to commit)
1030 $ hg commit -m simplemerge
1030 $ hg commit -m simplemerge
1031 $ cat m
1031 $ cat m
1032 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1032 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
1033 foo
1033 foo
1034
1034
1035 conflict: keyword should stay outside conflict zone
1035 conflict: keyword should stay outside conflict zone
1036
1036
1037 $ hg update 4
1037 $ hg update 4
1038 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1038 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1039 $ echo bar >> m
1039 $ echo bar >> m
1040 $ hg commit -m 8bar
1040 $ hg commit -m 8bar
1041 created new head
1041 created new head
1042 $ hg merge
1042 $ hg merge
1043 merging m
1043 merging m
1044 warning: conflicts during merge.
1044 warning: conflicts during merge.
1045 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1045 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1046 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1046 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1047 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1047 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1048 [1]
1048 [1]
1049 $ cat m
1049 $ cat m
1050 $Id$
1050 $Id$
1051 <<<<<<< local
1051 <<<<<<< local
1052 bar
1052 bar
1053 =======
1053 =======
1054 foo
1054 foo
1055 >>>>>>> other
1055 >>>>>>> other
1056
1056
1057 resolve to local
1057 resolve to local
1058
1058
1059 $ HGMERGE=internal:local hg resolve -a
1059 $ HGMERGE=internal:local hg resolve -a
1060 $ hg commit -m localresolve
1060 $ hg commit -m localresolve
1061 $ cat m
1061 $ cat m
1062 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1062 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1063 bar
1063 bar
1064
1064
1065 Test restricted mode with transplant -b
1065 Test restricted mode with transplant -b
1066
1066
1067 $ hg update 6
1067 $ hg update 6
1068 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1068 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1069 $ hg branch foo
1069 $ hg branch foo
1070 marked working directory as branch foo
1070 marked working directory as branch foo
1071 (branches are permanent and global, did you want a bookmark?)
1071 (branches are permanent and global, did you want a bookmark?)
1072 $ mv a a.bak
1072 $ mv a a.bak
1073 $ echo foobranch > a
1073 $ echo foobranch > a
1074 $ cat a.bak >> a
1074 $ cat a.bak >> a
1075 $ rm a.bak
1075 $ rm a.bak
1076 $ hg commit -m 9foobranch
1076 $ hg commit -m 9foobranch
1077 $ hg update default
1077 $ hg update default
1078 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1078 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1079 $ hg -y transplant -b foo tip
1079 $ hg -y transplant -b foo tip
1080 applying 4aa30d025d50
1080 applying 4aa30d025d50
1081 4aa30d025d50 transplanted to e00abbf63521
1081 4aa30d025d50 transplanted to e00abbf63521
1082
1082
1083 Expansion in changeset but not in file
1083 Expansion in changeset but not in file
1084
1084
1085 $ hg tip -p
1085 $ hg tip -p
1086 changeset: 11:e00abbf63521
1086 changeset: 11:e00abbf63521
1087 tag: tip
1087 tag: tip
1088 parent: 9:800511b3a22d
1088 parent: 9:800511b3a22d
1089 user: test
1089 user: test
1090 date: Thu Jan 01 00:00:00 1970 +0000
1090 date: Thu Jan 01 00:00:00 1970 +0000
1091 summary: 9foobranch
1091 summary: 9foobranch
1092
1092
1093 diff -r 800511b3a22d -r e00abbf63521 a
1093 diff -r 800511b3a22d -r e00abbf63521 a
1094 --- a/a Thu Jan 01 00:00:00 1970 +0000
1094 --- a/a Thu Jan 01 00:00:00 1970 +0000
1095 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1095 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1096 @@ -1,3 +1,4 @@
1096 @@ -1,3 +1,4 @@
1097 +foobranch
1097 +foobranch
1098 expand $Id$
1098 expand $Id$
1099 do not process $Id:
1099 do not process $Id:
1100 xxx $
1100 xxx $
1101
1101
1102 $ head -n 2 a
1102 $ head -n 2 a
1103 foobranch
1103 foobranch
1104 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1104 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1105
1105
1106 Turn off expansion
1106 Turn off expansion
1107
1107
1108 $ hg -q rollback
1108 $ hg -q rollback
1109 $ hg -q update -C
1109 $ hg -q update -C
1110
1110
1111 kwshrink with unknown file u
1111 kwshrink with unknown file u
1112
1112
1113 $ cp a u
1113 $ cp a u
1114 $ hg --verbose kwshrink
1114 $ hg --verbose kwshrink
1115 overwriting a shrinking keywords
1115 overwriting a shrinking keywords
1116 overwriting m shrinking keywords
1116 overwriting m shrinking keywords
1117 overwriting x/a shrinking keywords
1117 overwriting x/a shrinking keywords
1118
1118
1119 Keywords shrunk in working directory, but not yet disabled
1119 Keywords shrunk in working directory, but not yet disabled
1120 - cat shows unexpanded keywords
1120 - cat shows unexpanded keywords
1121 - hg cat shows expanded keywords
1121 - hg cat shows expanded keywords
1122
1122
1123 $ cat a b
1123 $ cat a b
1124 expand $Id$
1124 expand $Id$
1125 do not process $Id:
1125 do not process $Id:
1126 xxx $
1126 xxx $
1127 $Xinfo$
1127 $Xinfo$
1128 ignore $Id$
1128 ignore $Id$
1129 $ hg cat sym a b && echo
1129 $ hg cat sym a b && echo
1130 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1130 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1131 do not process $Id:
1131 do not process $Id:
1132 xxx $
1132 xxx $
1133 $Xinfo: User Name <user@example.com>: firstline $
1133 $Xinfo: User Name <user@example.com>: firstline $
1134 ignore $Id$
1134 ignore $Id$
1135 a
1135 a
1136
1136
1137 Now disable keyword expansion
1137 Now disable keyword expansion
1138
1138
1139 $ rm "$HGRCPATH"
1139 $ rm "$HGRCPATH"
1140 $ cat a b
1140 $ cat a b
1141 expand $Id$
1141 expand $Id$
1142 do not process $Id:
1142 do not process $Id:
1143 xxx $
1143 xxx $
1144 $Xinfo$
1144 $Xinfo$
1145 ignore $Id$
1145 ignore $Id$
1146 $ hg cat sym a b && echo
1146 $ hg cat sym a b && echo
1147 expand $Id$
1147 expand $Id$
1148 do not process $Id:
1148 do not process $Id:
1149 xxx $
1149 xxx $
1150 $Xinfo$
1150 $Xinfo$
1151 ignore $Id$
1151 ignore $Id$
1152 a
1152 a
1153
1153
1154 $ cd ..
1154 $ cd ..
@@ -1,513 +1,513 b''
1 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
1 $ hglog() { hg log --template "{rev} {phaseidx} {desc}\n" $*; }
2 $ mkcommit() {
2 $ mkcommit() {
3 > echo "$1" > "$1"
3 > echo "$1" > "$1"
4 > hg add "$1"
4 > hg add "$1"
5 > message="$1"
5 > message="$1"
6 > shift
6 > shift
7 > hg ci -m "$message" $*
7 > hg ci -m "$message" $*
8 > }
8 > }
9
9
10 $ hg init initialrepo
10 $ hg init initialrepo
11 $ cd initialrepo
11 $ cd initialrepo
12
12
13 Cannot change null revision phase
13 Cannot change null revision phase
14
14
15 $ hg phase --force --secret null
15 $ hg phase --force --secret null
16 abort: cannot change null revision phase
16 abort: cannot change null revision phase
17 [255]
17 [255]
18 $ hg phase null
18 $ hg phase null
19 -1: public
19 -1: public
20
20
21 $ mkcommit A
21 $ mkcommit A
22
22
23 New commit are draft by default
23 New commit are draft by default
24
24
25 $ hglog
25 $ hglog
26 0 1 A
26 0 1 A
27
27
28 Following commit are draft too
28 Following commit are draft too
29
29
30 $ mkcommit B
30 $ mkcommit B
31
31
32 $ hglog
32 $ hglog
33 1 1 B
33 1 1 B
34 0 1 A
34 0 1 A
35
35
36 Draft commit are properly created over public one:
36 Draft commit are properly created over public one:
37
37
38 $ hg phase --public .
38 $ hg phase --public .
39 $ hglog
39 $ hglog
40 1 0 B
40 1 0 B
41 0 0 A
41 0 0 A
42
42
43 $ mkcommit C
43 $ mkcommit C
44 $ mkcommit D
44 $ mkcommit D
45
45
46 $ hglog
46 $ hglog
47 3 1 D
47 3 1 D
48 2 1 C
48 2 1 C
49 1 0 B
49 1 0 B
50 0 0 A
50 0 0 A
51
51
52 Test creating changeset as secret
52 Test creating changeset as secret
53
53
54 $ mkcommit E --config phases.new-commit='secret'
54 $ mkcommit E --config phases.new-commit='secret'
55 $ hglog
55 $ hglog
56 4 2 E
56 4 2 E
57 3 1 D
57 3 1 D
58 2 1 C
58 2 1 C
59 1 0 B
59 1 0 B
60 0 0 A
60 0 0 A
61
61
62 Test the secret property is inherited
62 Test the secret property is inherited
63
63
64 $ mkcommit H
64 $ mkcommit H
65 $ hglog
65 $ hglog
66 5 2 H
66 5 2 H
67 4 2 E
67 4 2 E
68 3 1 D
68 3 1 D
69 2 1 C
69 2 1 C
70 1 0 B
70 1 0 B
71 0 0 A
71 0 0 A
72
72
73 Even on merge
73 Even on merge
74
74
75 $ hg up -q 1
75 $ hg up -q 1
76 $ mkcommit "B'"
76 $ mkcommit "B'"
77 created new head
77 created new head
78 $ hglog
78 $ hglog
79 6 1 B'
79 6 1 B'
80 5 2 H
80 5 2 H
81 4 2 E
81 4 2 E
82 3 1 D
82 3 1 D
83 2 1 C
83 2 1 C
84 1 0 B
84 1 0 B
85 0 0 A
85 0 0 A
86 $ hg merge 4 # E
86 $ hg merge 4 # E
87 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
87 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
88 (branch merge, don't forget to commit)
88 (branch merge, don't forget to commit)
89 $ hg ci -m "merge B' and E"
89 $ hg ci -m "merge B' and E"
90 $ hglog
90 $ hglog
91 7 2 merge B' and E
91 7 2 merge B' and E
92 6 1 B'
92 6 1 B'
93 5 2 H
93 5 2 H
94 4 2 E
94 4 2 E
95 3 1 D
95 3 1 D
96 2 1 C
96 2 1 C
97 1 0 B
97 1 0 B
98 0 0 A
98 0 0 A
99
99
100 Test secret changeset are not pushed
100 Test secret changeset are not pushed
101
101
102 $ hg init ../push-dest
102 $ hg init ../push-dest
103 $ cat > ../push-dest/.hg/hgrc << EOF
103 $ cat > ../push-dest/.hg/hgrc << EOF
104 > [phases]
104 > [phases]
105 > publish=False
105 > publish=False
106 > EOF
106 > EOF
107 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
107 $ hg outgoing ../push-dest --template='{rev} {phase} {desc|firstline}\n'
108 comparing with ../push-dest
108 comparing with ../push-dest
109 searching for changes
109 searching for changes
110 0 public A
110 0 public A
111 1 public B
111 1 public B
112 2 draft C
112 2 draft C
113 3 draft D
113 3 draft D
114 6 draft B'
114 6 draft B'
115 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
115 $ hg outgoing -r 'branch(default)' ../push-dest --template='{rev} {phase} {desc|firstline}\n'
116 comparing with ../push-dest
116 comparing with ../push-dest
117 searching for changes
117 searching for changes
118 0 public A
118 0 public A
119 1 public B
119 1 public B
120 2 draft C
120 2 draft C
121 3 draft D
121 3 draft D
122 6 draft B'
122 6 draft B'
123
123
124 $ hg push ../push-dest -f # force because we push multiple heads
124 $ hg push ../push-dest -f # force because we push multiple heads
125 pushing to ../push-dest
125 pushing to ../push-dest
126 searching for changes
126 searching for changes
127 adding changesets
127 adding changesets
128 adding manifests
128 adding manifests
129 adding file changes
129 adding file changes
130 added 5 changesets with 5 changes to 5 files (+1 heads)
130 added 5 changesets with 5 changes to 5 files (+1 heads)
131 $ hglog
131 $ hglog
132 7 2 merge B' and E
132 7 2 merge B' and E
133 6 1 B'
133 6 1 B'
134 5 2 H
134 5 2 H
135 4 2 E
135 4 2 E
136 3 1 D
136 3 1 D
137 2 1 C
137 2 1 C
138 1 0 B
138 1 0 B
139 0 0 A
139 0 0 A
140 $ cd ../push-dest
140 $ cd ../push-dest
141 $ hglog
141 $ hglog
142 4 1 B'
142 4 1 B'
143 3 1 D
143 3 1 D
144 2 1 C
144 2 1 C
145 1 0 B
145 1 0 B
146 0 0 A
146 0 0 A
147
147
148 (Issue3303)
148 (Issue3303)
149 Check that remote secret changeset are ignore when checking creation of remote heads
149 Check that remote secret changeset are ignore when checking creation of remote heads
150
150
151 We add a secret head into the push destination. This secreat head shadow a
151 We add a secret head into the push destination. This secreat head shadow a
152 visible shared between the initial repo and the push destination.
152 visible shared between the initial repo and the push destination.
153
153
154 $ hg up -q 4 # B'
154 $ hg up -q 4 # B'
155 $ mkcommit Z --config phases.new-commit=secret
155 $ mkcommit Z --config phases.new-commit=secret
156 $ hg phase .
156 $ hg phase .
157 5: secret
157 5: secret
158
158
159 # We now try to push a new public changeset that descend from the common public
159 # We now try to push a new public changeset that descend from the common public
160 # head shadowed by the remote secret head.
160 # head shadowed by the remote secret head.
161
161
162 $ cd ../initialrepo
162 $ cd ../initialrepo
163 $ hg up -q 6 #B'
163 $ hg up -q 6 #B'
164 $ mkcommit I
164 $ mkcommit I
165 created new head
165 created new head
166 $ hg push ../push-dest
166 $ hg push ../push-dest
167 pushing to ../push-dest
167 pushing to ../push-dest
168 searching for changes
168 searching for changes
169 adding changesets
169 adding changesets
170 adding manifests
170 adding manifests
171 adding file changes
171 adding file changes
172 added 1 changesets with 1 changes to 1 files (+1 heads)
172 added 1 changesets with 1 changes to 1 files (+1 heads)
173
173
174 :note: The "(+1 heads)" is wrong as we do not had any visible head
174 :note: The "(+1 heads)" is wrong as we do not had any visible head
175
175
176 check that branch cache with "unserved" filter are properly computed and stored
176 check that branch cache with "served" filter are properly computed and stored
177
177
178 $ ls ../push-dest/.hg/cache/branchheads*
178 $ ls ../push-dest/.hg/cache/branchheads*
179 ../push-dest/.hg/cache/branchheads-served
179 ../push-dest/.hg/cache/branchheads-served
180 $ cat ../push-dest/.hg/cache/branchheads-served
180 $ cat ../push-dest/.hg/cache/branchheads-served
181 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
181 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
182 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
182 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
183 6d6770faffce199f1fddd1cf87f6f026138cf061 default
183 6d6770faffce199f1fddd1cf87f6f026138cf061 default
184 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
184 $ hg heads -R ../push-dest --template '{rev}:{node} {phase}\n' #update visible cache too
185 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
185 6:6d6770faffce199f1fddd1cf87f6f026138cf061 draft
186 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
186 5:2713879da13d6eea1ff22b442a5a87cb31a7ce6a secret
187 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
187 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e draft
188 $ ls ../push-dest/.hg/cache/branchheads*
188 $ ls ../push-dest/.hg/cache/branchheads*
189 ../push-dest/.hg/cache/branchheads-served
189 ../push-dest/.hg/cache/branchheads-served
190 ../push-dest/.hg/cache/branchheads-visible
190 ../push-dest/.hg/cache/branchheads-visible
191 $ cat ../push-dest/.hg/cache/branchheads-served
191 $ cat ../push-dest/.hg/cache/branchheads-served
192 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
192 6d6770faffce199f1fddd1cf87f6f026138cf061 6 465891ffab3c47a3c23792f7dc84156e19a90722
193 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
193 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
194 6d6770faffce199f1fddd1cf87f6f026138cf061 default
194 6d6770faffce199f1fddd1cf87f6f026138cf061 default
195 $ cat ../push-dest/.hg/cache/branchheads-visible
195 $ cat ../push-dest/.hg/cache/branchheads-visible
196 6d6770faffce199f1fddd1cf87f6f026138cf061 6
196 6d6770faffce199f1fddd1cf87f6f026138cf061 6
197 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
197 b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e default
198 2713879da13d6eea1ff22b442a5a87cb31a7ce6a default
198 2713879da13d6eea1ff22b442a5a87cb31a7ce6a default
199 6d6770faffce199f1fddd1cf87f6f026138cf061 default
199 6d6770faffce199f1fddd1cf87f6f026138cf061 default
200
200
201
201
202 Restore condition prior extra insertion.
202 Restore condition prior extra insertion.
203 $ hg -q --config extensions.mq= strip .
203 $ hg -q --config extensions.mq= strip .
204 $ hg up -q 7
204 $ hg up -q 7
205 $ cd ..
205 $ cd ..
206
206
207 Test secret changeset are not pull
207 Test secret changeset are not pull
208
208
209 $ hg init pull-dest
209 $ hg init pull-dest
210 $ cd pull-dest
210 $ cd pull-dest
211 $ hg pull ../initialrepo
211 $ hg pull ../initialrepo
212 pulling from ../initialrepo
212 pulling from ../initialrepo
213 requesting all changes
213 requesting all changes
214 adding changesets
214 adding changesets
215 adding manifests
215 adding manifests
216 adding file changes
216 adding file changes
217 added 5 changesets with 5 changes to 5 files (+1 heads)
217 added 5 changesets with 5 changes to 5 files (+1 heads)
218 (run 'hg heads' to see heads, 'hg merge' to merge)
218 (run 'hg heads' to see heads, 'hg merge' to merge)
219 $ hglog
219 $ hglog
220 4 0 B'
220 4 0 B'
221 3 0 D
221 3 0 D
222 2 0 C
222 2 0 C
223 1 0 B
223 1 0 B
224 0 0 A
224 0 0 A
225 $ cd ..
225 $ cd ..
226
226
227 But secret can still be bundled explicitly
227 But secret can still be bundled explicitly
228
228
229 $ cd initialrepo
229 $ cd initialrepo
230 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
230 $ hg bundle --base '4^' -r 'children(4)' ../secret-bundle.hg
231 4 changesets found
231 4 changesets found
232 $ cd ..
232 $ cd ..
233
233
234 Test secret changeset are not cloned
234 Test secret changeset are not cloned
235 (during local clone)
235 (during local clone)
236
236
237 $ hg clone -qU initialrepo clone-dest
237 $ hg clone -qU initialrepo clone-dest
238 $ hglog -R clone-dest
238 $ hglog -R clone-dest
239 4 0 B'
239 4 0 B'
240 3 0 D
240 3 0 D
241 2 0 C
241 2 0 C
242 1 0 B
242 1 0 B
243 0 0 A
243 0 0 A
244
244
245 Test revset
245 Test revset
246
246
247 $ cd initialrepo
247 $ cd initialrepo
248 $ hglog -r 'public()'
248 $ hglog -r 'public()'
249 0 0 A
249 0 0 A
250 1 0 B
250 1 0 B
251 $ hglog -r 'draft()'
251 $ hglog -r 'draft()'
252 2 1 C
252 2 1 C
253 3 1 D
253 3 1 D
254 6 1 B'
254 6 1 B'
255 $ hglog -r 'secret()'
255 $ hglog -r 'secret()'
256 4 2 E
256 4 2 E
257 5 2 H
257 5 2 H
258 7 2 merge B' and E
258 7 2 merge B' and E
259
259
260 test that phase are displayed in log at debug level
260 test that phase are displayed in log at debug level
261
261
262 $ hg log --debug
262 $ hg log --debug
263 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
263 changeset: 7:17a481b3bccb796c0521ae97903d81c52bfee4af
264 tag: tip
264 tag: tip
265 phase: secret
265 phase: secret
266 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
266 parent: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
267 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
267 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
268 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
268 manifest: 7:5e724ffacba267b2ab726c91fc8b650710deaaa8
269 user: test
269 user: test
270 date: Thu Jan 01 00:00:00 1970 +0000
270 date: Thu Jan 01 00:00:00 1970 +0000
271 files+: C D E
271 files+: C D E
272 extra: branch=default
272 extra: branch=default
273 description:
273 description:
274 merge B' and E
274 merge B' and E
275
275
276
276
277 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
277 changeset: 6:cf9fe039dfd67e829edf6522a45de057b5c86519
278 phase: draft
278 phase: draft
279 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
279 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
280 parent: -1:0000000000000000000000000000000000000000
280 parent: -1:0000000000000000000000000000000000000000
281 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
281 manifest: 6:ab8bfef2392903058bf4ebb9e7746e8d7026b27a
282 user: test
282 user: test
283 date: Thu Jan 01 00:00:00 1970 +0000
283 date: Thu Jan 01 00:00:00 1970 +0000
284 files+: B'
284 files+: B'
285 extra: branch=default
285 extra: branch=default
286 description:
286 description:
287 B'
287 B'
288
288
289
289
290 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
290 changeset: 5:a030c6be5127abc010fcbff1851536552e6951a8
291 phase: secret
291 phase: secret
292 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
292 parent: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
293 parent: -1:0000000000000000000000000000000000000000
293 parent: -1:0000000000000000000000000000000000000000
294 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
294 manifest: 5:5c710aa854874fe3d5fa7192e77bdb314cc08b5a
295 user: test
295 user: test
296 date: Thu Jan 01 00:00:00 1970 +0000
296 date: Thu Jan 01 00:00:00 1970 +0000
297 files+: H
297 files+: H
298 extra: branch=default
298 extra: branch=default
299 description:
299 description:
300 H
300 H
301
301
302
302
303 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
303 changeset: 4:a603bfb5a83e312131cebcd05353c217d4d21dde
304 phase: secret
304 phase: secret
305 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
305 parent: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
306 parent: -1:0000000000000000000000000000000000000000
306 parent: -1:0000000000000000000000000000000000000000
307 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
307 manifest: 4:7173fd1c27119750b959e3a0f47ed78abe75d6dc
308 user: test
308 user: test
309 date: Thu Jan 01 00:00:00 1970 +0000
309 date: Thu Jan 01 00:00:00 1970 +0000
310 files+: E
310 files+: E
311 extra: branch=default
311 extra: branch=default
312 description:
312 description:
313 E
313 E
314
314
315
315
316 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
316 changeset: 3:b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e
317 phase: draft
317 phase: draft
318 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
318 parent: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
319 parent: -1:0000000000000000000000000000000000000000
319 parent: -1:0000000000000000000000000000000000000000
320 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
320 manifest: 3:6e1f4c47ecb533ffd0c8e52cdc88afb6cd39e20c
321 user: test
321 user: test
322 date: Thu Jan 01 00:00:00 1970 +0000
322 date: Thu Jan 01 00:00:00 1970 +0000
323 files+: D
323 files+: D
324 extra: branch=default
324 extra: branch=default
325 description:
325 description:
326 D
326 D
327
327
328
328
329 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
329 changeset: 2:f838bfaca5c7226600ebcfd84f3c3c13a28d3757
330 phase: draft
330 phase: draft
331 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
331 parent: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
332 parent: -1:0000000000000000000000000000000000000000
332 parent: -1:0000000000000000000000000000000000000000
333 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
333 manifest: 2:66a5a01817fdf5239c273802b5b7618d051c89e4
334 user: test
334 user: test
335 date: Thu Jan 01 00:00:00 1970 +0000
335 date: Thu Jan 01 00:00:00 1970 +0000
336 files+: C
336 files+: C
337 extra: branch=default
337 extra: branch=default
338 description:
338 description:
339 C
339 C
340
340
341
341
342 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
342 changeset: 1:27547f69f25460a52fff66ad004e58da7ad3fb56
343 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
343 parent: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
344 parent: -1:0000000000000000000000000000000000000000
344 parent: -1:0000000000000000000000000000000000000000
345 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
345 manifest: 1:cb5cbbc1bfbf24cc34b9e8c16914e9caa2d2a7fd
346 user: test
346 user: test
347 date: Thu Jan 01 00:00:00 1970 +0000
347 date: Thu Jan 01 00:00:00 1970 +0000
348 files+: B
348 files+: B
349 extra: branch=default
349 extra: branch=default
350 description:
350 description:
351 B
351 B
352
352
353
353
354 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
354 changeset: 0:4a2df7238c3b48766b5e22fafbb8a2f506ec8256
355 parent: -1:0000000000000000000000000000000000000000
355 parent: -1:0000000000000000000000000000000000000000
356 parent: -1:0000000000000000000000000000000000000000
356 parent: -1:0000000000000000000000000000000000000000
357 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
357 manifest: 0:007d8c9d88841325f5c6b06371b35b4e8a2b1a83
358 user: test
358 user: test
359 date: Thu Jan 01 00:00:00 1970 +0000
359 date: Thu Jan 01 00:00:00 1970 +0000
360 files+: A
360 files+: A
361 extra: branch=default
361 extra: branch=default
362 description:
362 description:
363 A
363 A
364
364
365
365
366
366
367
367
368 (Issue3707)
368 (Issue3707)
369 test invalid phase name
369 test invalid phase name
370
370
371 $ mkcommit I --config phases.new-commit='babar'
371 $ mkcommit I --config phases.new-commit='babar'
372 transaction abort!
372 transaction abort!
373 rollback completed
373 rollback completed
374 abort: phases.new-commit: not a valid phase name ('babar')
374 abort: phases.new-commit: not a valid phase name ('babar')
375 [255]
375 [255]
376 Test phase command
376 Test phase command
377 ===================
377 ===================
378
378
379 initial picture
379 initial picture
380
380
381 $ cat >> $HGRCPATH << EOF
381 $ cat >> $HGRCPATH << EOF
382 > [extensions]
382 > [extensions]
383 > hgext.graphlog=
383 > hgext.graphlog=
384 > EOF
384 > EOF
385 $ hg log -G --template "{rev} {phase} {desc}\n"
385 $ hg log -G --template "{rev} {phase} {desc}\n"
386 @ 7 secret merge B' and E
386 @ 7 secret merge B' and E
387 |\
387 |\
388 | o 6 draft B'
388 | o 6 draft B'
389 | |
389 | |
390 +---o 5 secret H
390 +---o 5 secret H
391 | |
391 | |
392 o | 4 secret E
392 o | 4 secret E
393 | |
393 | |
394 o | 3 draft D
394 o | 3 draft D
395 | |
395 | |
396 o | 2 draft C
396 o | 2 draft C
397 |/
397 |/
398 o 1 public B
398 o 1 public B
399 |
399 |
400 o 0 public A
400 o 0 public A
401
401
402
402
403 display changesets phase
403 display changesets phase
404
404
405 (mixing -r and plain rev specification)
405 (mixing -r and plain rev specification)
406
406
407 $ hg phase 1::4 -r 7
407 $ hg phase 1::4 -r 7
408 1: public
408 1: public
409 2: draft
409 2: draft
410 3: draft
410 3: draft
411 4: secret
411 4: secret
412 7: secret
412 7: secret
413
413
414
414
415 move changeset forward
415 move changeset forward
416
416
417 (with -r option)
417 (with -r option)
418
418
419 $ hg phase --public -r 2
419 $ hg phase --public -r 2
420 $ hg log -G --template "{rev} {phase} {desc}\n"
420 $ hg log -G --template "{rev} {phase} {desc}\n"
421 @ 7 secret merge B' and E
421 @ 7 secret merge B' and E
422 |\
422 |\
423 | o 6 draft B'
423 | o 6 draft B'
424 | |
424 | |
425 +---o 5 secret H
425 +---o 5 secret H
426 | |
426 | |
427 o | 4 secret E
427 o | 4 secret E
428 | |
428 | |
429 o | 3 draft D
429 o | 3 draft D
430 | |
430 | |
431 o | 2 public C
431 o | 2 public C
432 |/
432 |/
433 o 1 public B
433 o 1 public B
434 |
434 |
435 o 0 public A
435 o 0 public A
436
436
437
437
438 move changeset backward
438 move changeset backward
439
439
440 (without -r option)
440 (without -r option)
441
441
442 $ hg phase --draft --force 2
442 $ hg phase --draft --force 2
443 $ hg log -G --template "{rev} {phase} {desc}\n"
443 $ hg log -G --template "{rev} {phase} {desc}\n"
444 @ 7 secret merge B' and E
444 @ 7 secret merge B' and E
445 |\
445 |\
446 | o 6 draft B'
446 | o 6 draft B'
447 | |
447 | |
448 +---o 5 secret H
448 +---o 5 secret H
449 | |
449 | |
450 o | 4 secret E
450 o | 4 secret E
451 | |
451 | |
452 o | 3 draft D
452 o | 3 draft D
453 | |
453 | |
454 o | 2 draft C
454 o | 2 draft C
455 |/
455 |/
456 o 1 public B
456 o 1 public B
457 |
457 |
458 o 0 public A
458 o 0 public A
459
459
460
460
461 move changeset forward and backward
461 move changeset forward and backward
462
462
463 $ hg phase --draft --force 1::4
463 $ hg phase --draft --force 1::4
464 $ hg log -G --template "{rev} {phase} {desc}\n"
464 $ hg log -G --template "{rev} {phase} {desc}\n"
465 @ 7 secret merge B' and E
465 @ 7 secret merge B' and E
466 |\
466 |\
467 | o 6 draft B'
467 | o 6 draft B'
468 | |
468 | |
469 +---o 5 secret H
469 +---o 5 secret H
470 | |
470 | |
471 o | 4 draft E
471 o | 4 draft E
472 | |
472 | |
473 o | 3 draft D
473 o | 3 draft D
474 | |
474 | |
475 o | 2 draft C
475 o | 2 draft C
476 |/
476 |/
477 o 1 draft B
477 o 1 draft B
478 |
478 |
479 o 0 public A
479 o 0 public A
480
480
481 test partial failure
481 test partial failure
482
482
483 $ hg phase --public 7
483 $ hg phase --public 7
484 $ hg phase --draft '5 or 7'
484 $ hg phase --draft '5 or 7'
485 cannot move 1 changesets to a more permissive phase, use --force
485 cannot move 1 changesets to a more permissive phase, use --force
486 phase changed for 1 changesets
486 phase changed for 1 changesets
487 [1]
487 [1]
488 $ hg log -G --template "{rev} {phase} {desc}\n"
488 $ hg log -G --template "{rev} {phase} {desc}\n"
489 @ 7 public merge B' and E
489 @ 7 public merge B' and E
490 |\
490 |\
491 | o 6 public B'
491 | o 6 public B'
492 | |
492 | |
493 +---o 5 draft H
493 +---o 5 draft H
494 | |
494 | |
495 o | 4 public E
495 o | 4 public E
496 | |
496 | |
497 o | 3 public D
497 o | 3 public D
498 | |
498 | |
499 o | 2 public C
499 o | 2 public C
500 |/
500 |/
501 o 1 public B
501 o 1 public B
502 |
502 |
503 o 0 public A
503 o 0 public A
504
504
505
505
506 test complete failure
506 test complete failure
507
507
508 $ hg phase --draft 7
508 $ hg phase --draft 7
509 cannot move 1 changesets to a more permissive phase, use --force
509 cannot move 1 changesets to a more permissive phase, use --force
510 no phases changed
510 no phases changed
511 [1]
511 [1]
512
512
513 $ cd ..
513 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now