##// END OF EJS Templates
repair: no need to call filterunknown() in strip()...
Patrick Mezard -
r16623:def6a19c default
parent child Browse files
Show More
@@ -1,176 +1,172 b''
1 # repair.py - functions for repository repair for mercurial
1 # repair.py - functions for repository repair for mercurial
2 #
2 #
3 # Copyright 2005, 2006 Chris Mason <mason@suse.com>
3 # Copyright 2005, 2006 Chris Mason <mason@suse.com>
4 # Copyright 2007 Matt Mackall
4 # Copyright 2007 Matt Mackall
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 from mercurial import changegroup, bookmarks, phases
9 from mercurial import changegroup, bookmarks
10 from mercurial.node import short
10 from mercurial.node import short
11 from mercurial.i18n import _
11 from mercurial.i18n import _
12 import os
12 import os
13 import errno
13 import errno
14
14
15 def _bundle(repo, bases, heads, node, suffix, compress=True):
15 def _bundle(repo, bases, heads, node, suffix, compress=True):
16 """create a bundle with the specified revisions as a backup"""
16 """create a bundle with the specified revisions as a backup"""
17 cg = repo.changegroupsubset(bases, heads, 'strip')
17 cg = repo.changegroupsubset(bases, heads, 'strip')
18 backupdir = repo.join("strip-backup")
18 backupdir = repo.join("strip-backup")
19 if not os.path.isdir(backupdir):
19 if not os.path.isdir(backupdir):
20 os.mkdir(backupdir)
20 os.mkdir(backupdir)
21 name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix))
21 name = os.path.join(backupdir, "%s-%s.hg" % (short(node), suffix))
22 if compress:
22 if compress:
23 bundletype = "HG10BZ"
23 bundletype = "HG10BZ"
24 else:
24 else:
25 bundletype = "HG10UN"
25 bundletype = "HG10UN"
26 return changegroup.writebundle(cg, name, bundletype)
26 return changegroup.writebundle(cg, name, bundletype)
27
27
28 def _collectfiles(repo, striprev):
28 def _collectfiles(repo, striprev):
29 """find out the filelogs affected by the strip"""
29 """find out the filelogs affected by the strip"""
30 files = set()
30 files = set()
31
31
32 for x in xrange(striprev, len(repo)):
32 for x in xrange(striprev, len(repo)):
33 files.update(repo[x].files())
33 files.update(repo[x].files())
34
34
35 return sorted(files)
35 return sorted(files)
36
36
37 def _collectbrokencsets(repo, files, striprev):
37 def _collectbrokencsets(repo, files, striprev):
38 """return the changesets which will be broken by the truncation"""
38 """return the changesets which will be broken by the truncation"""
39 s = set()
39 s = set()
40 def collectone(revlog):
40 def collectone(revlog):
41 links = (revlog.linkrev(i) for i in revlog)
41 links = (revlog.linkrev(i) for i in revlog)
42 # find the truncation point of the revlog
42 # find the truncation point of the revlog
43 for lrev in links:
43 for lrev in links:
44 if lrev >= striprev:
44 if lrev >= striprev:
45 break
45 break
46 # see if any revision after this point has a linkrev
46 # see if any revision after this point has a linkrev
47 # less than striprev (those will be broken by strip)
47 # less than striprev (those will be broken by strip)
48 for lrev in links:
48 for lrev in links:
49 if lrev < striprev:
49 if lrev < striprev:
50 s.add(lrev)
50 s.add(lrev)
51
51
52 collectone(repo.manifest)
52 collectone(repo.manifest)
53 for fname in files:
53 for fname in files:
54 collectone(repo.file(fname))
54 collectone(repo.file(fname))
55
55
56 return s
56 return s
57
57
58 def strip(ui, repo, nodelist, backup="all", topic='backup'):
58 def strip(ui, repo, nodelist, backup="all", topic='backup'):
59 cl = repo.changelog
59 cl = repo.changelog
60 # TODO handle undo of merge sets
60 # TODO handle undo of merge sets
61 if isinstance(nodelist, str):
61 if isinstance(nodelist, str):
62 nodelist = [nodelist]
62 nodelist = [nodelist]
63 striplist = [cl.rev(node) for node in nodelist]
63 striplist = [cl.rev(node) for node in nodelist]
64 striprev = min(striplist)
64 striprev = min(striplist)
65
65
66 keeppartialbundle = backup == 'strip'
66 keeppartialbundle = backup == 'strip'
67
67
68 # Some revisions with rev > striprev may not be descendants of striprev.
68 # Some revisions with rev > striprev may not be descendants of striprev.
69 # We have to find these revisions and put them in a bundle, so that
69 # We have to find these revisions and put them in a bundle, so that
70 # we can restore them after the truncations.
70 # we can restore them after the truncations.
71 # To create the bundle we use repo.changegroupsubset which requires
71 # To create the bundle we use repo.changegroupsubset which requires
72 # the list of heads and bases of the set of interesting revisions.
72 # the list of heads and bases of the set of interesting revisions.
73 # (head = revision in the set that has no descendant in the set;
73 # (head = revision in the set that has no descendant in the set;
74 # base = revision in the set that has no ancestor in the set)
74 # base = revision in the set that has no ancestor in the set)
75 tostrip = set(striplist)
75 tostrip = set(striplist)
76 for rev in striplist:
76 for rev in striplist:
77 for desc in cl.descendants(rev):
77 for desc in cl.descendants(rev):
78 tostrip.add(desc)
78 tostrip.add(desc)
79
79
80 files = _collectfiles(repo, striprev)
80 files = _collectfiles(repo, striprev)
81 saverevs = _collectbrokencsets(repo, files, striprev)
81 saverevs = _collectbrokencsets(repo, files, striprev)
82
82
83 # compute heads
83 # compute heads
84 saveheads = set(saverevs)
84 saveheads = set(saverevs)
85 for r in xrange(striprev + 1, len(cl)):
85 for r in xrange(striprev + 1, len(cl)):
86 if r not in tostrip:
86 if r not in tostrip:
87 saverevs.add(r)
87 saverevs.add(r)
88 saveheads.difference_update(cl.parentrevs(r))
88 saveheads.difference_update(cl.parentrevs(r))
89 saveheads.add(r)
89 saveheads.add(r)
90 saveheads = [cl.node(r) for r in saveheads]
90 saveheads = [cl.node(r) for r in saveheads]
91
91
92 # compute base nodes
92 # compute base nodes
93 if saverevs:
93 if saverevs:
94 descendants = set(cl.descendants(*saverevs))
94 descendants = set(cl.descendants(*saverevs))
95 saverevs.difference_update(descendants)
95 saverevs.difference_update(descendants)
96 savebases = [cl.node(r) for r in saverevs]
96 savebases = [cl.node(r) for r in saverevs]
97 stripbases = [cl.node(r) for r in tostrip]
97 stripbases = [cl.node(r) for r in tostrip]
98
98
99 bm = repo._bookmarks
99 bm = repo._bookmarks
100 updatebm = []
100 updatebm = []
101 for m in bm:
101 for m in bm:
102 rev = repo[bm[m]].rev()
102 rev = repo[bm[m]].rev()
103 if rev in tostrip:
103 if rev in tostrip:
104 updatebm.append(m)
104 updatebm.append(m)
105
105
106 # create a changegroup for all the branches we need to keep
106 # create a changegroup for all the branches we need to keep
107 backupfile = None
107 backupfile = None
108 if backup == "all":
108 if backup == "all":
109 backupfile = _bundle(repo, stripbases, cl.heads(), node, topic)
109 backupfile = _bundle(repo, stripbases, cl.heads(), node, topic)
110 repo.ui.status(_("saved backup bundle to %s\n") % backupfile)
110 repo.ui.status(_("saved backup bundle to %s\n") % backupfile)
111 if saveheads or savebases:
111 if saveheads or savebases:
112 # do not compress partial bundle if we remove it from disk later
112 # do not compress partial bundle if we remove it from disk later
113 chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
113 chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
114 compress=keeppartialbundle)
114 compress=keeppartialbundle)
115
115
116 mfst = repo.manifest
116 mfst = repo.manifest
117
117
118 tr = repo.transaction("strip")
118 tr = repo.transaction("strip")
119 offset = len(tr.entries)
119 offset = len(tr.entries)
120
120
121 try:
121 try:
122 tr.startgroup()
122 tr.startgroup()
123 cl.strip(striprev, tr)
123 cl.strip(striprev, tr)
124 mfst.strip(striprev, tr)
124 mfst.strip(striprev, tr)
125 for fn in files:
125 for fn in files:
126 repo.file(fn).strip(striprev, tr)
126 repo.file(fn).strip(striprev, tr)
127 tr.endgroup()
127 tr.endgroup()
128
128
129 try:
129 try:
130 for i in xrange(offset, len(tr.entries)):
130 for i in xrange(offset, len(tr.entries)):
131 file, troffset, ignore = tr.entries[i]
131 file, troffset, ignore = tr.entries[i]
132 repo.sopener(file, 'a').truncate(troffset)
132 repo.sopener(file, 'a').truncate(troffset)
133 tr.close()
133 tr.close()
134 except:
134 except:
135 tr.abort()
135 tr.abort()
136 raise
136 raise
137
137
138 if saveheads or savebases:
138 if saveheads or savebases:
139 ui.note(_("adding branch\n"))
139 ui.note(_("adding branch\n"))
140 f = open(chgrpfile, "rb")
140 f = open(chgrpfile, "rb")
141 gen = changegroup.readbundle(f, chgrpfile)
141 gen = changegroup.readbundle(f, chgrpfile)
142 if not repo.ui.verbose:
142 if not repo.ui.verbose:
143 # silence internal shuffling chatter
143 # silence internal shuffling chatter
144 repo.ui.pushbuffer()
144 repo.ui.pushbuffer()
145 repo.addchangegroup(gen, 'strip', 'bundle:' + chgrpfile, True)
145 repo.addchangegroup(gen, 'strip', 'bundle:' + chgrpfile, True)
146 if not repo.ui.verbose:
146 if not repo.ui.verbose:
147 repo.ui.popbuffer()
147 repo.ui.popbuffer()
148 f.close()
148 f.close()
149 if not keeppartialbundle:
149 if not keeppartialbundle:
150 os.unlink(chgrpfile)
150 os.unlink(chgrpfile)
151
151
152 # remove undo files
152 # remove undo files
153 for undofile in repo.undofiles():
153 for undofile in repo.undofiles():
154 try:
154 try:
155 os.unlink(undofile)
155 os.unlink(undofile)
156 except OSError, e:
156 except OSError, e:
157 if e.errno != errno.ENOENT:
157 if e.errno != errno.ENOENT:
158 ui.warn(_('error removing %s: %s\n') % (undofile, str(e)))
158 ui.warn(_('error removing %s: %s\n') % (undofile, str(e)))
159
159
160 for m in updatebm:
160 for m in updatebm:
161 bm[m] = repo['.'].node()
161 bm[m] = repo['.'].node()
162 bookmarks.write(repo)
162 bookmarks.write(repo)
163 except:
163 except:
164 if backupfile:
164 if backupfile:
165 ui.warn(_("strip failed, full bundle stored in '%s'\n")
165 ui.warn(_("strip failed, full bundle stored in '%s'\n")
166 % backupfile)
166 % backupfile)
167 elif saveheads:
167 elif saveheads:
168 ui.warn(_("strip failed, partial bundle stored in '%s'\n")
168 ui.warn(_("strip failed, partial bundle stored in '%s'\n")
169 % chgrpfile)
169 % chgrpfile)
170 raise
170 raise
171
171
172 repo.destroyed()
172 repo.destroyed()
173
174 # remove potential unknown phase
175 # XXX using to_strip data would be faster
176 phases.filterunknown(repo)
@@ -1,1107 +1,1109 b''
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
1 $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > keyword =
5 > keyword =
6 > mq =
6 > mq =
7 > notify =
7 > notify =
8 > record =
8 > record =
9 > transplant =
9 > transplant =
10 > [ui]
10 > [ui]
11 > interactive = true
11 > interactive = true
12 > EOF
12 > EOF
13
13
14 Run kwdemo before [keyword] files are set up
14 Run kwdemo before [keyword] files are set up
15 as it would succeed without uisetup otherwise
15 as it would succeed without uisetup otherwise
16
16
17 $ hg --quiet kwdemo
17 $ hg --quiet kwdemo
18 [extensions]
18 [extensions]
19 keyword =
19 keyword =
20 [keyword]
20 [keyword]
21 demo.txt =
21 demo.txt =
22 [keywordset]
22 [keywordset]
23 svn = False
23 svn = False
24 [keywordmaps]
24 [keywordmaps]
25 Author = {author|user}
25 Author = {author|user}
26 Date = {date|utcdate}
26 Date = {date|utcdate}
27 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
27 Header = {root}/{file},v {node|short} {date|utcdate} {author|user}
28 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
28 Id = {file|basename},v {node|short} {date|utcdate} {author|user}
29 RCSFile = {file|basename},v
29 RCSFile = {file|basename},v
30 RCSfile = {file|basename},v
30 RCSfile = {file|basename},v
31 Revision = {node|short}
31 Revision = {node|short}
32 Source = {root}/{file},v
32 Source = {root}/{file},v
33 $Author: test $
33 $Author: test $
34 $Date: ????/??/?? ??:??:?? $ (glob)
34 $Date: ????/??/?? ??:??:?? $ (glob)
35 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
35 $Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
36 $Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob)
37 $RCSFile: demo.txt,v $
37 $RCSFile: demo.txt,v $
38 $RCSfile: demo.txt,v $
38 $RCSfile: demo.txt,v $
39 $Revision: ???????????? $ (glob)
39 $Revision: ???????????? $ (glob)
40 $Source: */demo.txt,v $ (glob)
40 $Source: */demo.txt,v $ (glob)
41
41
42 $ hg --quiet kwdemo "Branch = {branches}"
42 $ hg --quiet kwdemo "Branch = {branches}"
43 [extensions]
43 [extensions]
44 keyword =
44 keyword =
45 [keyword]
45 [keyword]
46 demo.txt =
46 demo.txt =
47 [keywordset]
47 [keywordset]
48 svn = False
48 svn = False
49 [keywordmaps]
49 [keywordmaps]
50 Branch = {branches}
50 Branch = {branches}
51 $Branch: demobranch $
51 $Branch: demobranch $
52
52
53 $ cat <<EOF >> $HGRCPATH
53 $ cat <<EOF >> $HGRCPATH
54 > [keyword]
54 > [keyword]
55 > ** =
55 > ** =
56 > b = ignore
56 > b = ignore
57 > i = ignore
57 > i = ignore
58 > [hooks]
58 > [hooks]
59 > EOF
59 > EOF
60 $ cp $HGRCPATH $HGRCPATH.nohooks
60 $ cp $HGRCPATH $HGRCPATH.nohooks
61 > cat <<EOF >> $HGRCPATH
61 > cat <<EOF >> $HGRCPATH
62 > commit=
62 > commit=
63 > commit.test=cp a hooktest
63 > commit.test=cp a hooktest
64 > EOF
64 > EOF
65
65
66 $ hg init Test-bndl
66 $ hg init Test-bndl
67 $ cd Test-bndl
67 $ cd Test-bndl
68
68
69 kwshrink should exit silently in empty/invalid repo
69 kwshrink should exit silently in empty/invalid repo
70
70
71 $ hg kwshrink
71 $ hg kwshrink
72
72
73 Symlinks cannot be created on Windows.
73 Symlinks cannot be created on Windows.
74 A bundle to test this was made with:
74 A bundle to test this was made with:
75 hg init t
75 hg init t
76 cd t
76 cd t
77 echo a > a
77 echo a > a
78 ln -s a sym
78 ln -s a sym
79 hg add sym
79 hg add sym
80 hg ci -m addsym -u mercurial
80 hg ci -m addsym -u mercurial
81 hg bundle --base null ../test-keyword.hg
81 hg bundle --base null ../test-keyword.hg
82
82
83 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
83 $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg
84 pulling from *test-keyword.hg (glob)
84 pulling from *test-keyword.hg (glob)
85 requesting all changes
85 requesting all changes
86 adding changesets
86 adding changesets
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 1 changesets with 1 changes to 1 files
89 added 1 changesets with 1 changes to 1 files
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
91
92 $ echo 'expand $Id$' > a
92 $ echo 'expand $Id$' > a
93 $ echo 'do not process $Id:' >> a
93 $ echo 'do not process $Id:' >> a
94 $ echo 'xxx $' >> a
94 $ echo 'xxx $' >> a
95 $ echo 'ignore $Id$' > b
95 $ echo 'ignore $Id$' > b
96
96
97 Output files as they were created
97 Output files as they were created
98
98
99 $ cat a b
99 $ cat a b
100 expand $Id$
100 expand $Id$
101 do not process $Id:
101 do not process $Id:
102 xxx $
102 xxx $
103 ignore $Id$
103 ignore $Id$
104
104
105 no kwfiles
105 no kwfiles
106
106
107 $ hg kwfiles
107 $ hg kwfiles
108
108
109 untracked candidates
109 untracked candidates
110
110
111 $ hg -v kwfiles --unknown
111 $ hg -v kwfiles --unknown
112 k a
112 k a
113
113
114 Add files and check status
114 Add files and check status
115
115
116 $ hg addremove
116 $ hg addremove
117 adding a
117 adding a
118 adding b
118 adding b
119 $ hg status
119 $ hg status
120 A a
120 A a
121 A b
121 A b
122
122
123
123
124 Default keyword expansion including commit hook
124 Default keyword expansion including commit hook
125 Interrupted commit should not change state or run commit hook
125 Interrupted commit should not change state or run commit hook
126
126
127 $ hg --debug commit
127 $ hg --debug commit
128 abort: empty commit message
128 abort: empty commit message
129 [255]
129 [255]
130 $ hg status
130 $ hg status
131 A a
131 A a
132 A b
132 A b
133
133
134 Commit with several checks
134 Commit with several checks
135
135
136 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
136 $ hg --debug commit -mabsym -u 'User Name <user@example.com>'
137 a
137 a
138 b
138 b
139 overwriting a expanding keywords
139 overwriting a expanding keywords
140 running hook commit.test: cp a hooktest
140 running hook commit.test: cp a hooktest
141 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
141 committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9
142 $ hg status
142 $ hg status
143 ? hooktest
143 ? hooktest
144 $ hg debugrebuildstate
144 $ hg debugrebuildstate
145 $ hg --quiet identify
145 $ hg --quiet identify
146 ef63ca68695b
146 ef63ca68695b
147
147
148 cat files in working directory with keywords expanded
148 cat files in working directory with keywords expanded
149
149
150 $ cat a b
150 $ cat a b
151 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
151 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
152 do not process $Id:
152 do not process $Id:
153 xxx $
153 xxx $
154 ignore $Id$
154 ignore $Id$
155
155
156 hg cat files and symlink, no expansion
156 hg cat files and symlink, no expansion
157
157
158 $ hg cat sym a b && echo
158 $ hg cat sym a b && echo
159 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
159 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
160 do not process $Id:
160 do not process $Id:
161 xxx $
161 xxx $
162 ignore $Id$
162 ignore $Id$
163 a
163 a
164
164
165 $ diff a hooktest
165 $ diff a hooktest
166
166
167 $ cp $HGRCPATH.nohooks $HGRCPATH
167 $ cp $HGRCPATH.nohooks $HGRCPATH
168 $ rm hooktest
168 $ rm hooktest
169
169
170 hg status of kw-ignored binary file starting with '\1\n'
170 hg status of kw-ignored binary file starting with '\1\n'
171
171
172 >>> open("i", "wb").write("\1\nfoo")
172 >>> open("i", "wb").write("\1\nfoo")
173 $ hg -q commit -Am metasep i
173 $ hg -q commit -Am metasep i
174 $ hg status
174 $ hg status
175 >>> open("i", "wb").write("\1\nbar")
175 >>> open("i", "wb").write("\1\nbar")
176 $ hg status
176 $ hg status
177 M i
177 M i
178 $ hg -q commit -m "modify metasep" i
178 $ hg -q commit -m "modify metasep" i
179 $ hg status --rev 2:3
179 $ hg status --rev 2:3
180 M i
180 M i
181 $ touch empty
181 $ touch empty
182 $ hg -q commit -A -m "another file"
182 $ hg -q commit -A -m "another file"
183 $ hg status -A --rev 3:4 i
183 $ hg status -A --rev 3:4 i
184 C i
184 C i
185
185
186 $ hg -q strip -n 2
186 $ hg -q strip -n 2
187
187
188 Test hook execution
188 Test hook execution
189
189
190 bundle
190 bundle
191
191
192 $ hg bundle --base null ../kw.hg
192 $ hg bundle --base null ../kw.hg
193 2 changesets found
193 2 changesets found
194 $ cd ..
194 $ cd ..
195 $ hg init Test
195 $ hg init Test
196 $ cd Test
196 $ cd Test
197
197
198 Notify on pull to check whether keywords stay as is in email
198 Notify on pull to check whether keywords stay as is in email
199 ie. if patch.diff wrapper acts as it should
199 ie. if patch.diff wrapper acts as it should
200
200
201 $ cat <<EOF >> $HGRCPATH
201 $ cat <<EOF >> $HGRCPATH
202 > [hooks]
202 > [hooks]
203 > incoming.notify = python:hgext.notify.hook
203 > incoming.notify = python:hgext.notify.hook
204 > [notify]
204 > [notify]
205 > sources = pull
205 > sources = pull
206 > diffstat = False
206 > diffstat = False
207 > maxsubject = 15
207 > maxsubject = 15
208 > [reposubs]
208 > [reposubs]
209 > * = Test
209 > * = Test
210 > EOF
210 > EOF
211
211
212 Pull from bundle and trigger notify
212 Pull from bundle and trigger notify
213
213
214 $ hg pull -u ../kw.hg
214 $ hg pull -u ../kw.hg
215 pulling from ../kw.hg
215 pulling from ../kw.hg
216 requesting all changes
216 requesting all changes
217 adding changesets
217 adding changesets
218 adding manifests
218 adding manifests
219 adding file changes
219 adding file changes
220 added 2 changesets with 3 changes to 3 files
220 added 2 changesets with 3 changes to 3 files
221 Content-Type: text/plain; charset="us-ascii"
221 Content-Type: text/plain; charset="us-ascii"
222 MIME-Version: 1.0
222 MIME-Version: 1.0
223 Content-Transfer-Encoding: 7bit
223 Content-Transfer-Encoding: 7bit
224 Date: * (glob)
224 Date: * (glob)
225 Subject: changeset in...
225 Subject: changeset in...
226 From: mercurial
226 From: mercurial
227 X-Hg-Notification: changeset a2392c293916
227 X-Hg-Notification: changeset a2392c293916
228 Message-Id: <hg.a2392c293916*> (glob)
228 Message-Id: <hg.a2392c293916*> (glob)
229 To: Test
229 To: Test
230
230
231 changeset a2392c293916 in $TESTTMP/Test (glob)
231 changeset a2392c293916 in $TESTTMP/Test (glob)
232 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
232 details: $TESTTMP/Test?cmd=changeset;node=a2392c293916
233 description:
233 description:
234 addsym
234 addsym
235
235
236 diffs (6 lines):
236 diffs (6 lines):
237
237
238 diff -r 000000000000 -r a2392c293916 sym
238 diff -r 000000000000 -r a2392c293916 sym
239 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
239 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
240 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
240 +++ b/sym Sat Feb 09 20:25:47 2008 +0100
241 @@ -0,0 +1,1 @@
241 @@ -0,0 +1,1 @@
242 +a
242 +a
243 \ No newline at end of file
243 \ No newline at end of file
244 Content-Type: text/plain; charset="us-ascii"
244 Content-Type: text/plain; charset="us-ascii"
245 MIME-Version: 1.0
245 MIME-Version: 1.0
246 Content-Transfer-Encoding: 7bit
246 Content-Transfer-Encoding: 7bit
247 Date:* (glob)
247 Date:* (glob)
248 Subject: changeset in...
248 Subject: changeset in...
249 From: User Name <user@example.com>
249 From: User Name <user@example.com>
250 X-Hg-Notification: changeset ef63ca68695b
250 X-Hg-Notification: changeset ef63ca68695b
251 Message-Id: <hg.ef63ca68695b*> (glob)
251 Message-Id: <hg.ef63ca68695b*> (glob)
252 To: Test
252 To: Test
253
253
254 changeset ef63ca68695b in $TESTTMP/Test (glob)
254 changeset ef63ca68695b in $TESTTMP/Test (glob)
255 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
255 details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b
256 description:
256 description:
257 absym
257 absym
258
258
259 diffs (12 lines):
259 diffs (12 lines):
260
260
261 diff -r a2392c293916 -r ef63ca68695b a
261 diff -r a2392c293916 -r ef63ca68695b a
262 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
262 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
263 +++ b/a Thu Jan 01 00:00:00 1970 +0000
263 +++ b/a Thu Jan 01 00:00:00 1970 +0000
264 @@ -0,0 +1,3 @@
264 @@ -0,0 +1,3 @@
265 +expand $Id$
265 +expand $Id$
266 +do not process $Id:
266 +do not process $Id:
267 +xxx $
267 +xxx $
268 diff -r a2392c293916 -r ef63ca68695b b
268 diff -r a2392c293916 -r ef63ca68695b b
269 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
269 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
270 +++ b/b Thu Jan 01 00:00:00 1970 +0000
270 +++ b/b Thu Jan 01 00:00:00 1970 +0000
271 @@ -0,0 +1,1 @@
271 @@ -0,0 +1,1 @@
272 +ignore $Id$
272 +ignore $Id$
273 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274
274
275 $ cp $HGRCPATH.nohooks $HGRCPATH
275 $ cp $HGRCPATH.nohooks $HGRCPATH
276
276
277 Touch files and check with status
277 Touch files and check with status
278
278
279 $ touch a b
279 $ touch a b
280 $ hg status
280 $ hg status
281
281
282 Update and expand
282 Update and expand
283
283
284 $ rm sym a b
284 $ rm sym a b
285 $ hg update -C
285 $ hg update -C
286 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 $ cat a b
287 $ cat a b
288 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
288 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
289 do not process $Id:
289 do not process $Id:
290 xxx $
290 xxx $
291 ignore $Id$
291 ignore $Id$
292
292
293 Check whether expansion is filewise and file mode is preserved
293 Check whether expansion is filewise and file mode is preserved
294
294
295 $ echo '$Id$' > c
295 $ echo '$Id$' > c
296 $ echo 'tests for different changenodes' >> c
296 $ echo 'tests for different changenodes' >> c
297 $ chmod 600 c
297 $ chmod 600 c
298 $ ls -l c | cut -b 1-10
298 $ ls -l c | cut -b 1-10
299 -rw-------
299 -rw-------
300
300
301 commit file c
301 commit file c
302
302
303 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
303 $ hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
304 adding c
304 adding c
305 $ ls -l c | cut -b 1-10
305 $ ls -l c | cut -b 1-10
306 -rw-------
306 -rw-------
307
307
308 force expansion
308 force expansion
309
309
310 $ hg -v kwexpand
310 $ hg -v kwexpand
311 overwriting a expanding keywords
311 overwriting a expanding keywords
312 overwriting c expanding keywords
312 overwriting c expanding keywords
313
313
314 compare changenodes in a and c
314 compare changenodes in a and c
315
315
316 $ cat a c
316 $ cat a c
317 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
317 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
318 do not process $Id:
318 do not process $Id:
319 xxx $
319 xxx $
320 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
320 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
321 tests for different changenodes
321 tests for different changenodes
322
322
323 record
323 record
324
324
325 $ echo '$Id$' > r
325 $ echo '$Id$' > r
326 $ hg add r
326 $ hg add r
327
327
328 record chunk
328 record chunk
329
329
330 >>> lines = open('a').readlines()
330 >>> lines = open('a').readlines()
331 >>> lines.insert(1, 'foo\n')
331 >>> lines.insert(1, 'foo\n')
332 >>> lines.append('bar\n')
332 >>> lines.append('bar\n')
333 >>> open('a', 'w').writelines(lines)
333 >>> open('a', 'w').writelines(lines)
334 $ hg record -d '1 10' -m rectest a<<EOF
334 $ hg record -d '1 10' -m rectest a<<EOF
335 > y
335 > y
336 > y
336 > y
337 > n
337 > n
338 > EOF
338 > EOF
339 diff --git a/a b/a
339 diff --git a/a b/a
340 2 hunks, 2 lines changed
340 2 hunks, 2 lines changed
341 examine changes to 'a'? [Ynesfdaq?]
341 examine changes to 'a'? [Ynesfdaq?]
342 @@ -1,3 +1,4 @@
342 @@ -1,3 +1,4 @@
343 expand $Id$
343 expand $Id$
344 +foo
344 +foo
345 do not process $Id:
345 do not process $Id:
346 xxx $
346 xxx $
347 record change 1/2 to 'a'? [Ynesfdaq?]
347 record change 1/2 to 'a'? [Ynesfdaq?]
348 @@ -2,2 +3,3 @@
348 @@ -2,2 +3,3 @@
349 do not process $Id:
349 do not process $Id:
350 xxx $
350 xxx $
351 +bar
351 +bar
352 record change 2/2 to 'a'? [Ynesfdaq?]
352 record change 2/2 to 'a'? [Ynesfdaq?]
353
353
354 $ hg identify
354 $ hg identify
355 d17e03c92c97+ tip
355 d17e03c92c97+ tip
356 $ hg status
356 $ hg status
357 M a
357 M a
358 A r
358 A r
359
359
360 Cat modified file a
360 Cat modified file a
361
361
362 $ cat a
362 $ cat a
363 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
363 expand $Id: a,v d17e03c92c97 1970/01/01 00:00:01 test $
364 foo
364 foo
365 do not process $Id:
365 do not process $Id:
366 xxx $
366 xxx $
367 bar
367 bar
368
368
369 Diff remaining chunk
369 Diff remaining chunk
370
370
371 $ hg diff a
371 $ hg diff a
372 diff -r d17e03c92c97 a
372 diff -r d17e03c92c97 a
373 --- a/a Wed Dec 31 23:59:51 1969 -0000
373 --- a/a Wed Dec 31 23:59:51 1969 -0000
374 +++ b/a * (glob)
374 +++ b/a * (glob)
375 @@ -2,3 +2,4 @@
375 @@ -2,3 +2,4 @@
376 foo
376 foo
377 do not process $Id:
377 do not process $Id:
378 xxx $
378 xxx $
379 +bar
379 +bar
380
380
381 $ hg rollback
381 $ hg rollback
382 repository tip rolled back to revision 2 (undo commit)
382 repository tip rolled back to revision 2 (undo commit)
383 working directory now based on revision 2
383 working directory now based on revision 2
384
384
385 Record all chunks in file a
385 Record all chunks in file a
386
386
387 $ echo foo > msg
387 $ echo foo > msg
388
388
389 - do not use "hg record -m" here!
389 - do not use "hg record -m" here!
390
390
391 $ hg record -l msg -d '1 11' a<<EOF
391 $ hg record -l msg -d '1 11' a<<EOF
392 > y
392 > y
393 > y
393 > y
394 > y
394 > y
395 > EOF
395 > EOF
396 diff --git a/a b/a
396 diff --git a/a b/a
397 2 hunks, 2 lines changed
397 2 hunks, 2 lines changed
398 examine changes to 'a'? [Ynesfdaq?]
398 examine changes to 'a'? [Ynesfdaq?]
399 @@ -1,3 +1,4 @@
399 @@ -1,3 +1,4 @@
400 expand $Id$
400 expand $Id$
401 +foo
401 +foo
402 do not process $Id:
402 do not process $Id:
403 xxx $
403 xxx $
404 record change 1/2 to 'a'? [Ynesfdaq?]
404 record change 1/2 to 'a'? [Ynesfdaq?]
405 @@ -2,2 +3,3 @@
405 @@ -2,2 +3,3 @@
406 do not process $Id:
406 do not process $Id:
407 xxx $
407 xxx $
408 +bar
408 +bar
409 record change 2/2 to 'a'? [Ynesfdaq?]
409 record change 2/2 to 'a'? [Ynesfdaq?]
410
410
411 File a should be clean
411 File a should be clean
412
412
413 $ hg status -A a
413 $ hg status -A a
414 C a
414 C a
415
415
416 rollback and revert expansion
416 rollback and revert expansion
417
417
418 $ cat a
418 $ cat a
419 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
419 expand $Id: a,v 59f969a3b52c 1970/01/01 00:00:01 test $
420 foo
420 foo
421 do not process $Id:
421 do not process $Id:
422 xxx $
422 xxx $
423 bar
423 bar
424 $ hg --verbose rollback
424 $ hg --verbose rollback
425 repository tip rolled back to revision 2 (undo commit)
425 repository tip rolled back to revision 2 (undo commit)
426 working directory now based on revision 2
426 working directory now based on revision 2
427 overwriting a expanding keywords
427 overwriting a expanding keywords
428 $ hg status a
428 $ hg status a
429 M a
429 M a
430 $ cat a
430 $ cat a
431 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
431 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
432 foo
432 foo
433 do not process $Id:
433 do not process $Id:
434 xxx $
434 xxx $
435 bar
435 bar
436 $ echo '$Id$' > y
436 $ echo '$Id$' > y
437 $ echo '$Id$' > z
437 $ echo '$Id$' > z
438 $ hg add y
438 $ hg add y
439 $ hg commit -Am "rollback only" z
439 $ hg commit -Am "rollback only" z
440 $ cat z
440 $ cat z
441 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
441 $Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $
442 $ hg --verbose rollback
442 $ hg --verbose rollback
443 repository tip rolled back to revision 2 (undo commit)
443 repository tip rolled back to revision 2 (undo commit)
444 working directory now based on revision 2
444 working directory now based on revision 2
445 overwriting z shrinking keywords
445 overwriting z shrinking keywords
446
446
447 Only z should be overwritten
447 Only z should be overwritten
448
448
449 $ hg status a y z
449 $ hg status a y z
450 M a
450 M a
451 A y
451 A y
452 A z
452 A z
453 $ cat z
453 $ cat z
454 $Id$
454 $Id$
455 $ hg forget y z
455 $ hg forget y z
456 $ rm y z
456 $ rm y z
457
457
458 record added file alone
458 record added file alone
459
459
460 $ hg -v record -l msg -d '1 12' r<<EOF
460 $ hg -v record -l msg -d '1 12' r<<EOF
461 > y
461 > y
462 > EOF
462 > EOF
463 diff --git a/r b/r
463 diff --git a/r b/r
464 new file mode 100644
464 new file mode 100644
465 examine changes to 'r'? [Ynesfdaq?]
465 examine changes to 'r'? [Ynesfdaq?]
466 r
466 r
467 committed changeset 3:899491280810
467 committed changeset 3:899491280810
468 overwriting r expanding keywords
468 overwriting r expanding keywords
469 - status call required for dirstate.normallookup() check
469 - status call required for dirstate.normallookup() check
470 $ hg status r
470 $ hg status r
471 $ hg --verbose rollback
471 $ hg --verbose rollback
472 repository tip rolled back to revision 2 (undo commit)
472 repository tip rolled back to revision 2 (undo commit)
473 working directory now based on revision 2
473 working directory now based on revision 2
474 overwriting r shrinking keywords
474 overwriting r shrinking keywords
475 $ hg forget r
475 $ hg forget r
476 $ rm msg r
476 $ rm msg r
477 $ hg update -C
477 $ hg update -C
478 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
479
479
480 record added keyword ignored file
480 record added keyword ignored file
481
481
482 $ echo '$Id$' > i
482 $ echo '$Id$' > i
483 $ hg add i
483 $ hg add i
484 $ hg --verbose record -d '1 13' -m recignored<<EOF
484 $ hg --verbose record -d '1 13' -m recignored<<EOF
485 > y
485 > y
486 > EOF
486 > EOF
487 diff --git a/i b/i
487 diff --git a/i b/i
488 new file mode 100644
488 new file mode 100644
489 examine changes to 'i'? [Ynesfdaq?]
489 examine changes to 'i'? [Ynesfdaq?]
490 i
490 i
491 committed changeset 3:5f40fe93bbdc
491 committed changeset 3:5f40fe93bbdc
492 $ cat i
492 $ cat i
493 $Id$
493 $Id$
494 $ hg -q rollback
494 $ hg -q rollback
495 $ hg forget i
495 $ hg forget i
496 $ rm i
496 $ rm i
497
497
498 Test patch queue repo
498 Test patch queue repo
499
499
500 $ hg init --mq
500 $ hg init --mq
501 $ hg qimport -r tip -n mqtest.diff
501 $ hg qimport -r tip -n mqtest.diff
502 $ hg commit --mq -m mqtest
502 $ hg commit --mq -m mqtest
503
503
504 Keywords should not be expanded in patch
504 Keywords should not be expanded in patch
505
505
506 $ cat .hg/patches/mqtest.diff
506 $ cat .hg/patches/mqtest.diff
507 # HG changeset patch
507 # HG changeset patch
508 # User User Name <user@example.com>
508 # User User Name <user@example.com>
509 # Date 1 0
509 # Date 1 0
510 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
510 # Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad
511 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
511 # Parent ef63ca68695bc9495032c6fda1350c71e6d256e9
512 cndiff
512 cndiff
513
513
514 diff -r ef63ca68695b -r 40a904bbbe4c c
514 diff -r ef63ca68695b -r 40a904bbbe4c c
515 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
515 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
516 +++ b/c Thu Jan 01 00:00:01 1970 +0000
516 +++ b/c Thu Jan 01 00:00:01 1970 +0000
517 @@ -0,0 +1,2 @@
517 @@ -0,0 +1,2 @@
518 +$Id$
518 +$Id$
519 +tests for different changenodes
519 +tests for different changenodes
520
520
521 $ hg qpop
521 $ hg qpop
522 popping mqtest.diff
522 popping mqtest.diff
523 patch queue now empty
523 patch queue now empty
524
524
525 qgoto, implying qpush, should expand
525 qgoto, implying qpush, should expand
526
526
527 $ hg qgoto mqtest.diff
527 $ hg qgoto mqtest.diff
528 applying mqtest.diff
528 applying mqtest.diff
529 now at: mqtest.diff
529 now at: mqtest.diff
530 $ cat c
530 $ cat c
531 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
531 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
532 tests for different changenodes
532 tests for different changenodes
533 $ hg cat c
533 $ hg cat c
534 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
534 $Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $
535 tests for different changenodes
535 tests for different changenodes
536
536
537 Keywords should not be expanded in filelog
537 Keywords should not be expanded in filelog
538
538
539 $ hg --config 'extensions.keyword=!' cat c
539 $ hg --config 'extensions.keyword=!' cat c
540 $Id$
540 $Id$
541 tests for different changenodes
541 tests for different changenodes
542
542
543 qpop and move on
543 qpop and move on
544
544
545 $ hg qpop
545 $ hg qpop
546 popping mqtest.diff
546 popping mqtest.diff
547 patch queue now empty
547 patch queue now empty
548
548
549 Copy and show added kwfiles
549 Copy and show added kwfiles
550
550
551 $ hg cp a c
551 $ hg cp a c
552 $ hg kwfiles
552 $ hg kwfiles
553 a
553 a
554 c
554 c
555
555
556 Commit and show expansion in original and copy
556 Commit and show expansion in original and copy
557
557
558 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
558 $ hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
559 c
559 c
560 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
560 c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292
561 removing unknown node 40a904bbbe4c from 1-phase boundary
561 overwriting c expanding keywords
562 overwriting c expanding keywords
562 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
563 committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d
563 $ cat a c
564 $ cat a c
564 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
565 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
565 do not process $Id:
566 do not process $Id:
566 xxx $
567 xxx $
567 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
568 expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $
568 do not process $Id:
569 do not process $Id:
569 xxx $
570 xxx $
570
571
571 Touch copied c and check its status
572 Touch copied c and check its status
572
573
573 $ touch c
574 $ touch c
574 $ hg status
575 $ hg status
575
576
576 Copy kwfile to keyword ignored file unexpanding keywords
577 Copy kwfile to keyword ignored file unexpanding keywords
577
578
578 $ hg --verbose copy a i
579 $ hg --verbose copy a i
579 copying a to i
580 copying a to i
580 overwriting i shrinking keywords
581 overwriting i shrinking keywords
581 $ head -n 1 i
582 $ head -n 1 i
582 expand $Id$
583 expand $Id$
583 $ hg forget i
584 $ hg forget i
584 $ rm i
585 $ rm i
585
586
586 Copy ignored file to ignored file: no overwriting
587 Copy ignored file to ignored file: no overwriting
587
588
588 $ hg --verbose copy b i
589 $ hg --verbose copy b i
589 copying b to i
590 copying b to i
590 $ hg forget i
591 $ hg forget i
591 $ rm i
592 $ rm i
592
593
593 cp symlink file; hg cp -A symlink file (part1)
594 cp symlink file; hg cp -A symlink file (part1)
594 - copied symlink points to kwfile: overwrite
595 - copied symlink points to kwfile: overwrite
595
596
596 $ cp sym i
597 $ cp sym i
597 $ ls -l i
598 $ ls -l i
598 -rw-r--r--* (glob)
599 -rw-r--r--* (glob)
599 $ head -1 i
600 $ head -1 i
600 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
601 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
601 $ hg copy --after --verbose sym i
602 $ hg copy --after --verbose sym i
602 copying sym to i
603 copying sym to i
603 overwriting i shrinking keywords
604 overwriting i shrinking keywords
604 $ head -1 i
605 $ head -1 i
605 expand $Id$
606 expand $Id$
606 $ hg forget i
607 $ hg forget i
607 $ rm i
608 $ rm i
608
609
609 Test different options of hg kwfiles
610 Test different options of hg kwfiles
610
611
611 $ hg kwfiles
612 $ hg kwfiles
612 a
613 a
613 c
614 c
614 $ hg -v kwfiles --ignore
615 $ hg -v kwfiles --ignore
615 I b
616 I b
616 I sym
617 I sym
617 $ hg kwfiles --all
618 $ hg kwfiles --all
618 K a
619 K a
619 K c
620 K c
620 I b
621 I b
621 I sym
622 I sym
622
623
623 Diff specific revision
624 Diff specific revision
624
625
625 $ hg diff --rev 1
626 $ hg diff --rev 1
626 diff -r ef63ca68695b c
627 diff -r ef63ca68695b c
627 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
628 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
628 +++ b/c * (glob)
629 +++ b/c * (glob)
629 @@ -0,0 +1,3 @@
630 @@ -0,0 +1,3 @@
630 +expand $Id$
631 +expand $Id$
631 +do not process $Id:
632 +do not process $Id:
632 +xxx $
633 +xxx $
633
634
634 Status after rollback:
635 Status after rollback:
635
636
636 $ hg rollback
637 $ hg rollback
637 repository tip rolled back to revision 1 (undo commit)
638 repository tip rolled back to revision 1 (undo commit)
638 working directory now based on revision 1
639 working directory now based on revision 1
639 $ hg status
640 $ hg status
640 A c
641 A c
641 $ hg update --clean
642 $ hg update --clean
642 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
643
644
644 cp symlink file; hg cp -A symlink file (part2)
645 cp symlink file; hg cp -A symlink file (part2)
645 - copied symlink points to kw ignored file: do not overwrite
646 - copied symlink points to kw ignored file: do not overwrite
646
647
647 $ cat a > i
648 $ cat a > i
648 $ ln -s i symignored
649 $ ln -s i symignored
649 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
650 $ hg commit -Am 'fake expansion in ignored and symlink' i symignored
650 $ cp symignored x
651 $ cp symignored x
651 $ hg copy --after --verbose symignored x
652 $ hg copy --after --verbose symignored x
652 copying symignored to x
653 copying symignored to x
653 $ head -n 1 x
654 $ head -n 1 x
654 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
655 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
655 $ hg forget x
656 $ hg forget x
656 $ rm x
657 $ rm x
657
658
658 $ hg rollback
659 $ hg rollback
659 repository tip rolled back to revision 1 (undo commit)
660 repository tip rolled back to revision 1 (undo commit)
660 working directory now based on revision 1
661 working directory now based on revision 1
661 $ hg update --clean
662 $ hg update --clean
662 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
663 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
663 $ rm i symignored
664 $ rm i symignored
664
665
665 Custom keywordmaps as argument to kwdemo
666 Custom keywordmaps as argument to kwdemo
666
667
667 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
668 $ hg --quiet kwdemo "Xinfo = {author}: {desc}"
668 [extensions]
669 [extensions]
669 keyword =
670 keyword =
670 [keyword]
671 [keyword]
671 ** =
672 ** =
672 b = ignore
673 b = ignore
673 demo.txt =
674 demo.txt =
674 i = ignore
675 i = ignore
675 [keywordset]
676 [keywordset]
676 svn = False
677 svn = False
677 [keywordmaps]
678 [keywordmaps]
678 Xinfo = {author}: {desc}
679 Xinfo = {author}: {desc}
679 $Xinfo: test: hg keyword configuration and expansion example $
680 $Xinfo: test: hg keyword configuration and expansion example $
680
681
681 Configure custom keywordmaps
682 Configure custom keywordmaps
682
683
683 $ cat <<EOF >>$HGRCPATH
684 $ cat <<EOF >>$HGRCPATH
684 > [keywordmaps]
685 > [keywordmaps]
685 > Id = {file} {node|short} {date|rfc822date} {author|user}
686 > Id = {file} {node|short} {date|rfc822date} {author|user}
686 > Xinfo = {author}: {desc}
687 > Xinfo = {author}: {desc}
687 > EOF
688 > EOF
688
689
689 Cat and hg cat files before custom expansion
690 Cat and hg cat files before custom expansion
690
691
691 $ cat a b
692 $ cat a b
692 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
693 expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $
693 do not process $Id:
694 do not process $Id:
694 xxx $
695 xxx $
695 ignore $Id$
696 ignore $Id$
696 $ hg cat sym a b && echo
697 $ hg cat sym a b && echo
697 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
698 expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $
698 do not process $Id:
699 do not process $Id:
699 xxx $
700 xxx $
700 ignore $Id$
701 ignore $Id$
701 a
702 a
702
703
703 Write custom keyword and prepare multiline commit message
704 Write custom keyword and prepare multiline commit message
704
705
705 $ echo '$Xinfo$' >> a
706 $ echo '$Xinfo$' >> a
706 $ cat <<EOF >> log
707 $ cat <<EOF >> log
707 > firstline
708 > firstline
708 > secondline
709 > secondline
709 > EOF
710 > EOF
710
711
711 Interrupted commit should not change state
712 Interrupted commit should not change state
712
713
713 $ hg commit
714 $ hg commit
714 abort: empty commit message
715 abort: empty commit message
715 [255]
716 [255]
716 $ hg status
717 $ hg status
717 M a
718 M a
718 ? c
719 ? c
719 ? log
720 ? log
720
721
721 Commit with multiline message and custom expansion
722 Commit with multiline message and custom expansion
722
723
723 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
724 $ hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
724 a
725 a
726 removing unknown node 40a904bbbe4c from 1-phase boundary
725 overwriting a expanding keywords
727 overwriting a expanding keywords
726 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
728 committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83
727 $ rm log
729 $ rm log
728
730
729 Stat, verify and show custom expansion (firstline)
731 Stat, verify and show custom expansion (firstline)
730
732
731 $ hg status
733 $ hg status
732 ? c
734 ? c
733 $ hg verify
735 $ hg verify
734 checking changesets
736 checking changesets
735 checking manifests
737 checking manifests
736 crosschecking files in changesets and manifests
738 crosschecking files in changesets and manifests
737 checking files
739 checking files
738 3 files, 3 changesets, 4 total revisions
740 3 files, 3 changesets, 4 total revisions
739 $ cat a b
741 $ cat a b
740 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
742 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
741 do not process $Id:
743 do not process $Id:
742 xxx $
744 xxx $
743 $Xinfo: User Name <user@example.com>: firstline $
745 $Xinfo: User Name <user@example.com>: firstline $
744 ignore $Id$
746 ignore $Id$
745 $ hg cat sym a b && echo
747 $ hg cat sym a b && echo
746 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
748 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
747 do not process $Id:
749 do not process $Id:
748 xxx $
750 xxx $
749 $Xinfo: User Name <user@example.com>: firstline $
751 $Xinfo: User Name <user@example.com>: firstline $
750 ignore $Id$
752 ignore $Id$
751 a
753 a
752
754
753 annotate
755 annotate
754
756
755 $ hg annotate a
757 $ hg annotate a
756 1: expand $Id$
758 1: expand $Id$
757 1: do not process $Id:
759 1: do not process $Id:
758 1: xxx $
760 1: xxx $
759 2: $Xinfo$
761 2: $Xinfo$
760
762
761 remove with status checks
763 remove with status checks
762
764
763 $ hg debugrebuildstate
765 $ hg debugrebuildstate
764 $ hg remove a
766 $ hg remove a
765 $ hg --debug commit -m rma
767 $ hg --debug commit -m rma
766 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
768 committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012
767 $ hg status
769 $ hg status
768 ? c
770 ? c
769
771
770 Rollback, revert, and check expansion
772 Rollback, revert, and check expansion
771
773
772 $ hg rollback
774 $ hg rollback
773 repository tip rolled back to revision 2 (undo commit)
775 repository tip rolled back to revision 2 (undo commit)
774 working directory now based on revision 2
776 working directory now based on revision 2
775 $ hg status
777 $ hg status
776 R a
778 R a
777 ? c
779 ? c
778 $ hg revert --no-backup --rev tip a
780 $ hg revert --no-backup --rev tip a
779 $ cat a
781 $ cat a
780 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
782 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
781 do not process $Id:
783 do not process $Id:
782 xxx $
784 xxx $
783 $Xinfo: User Name <user@example.com>: firstline $
785 $Xinfo: User Name <user@example.com>: firstline $
784
786
785 Clone to test global and local configurations
787 Clone to test global and local configurations
786
788
787 $ cd ..
789 $ cd ..
788
790
789 Expansion in destinaton with global configuration
791 Expansion in destinaton with global configuration
790
792
791 $ hg --quiet clone Test globalconf
793 $ hg --quiet clone Test globalconf
792 $ cat globalconf/a
794 $ cat globalconf/a
793 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
795 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
794 do not process $Id:
796 do not process $Id:
795 xxx $
797 xxx $
796 $Xinfo: User Name <user@example.com>: firstline $
798 $Xinfo: User Name <user@example.com>: firstline $
797
799
798 No expansion in destination with local configuration in origin only
800 No expansion in destination with local configuration in origin only
799
801
800 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
802 $ hg --quiet --config 'keyword.**=ignore' clone Test localconf
801 $ cat localconf/a
803 $ cat localconf/a
802 expand $Id$
804 expand $Id$
803 do not process $Id:
805 do not process $Id:
804 xxx $
806 xxx $
805 $Xinfo$
807 $Xinfo$
806
808
807 Clone to test incoming
809 Clone to test incoming
808
810
809 $ hg clone -r1 Test Test-a
811 $ hg clone -r1 Test Test-a
810 adding changesets
812 adding changesets
811 adding manifests
813 adding manifests
812 adding file changes
814 adding file changes
813 added 2 changesets with 3 changes to 3 files
815 added 2 changesets with 3 changes to 3 files
814 updating to branch default
816 updating to branch default
815 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
817 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
816 $ cd Test-a
818 $ cd Test-a
817 $ cat <<EOF >> .hg/hgrc
819 $ cat <<EOF >> .hg/hgrc
818 > [paths]
820 > [paths]
819 > default = ../Test
821 > default = ../Test
820 > EOF
822 > EOF
821 $ hg incoming
823 $ hg incoming
822 comparing with $TESTTMP/Test (glob)
824 comparing with $TESTTMP/Test (glob)
823 searching for changes
825 searching for changes
824 changeset: 2:bb948857c743
826 changeset: 2:bb948857c743
825 tag: tip
827 tag: tip
826 user: User Name <user@example.com>
828 user: User Name <user@example.com>
827 date: Thu Jan 01 00:00:02 1970 +0000
829 date: Thu Jan 01 00:00:02 1970 +0000
828 summary: firstline
830 summary: firstline
829
831
830 Imported patch should not be rejected
832 Imported patch should not be rejected
831
833
832 >>> import re
834 >>> import re
833 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
835 >>> text = re.sub(r'(Id.*)', r'\1 rejecttest', open('a').read())
834 >>> open('a', 'wb').write(text)
836 >>> open('a', 'wb').write(text)
835 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
837 $ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
836 a
838 a
837 overwriting a expanding keywords
839 overwriting a expanding keywords
838 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
840 committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082
839 $ hg export -o ../rejecttest.diff tip
841 $ hg export -o ../rejecttest.diff tip
840 $ cd ../Test
842 $ cd ../Test
841 $ hg import ../rejecttest.diff
843 $ hg import ../rejecttest.diff
842 applying ../rejecttest.diff
844 applying ../rejecttest.diff
843 $ cat a b
845 $ cat a b
844 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
846 expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest
845 do not process $Id: rejecttest
847 do not process $Id: rejecttest
846 xxx $
848 xxx $
847 $Xinfo: User Name <user@example.com>: rejects? $
849 $Xinfo: User Name <user@example.com>: rejects? $
848 ignore $Id$
850 ignore $Id$
849
851
850 $ hg rollback
852 $ hg rollback
851 repository tip rolled back to revision 2 (undo import)
853 repository tip rolled back to revision 2 (undo import)
852 working directory now based on revision 2
854 working directory now based on revision 2
853 $ hg update --clean
855 $ hg update --clean
854 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
856 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
855
857
856 kwexpand/kwshrink on selected files
858 kwexpand/kwshrink on selected files
857
859
858 $ mkdir x
860 $ mkdir x
859 $ hg copy a x/a
861 $ hg copy a x/a
860 $ hg --verbose kwshrink a
862 $ hg --verbose kwshrink a
861 overwriting a shrinking keywords
863 overwriting a shrinking keywords
862 - sleep required for dirstate.normal() check
864 - sleep required for dirstate.normal() check
863 $ sleep 1
865 $ sleep 1
864 $ hg status a
866 $ hg status a
865 $ hg --verbose kwexpand a
867 $ hg --verbose kwexpand a
866 overwriting a expanding keywords
868 overwriting a expanding keywords
867 $ hg status a
869 $ hg status a
868
870
869 kwexpand x/a should abort
871 kwexpand x/a should abort
870
872
871 $ hg --verbose kwexpand x/a
873 $ hg --verbose kwexpand x/a
872 abort: outstanding uncommitted changes
874 abort: outstanding uncommitted changes
873 [255]
875 [255]
874 $ cd x
876 $ cd x
875 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
877 $ hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
876 x/a
878 x/a
877 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
879 x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e
878 overwriting x/a expanding keywords
880 overwriting x/a expanding keywords
879 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
881 committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4
880 $ cat a
882 $ cat a
881 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
883 expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $
882 do not process $Id:
884 do not process $Id:
883 xxx $
885 xxx $
884 $Xinfo: User Name <user@example.com>: xa $
886 $Xinfo: User Name <user@example.com>: xa $
885
887
886 kwshrink a inside directory x
888 kwshrink a inside directory x
887
889
888 $ hg --verbose kwshrink a
890 $ hg --verbose kwshrink a
889 overwriting x/a shrinking keywords
891 overwriting x/a shrinking keywords
890 $ cat a
892 $ cat a
891 expand $Id$
893 expand $Id$
892 do not process $Id:
894 do not process $Id:
893 xxx $
895 xxx $
894 $Xinfo$
896 $Xinfo$
895 $ cd ..
897 $ cd ..
896
898
897 kwexpand nonexistent
899 kwexpand nonexistent
898
900
899 $ hg kwexpand nonexistent
901 $ hg kwexpand nonexistent
900 nonexistent:* (glob)
902 nonexistent:* (glob)
901
903
902
904
903 hg serve
905 hg serve
904 - expand with hgweb file
906 - expand with hgweb file
905 - no expansion with hgweb annotate/changeset/filediff
907 - no expansion with hgweb annotate/changeset/filediff
906 - check errors
908 - check errors
907
909
908 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
910 $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
909 $ cat hg.pid >> $DAEMON_PIDS
911 $ cat hg.pid >> $DAEMON_PIDS
910 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw'
912 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/a/?style=raw'
911 200 Script output follows
913 200 Script output follows
912
914
913 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
915 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
914 do not process $Id:
916 do not process $Id:
915 xxx $
917 xxx $
916 $Xinfo: User Name <user@example.com>: firstline $
918 $Xinfo: User Name <user@example.com>: firstline $
917 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw'
919 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/a/?style=raw'
918 200 Script output follows
920 200 Script output follows
919
921
920
922
921 user@1: expand $Id$
923 user@1: expand $Id$
922 user@1: do not process $Id:
924 user@1: do not process $Id:
923 user@1: xxx $
925 user@1: xxx $
924 user@2: $Xinfo$
926 user@2: $Xinfo$
925
927
926
928
927
929
928
930
929 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw'
931 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/tip/?style=raw'
930 200 Script output follows
932 200 Script output follows
931
933
932
934
933 # HG changeset patch
935 # HG changeset patch
934 # User User Name <user@example.com>
936 # User User Name <user@example.com>
935 # Date 3 0
937 # Date 3 0
936 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
938 # Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4
937 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
939 # Parent bb948857c743469b22bbf51f7ec8112279ca5d83
938 xa
940 xa
939
941
940 diff -r bb948857c743 -r b4560182a3f9 x/a
942 diff -r bb948857c743 -r b4560182a3f9 x/a
941 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
943 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
942 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
944 +++ b/x/a Thu Jan 01 00:00:03 1970 +0000
943 @@ -0,0 +1,4 @@
945 @@ -0,0 +1,4 @@
944 +expand $Id$
946 +expand $Id$
945 +do not process $Id:
947 +do not process $Id:
946 +xxx $
948 +xxx $
947 +$Xinfo$
949 +$Xinfo$
948
950
949 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
951 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/bb948857c743/a?style=raw'
950 200 Script output follows
952 200 Script output follows
951
953
952
954
953 diff -r ef63ca68695b -r bb948857c743 a
955 diff -r ef63ca68695b -r bb948857c743 a
954 --- a/a Thu Jan 01 00:00:00 1970 +0000
956 --- a/a Thu Jan 01 00:00:00 1970 +0000
955 +++ b/a Thu Jan 01 00:00:02 1970 +0000
957 +++ b/a Thu Jan 01 00:00:02 1970 +0000
956 @@ -1,3 +1,4 @@
958 @@ -1,3 +1,4 @@
957 expand $Id$
959 expand $Id$
958 do not process $Id:
960 do not process $Id:
959 xxx $
961 xxx $
960 +$Xinfo$
962 +$Xinfo$
961
963
962
964
963
965
964
966
965 $ cat errors.log
967 $ cat errors.log
966
968
967 Prepare merge and resolve tests
969 Prepare merge and resolve tests
968
970
969 $ echo '$Id$' > m
971 $ echo '$Id$' > m
970 $ hg add m
972 $ hg add m
971 $ hg commit -m 4kw
973 $ hg commit -m 4kw
972 $ echo foo >> m
974 $ echo foo >> m
973 $ hg commit -m 5foo
975 $ hg commit -m 5foo
974
976
975 simplemerge
977 simplemerge
976
978
977 $ hg update 4
979 $ hg update 4
978 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
980 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
979 $ echo foo >> m
981 $ echo foo >> m
980 $ hg commit -m 6foo
982 $ hg commit -m 6foo
981 created new head
983 created new head
982 $ hg merge
984 $ hg merge
983 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
985 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
984 (branch merge, don't forget to commit)
986 (branch merge, don't forget to commit)
985 $ hg commit -m simplemerge
987 $ hg commit -m simplemerge
986 $ cat m
988 $ cat m
987 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
989 $Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $
988 foo
990 foo
989
991
990 conflict: keyword should stay outside conflict zone
992 conflict: keyword should stay outside conflict zone
991
993
992 $ hg update 4
994 $ hg update 4
993 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
995 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 $ echo bar >> m
996 $ echo bar >> m
995 $ hg commit -m 8bar
997 $ hg commit -m 8bar
996 created new head
998 created new head
997 $ hg merge
999 $ hg merge
998 merging m
1000 merging m
999 warning: conflicts during merge.
1001 warning: conflicts during merge.
1000 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1002 merging m incomplete! (edit conflicts, then use 'hg resolve --mark')
1001 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1003 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1002 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1004 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
1003 [1]
1005 [1]
1004 $ cat m
1006 $ cat m
1005 $Id$
1007 $Id$
1006 <<<<<<< local
1008 <<<<<<< local
1007 bar
1009 bar
1008 =======
1010 =======
1009 foo
1011 foo
1010 >>>>>>> other
1012 >>>>>>> other
1011
1013
1012 resolve to local
1014 resolve to local
1013
1015
1014 $ HGMERGE=internal:local hg resolve -a
1016 $ HGMERGE=internal:local hg resolve -a
1015 $ hg commit -m localresolve
1017 $ hg commit -m localresolve
1016 $ cat m
1018 $ cat m
1017 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1019 $Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $
1018 bar
1020 bar
1019
1021
1020 Test restricted mode with transplant -b
1022 Test restricted mode with transplant -b
1021
1023
1022 $ hg update 6
1024 $ hg update 6
1023 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1025 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1024 $ hg branch foo
1026 $ hg branch foo
1025 marked working directory as branch foo
1027 marked working directory as branch foo
1026 (branches are permanent and global, did you want a bookmark?)
1028 (branches are permanent and global, did you want a bookmark?)
1027 $ mv a a.bak
1029 $ mv a a.bak
1028 $ echo foobranch > a
1030 $ echo foobranch > a
1029 $ cat a.bak >> a
1031 $ cat a.bak >> a
1030 $ rm a.bak
1032 $ rm a.bak
1031 $ hg commit -m 9foobranch
1033 $ hg commit -m 9foobranch
1032 $ hg update default
1034 $ hg update default
1033 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1035 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1034 $ hg -y transplant -b foo tip
1036 $ hg -y transplant -b foo tip
1035 applying 4aa30d025d50
1037 applying 4aa30d025d50
1036 4aa30d025d50 transplanted to e00abbf63521
1038 4aa30d025d50 transplanted to e00abbf63521
1037
1039
1038 Expansion in changeset but not in file
1040 Expansion in changeset but not in file
1039
1041
1040 $ hg tip -p
1042 $ hg tip -p
1041 changeset: 11:e00abbf63521
1043 changeset: 11:e00abbf63521
1042 tag: tip
1044 tag: tip
1043 parent: 9:800511b3a22d
1045 parent: 9:800511b3a22d
1044 user: test
1046 user: test
1045 date: Thu Jan 01 00:00:00 1970 +0000
1047 date: Thu Jan 01 00:00:00 1970 +0000
1046 summary: 9foobranch
1048 summary: 9foobranch
1047
1049
1048 diff -r 800511b3a22d -r e00abbf63521 a
1050 diff -r 800511b3a22d -r e00abbf63521 a
1049 --- a/a Thu Jan 01 00:00:00 1970 +0000
1051 --- a/a Thu Jan 01 00:00:00 1970 +0000
1050 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1052 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1051 @@ -1,3 +1,4 @@
1053 @@ -1,3 +1,4 @@
1052 +foobranch
1054 +foobranch
1053 expand $Id$
1055 expand $Id$
1054 do not process $Id:
1056 do not process $Id:
1055 xxx $
1057 xxx $
1056
1058
1057 $ head -n 2 a
1059 $ head -n 2 a
1058 foobranch
1060 foobranch
1059 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1061 expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $
1060
1062
1061 Turn off expansion
1063 Turn off expansion
1062
1064
1063 $ hg -q rollback
1065 $ hg -q rollback
1064 $ hg -q update -C
1066 $ hg -q update -C
1065
1067
1066 kwshrink with unknown file u
1068 kwshrink with unknown file u
1067
1069
1068 $ cp a u
1070 $ cp a u
1069 $ hg --verbose kwshrink
1071 $ hg --verbose kwshrink
1070 overwriting a shrinking keywords
1072 overwriting a shrinking keywords
1071 overwriting m shrinking keywords
1073 overwriting m shrinking keywords
1072 overwriting x/a shrinking keywords
1074 overwriting x/a shrinking keywords
1073
1075
1074 Keywords shrunk in working directory, but not yet disabled
1076 Keywords shrunk in working directory, but not yet disabled
1075 - cat shows unexpanded keywords
1077 - cat shows unexpanded keywords
1076 - hg cat shows expanded keywords
1078 - hg cat shows expanded keywords
1077
1079
1078 $ cat a b
1080 $ cat a b
1079 expand $Id$
1081 expand $Id$
1080 do not process $Id:
1082 do not process $Id:
1081 xxx $
1083 xxx $
1082 $Xinfo$
1084 $Xinfo$
1083 ignore $Id$
1085 ignore $Id$
1084 $ hg cat sym a b && echo
1086 $ hg cat sym a b && echo
1085 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1087 expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $
1086 do not process $Id:
1088 do not process $Id:
1087 xxx $
1089 xxx $
1088 $Xinfo: User Name <user@example.com>: firstline $
1090 $Xinfo: User Name <user@example.com>: firstline $
1089 ignore $Id$
1091 ignore $Id$
1090 a
1092 a
1091
1093
1092 Now disable keyword expansion
1094 Now disable keyword expansion
1093
1095
1094 $ rm "$HGRCPATH"
1096 $ rm "$HGRCPATH"
1095 $ cat a b
1097 $ cat a b
1096 expand $Id$
1098 expand $Id$
1097 do not process $Id:
1099 do not process $Id:
1098 xxx $
1100 xxx $
1099 $Xinfo$
1101 $Xinfo$
1100 ignore $Id$
1102 ignore $Id$
1101 $ hg cat sym a b && echo
1103 $ hg cat sym a b && echo
1102 expand $Id$
1104 expand $Id$
1103 do not process $Id:
1105 do not process $Id:
1104 xxx $
1106 xxx $
1105 $Xinfo$
1107 $Xinfo$
1106 ignore $Id$
1108 ignore $Id$
1107 a
1109 a
General Comments 0
You need to be logged in to leave comments. Login now