##// END OF EJS Templates
merge with -stable
Benoit Boissinot -
r7048:25961e53 merge default
parent child Browse files
Show More
@@ -0,0 +1,43 b''
1 #!/bin/sh
2
3 cat <<EOF >> $HGRCPATH
4 [extensions]
5 notify=
6
7 [hooks]
8 changegroup.notify = python:hgext.notify.hook
9
10 [notify]
11 sources = push
12 diffstat = False
13 maxsubject = 200
14
15 [usersubs]
16 foo@bar = *
17
18 [reposubs]
19 * = baz
20 EOF
21
22 hg init a
23
24 echo % clone
25 hg --traceback clone a b
26
27 echo a > b/a
28 echo % commit
29 hg --traceback --cwd b commit -Ama
30
31 echo a >> b/a
32 echo % commit
33 hg --traceback --cwd b commit -Amb
34
35 echo % push
36 hg --traceback --cwd b push ../a 2>&1 |
37 python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' |
38 sed -e 's/\(Message-Id:\).*/\1/' \
39 -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
40 -e 's/^Subject: .*test-notify/Subject: test-notify/' \
41 -e 's/^details: .*test-notify/details: test-notify/' \
42 -e 's/^Date:.*/Date:/'
43
@@ -0,0 +1,36 b''
1 % clone
2 updating working directory
3 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
4 % commit
5 adding a
6 % commit
7 % push
8 pushing to ../a
9 searching for changes
10 adding changesets
11 adding manifests
12 adding file changes
13 added 2 changesets with 2 changes to 1 files
14 Date:
15 Subject: test-notify-changegroup/a: 2 new changesets
16 From: test
17 X-Hg-Notification: changeset cb9a9f314b8b
18 Message-Id:
19 To: baz, foo@bar
20
21 changeset cb9a9f314b8b in test-notify-changegroup/a
22 details: test-notify-changegroup/a?cmd=changeset;node=cb9a9f314b8b
23 summary: a
24
25 changeset ba677d0156c1 in test-notify-changegroup/a
26 details: test-notify-changegroup/a?cmd=changeset;node=ba677d0156c1
27 summary: b
28
29 diffs (6 lines):
30
31 diff -r 000000000000 -r ba677d0156c1 a
32 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
33 +++ b/a Thu Jan 01 00:00:00 1970 +0000
34 @@ -0,0 +1,2 @@
35 +a
36 +a
@@ -1,286 +1,287 b''
1 # hg.py - repository classes for mercurial
1 # hg.py - repository classes for mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
4 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
5 #
5 #
6 # This software may be used and distributed according to the terms
6 # This software may be used and distributed according to the terms
7 # of the GNU General Public License, incorporated herein by reference.
7 # of the GNU General Public License, incorporated herein by reference.
8
8
9 from i18n import _
9 from i18n import _
10 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
10 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
11 import errno, lock, os, shutil, util, extensions
11 import errno, lock, os, shutil, util, extensions
12 import merge as _merge
12 import merge as _merge
13 import verify as _verify
13 import verify as _verify
14
14
15 def _local(path):
15 def _local(path):
16 return (os.path.isfile(util.drop_scheme('file', path)) and
16 return (os.path.isfile(util.drop_scheme('file', path)) and
17 bundlerepo or localrepo)
17 bundlerepo or localrepo)
18
18
19 def parseurl(url, revs=[]):
19 def parseurl(url, revs=[]):
20 '''parse url#branch, returning url, branch + revs'''
20 '''parse url#branch, returning url, branch + revs'''
21
21
22 if '#' not in url:
22 if '#' not in url:
23 return url, (revs or None), None
23 return url, (revs or None), None
24
24
25 url, rev = url.split('#', 1)
25 url, rev = url.split('#', 1)
26 return url, revs + [rev], rev
26 return url, revs + [rev], rev
27
27
28 schemes = {
28 schemes = {
29 'bundle': bundlerepo,
29 'bundle': bundlerepo,
30 'file': _local,
30 'file': _local,
31 'http': httprepo,
31 'http': httprepo,
32 'https': httprepo,
32 'https': httprepo,
33 'ssh': sshrepo,
33 'ssh': sshrepo,
34 'static-http': statichttprepo,
34 'static-http': statichttprepo,
35 }
35 }
36
36
37 def _lookup(path):
37 def _lookup(path):
38 scheme = 'file'
38 scheme = 'file'
39 if path:
39 if path:
40 c = path.find(':')
40 c = path.find(':')
41 if c > 0:
41 if c > 0:
42 scheme = path[:c]
42 scheme = path[:c]
43 thing = schemes.get(scheme) or schemes['file']
43 thing = schemes.get(scheme) or schemes['file']
44 try:
44 try:
45 return thing(path)
45 return thing(path)
46 except TypeError:
46 except TypeError:
47 return thing
47 return thing
48
48
49 def islocal(repo):
49 def islocal(repo):
50 '''return true if repo or path is local'''
50 '''return true if repo or path is local'''
51 if isinstance(repo, str):
51 if isinstance(repo, str):
52 try:
52 try:
53 return _lookup(repo).islocal(repo)
53 return _lookup(repo).islocal(repo)
54 except AttributeError:
54 except AttributeError:
55 return False
55 return False
56 return repo.local()
56 return repo.local()
57
57
58 def repository(ui, path='', create=False):
58 def repository(ui, path='', create=False):
59 """return a repository object for the specified path"""
59 """return a repository object for the specified path"""
60 repo = _lookup(path).instance(ui, path, create)
60 repo = _lookup(path).instance(ui, path, create)
61 ui = getattr(repo, "ui", ui)
61 ui = getattr(repo, "ui", ui)
62 for name, module in extensions.extensions():
62 for name, module in extensions.extensions():
63 hook = getattr(module, 'reposetup', None)
63 hook = getattr(module, 'reposetup', None)
64 if hook:
64 if hook:
65 hook(ui, repo)
65 hook(ui, repo)
66 return repo
66 return repo
67
67
68 def defaultdest(source):
68 def defaultdest(source):
69 '''return default destination of clone if none is given'''
69 '''return default destination of clone if none is given'''
70 return os.path.basename(os.path.normpath(source))
70 return os.path.basename(os.path.normpath(source))
71
71
72 def localpath(path):
72 def localpath(path):
73 if path.startswith('file://localhost/'):
73 if path.startswith('file://localhost/'):
74 return path[16:]
74 return path[16:]
75 if path.startswith('file://'):
75 if path.startswith('file://'):
76 return path[7:]
76 return path[7:]
77 if path.startswith('file:'):
77 if path.startswith('file:'):
78 return path[5:]
78 return path[5:]
79 return path
79 return path
80
80
81 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
81 def clone(ui, source, dest=None, pull=False, rev=None, update=True,
82 stream=False):
82 stream=False):
83 """Make a copy of an existing repository.
83 """Make a copy of an existing repository.
84
84
85 Create a copy of an existing repository in a new directory. The
85 Create a copy of an existing repository in a new directory. The
86 source and destination are URLs, as passed to the repository
86 source and destination are URLs, as passed to the repository
87 function. Returns a pair of repository objects, the source and
87 function. Returns a pair of repository objects, the source and
88 newly created destination.
88 newly created destination.
89
89
90 The location of the source is added to the new repository's
90 The location of the source is added to the new repository's
91 .hg/hgrc file, as the default to be used for future pulls and
91 .hg/hgrc file, as the default to be used for future pulls and
92 pushes.
92 pushes.
93
93
94 If an exception is raised, the partly cloned/updated destination
94 If an exception is raised, the partly cloned/updated destination
95 repository will be deleted.
95 repository will be deleted.
96
96
97 Arguments:
97 Arguments:
98
98
99 source: repository object or URL
99 source: repository object or URL
100
100
101 dest: URL of destination repository to create (defaults to base
101 dest: URL of destination repository to create (defaults to base
102 name of source repository)
102 name of source repository)
103
103
104 pull: always pull from source repository, even in local case
104 pull: always pull from source repository, even in local case
105
105
106 stream: stream raw data uncompressed from repository (fast over
106 stream: stream raw data uncompressed from repository (fast over
107 LAN, slow over WAN)
107 LAN, slow over WAN)
108
108
109 rev: revision to clone up to (implies pull=True)
109 rev: revision to clone up to (implies pull=True)
110
110
111 update: update working directory after clone completes, if
111 update: update working directory after clone completes, if
112 destination is local repository (True means update to default rev,
112 destination is local repository (True means update to default rev,
113 anything else is treated as a revision)
113 anything else is treated as a revision)
114 """
114 """
115
115
116 if isinstance(source, str):
116 if isinstance(source, str):
117 origsource = ui.expandpath(source)
117 origsource = ui.expandpath(source)
118 source, rev, checkout = parseurl(origsource, rev)
118 source, rev, checkout = parseurl(origsource, rev)
119 src_repo = repository(ui, source)
119 src_repo = repository(ui, source)
120 else:
120 else:
121 src_repo = source
121 src_repo = source
122 origsource = source = src_repo.url()
122 origsource = source = src_repo.url()
123 checkout = None
123 checkout = None
124
124
125 if dest is None:
125 if dest is None:
126 dest = defaultdest(source)
126 dest = defaultdest(source)
127 ui.status(_("destination directory: %s\n") % dest)
127 ui.status(_("destination directory: %s\n") % dest)
128
128
129 dest = localpath(dest)
129 dest = localpath(dest)
130 source = localpath(source)
130 source = localpath(source)
131
131
132 if os.path.exists(dest):
132 if os.path.exists(dest):
133 raise util.Abort(_("destination '%s' already exists") % dest)
133 raise util.Abort(_("destination '%s' already exists") % dest)
134
134
135 class DirCleanup(object):
135 class DirCleanup(object):
136 def __init__(self, dir_):
136 def __init__(self, dir_):
137 self.rmtree = shutil.rmtree
137 self.rmtree = shutil.rmtree
138 self.dir_ = dir_
138 self.dir_ = dir_
139 def close(self):
139 def close(self):
140 self.dir_ = None
140 self.dir_ = None
141 def __del__(self):
141 def __del__(self):
142 if self.dir_:
142 if self.dir_:
143 self.rmtree(self.dir_, True)
143 self.rmtree(self.dir_, True)
144
144
145 src_lock = dest_lock = dir_cleanup = None
145 src_lock = dest_lock = dir_cleanup = None
146 try:
146 try:
147 if islocal(dest):
147 if islocal(dest):
148 dir_cleanup = DirCleanup(dest)
148 dir_cleanup = DirCleanup(dest)
149
149
150 abspath = origsource
150 abspath = origsource
151 copy = False
151 copy = False
152 if src_repo.cancopy() and islocal(dest):
152 if src_repo.cancopy() and islocal(dest):
153 abspath = os.path.abspath(util.drop_scheme('file', origsource))
153 abspath = os.path.abspath(util.drop_scheme('file', origsource))
154 copy = not pull and not rev
154 copy = not pull and not rev
155
155
156 if copy:
156 if copy:
157 try:
157 try:
158 # we use a lock here because if we race with commit, we
158 # we use a lock here because if we race with commit, we
159 # can end up with extra data in the cloned revlogs that's
159 # can end up with extra data in the cloned revlogs that's
160 # not pointed to by changesets, thus causing verify to
160 # not pointed to by changesets, thus causing verify to
161 # fail
161 # fail
162 src_lock = src_repo.lock()
162 src_lock = src_repo.lock()
163 except lock.LockException:
163 except lock.LockException:
164 copy = False
164 copy = False
165
165
166 if copy:
166 if copy:
167 if not os.path.exists(dest):
167 if not os.path.exists(dest):
168 os.mkdir(dest)
168 os.mkdir(dest)
169 try:
169 try:
170 dest_path = os.path.realpath(os.path.join(dest, ".hg"))
170 dest_path = os.path.realpath(os.path.join(dest, ".hg"))
171 os.mkdir(dest_path)
171 os.mkdir(dest_path)
172 except OSError, inst:
172 except OSError, inst:
173 if inst.errno == errno.EEXIST:
173 if inst.errno == errno.EEXIST:
174 dir_cleanup.close()
174 dir_cleanup.close()
175 raise util.Abort(_("destination '%s' already exists")
175 raise util.Abort(_("destination '%s' already exists")
176 % dest)
176 % dest)
177 raise
177 raise
178
178
179 for f in src_repo.store.copylist():
179 for f in src_repo.store.copylist():
180 src = os.path.join(src_repo.path, f)
180 src = os.path.join(src_repo.path, f)
181 dst = os.path.join(dest_path, f)
181 dst = os.path.join(dest_path, f)
182 dstbase = os.path.dirname(dst)
182 dstbase = os.path.dirname(dst)
183 if dstbase and not os.path.exists(dstbase):
183 if dstbase and not os.path.exists(dstbase):
184 os.mkdir(dstbase)
184 os.mkdir(dstbase)
185 if os.path.exists(src):
185 if os.path.exists(src):
186 if dst.endswith('data'):
186 if dst.endswith('data'):
187 # lock to avoid premature writing to the target
187 # lock to avoid premature writing to the target
188 dest_lock = lock.lock(os.path.join(dstbase, "lock"))
188 dest_lock = lock.lock(os.path.join(dstbase, "lock"))
189 util.copyfiles(src, dst)
189 util.copyfiles(src, dst)
190
190
191 # we need to re-init the repo after manually copying the data
191 # we need to re-init the repo after manually copying the data
192 # into it
192 # into it
193 dest_repo = repository(ui, dest)
193 dest_repo = repository(ui, dest)
194
194
195 else:
195 else:
196 try:
196 try:
197 dest_repo = repository(ui, dest, create=True)
197 dest_repo = repository(ui, dest, create=True)
198 except OSError, inst:
198 except OSError, inst:
199 if inst.errno == errno.EEXIST:
199 if inst.errno == errno.EEXIST:
200 dir_cleanup.close()
200 dir_cleanup.close()
201 raise util.Abort(_("destination '%s' already exists")
201 raise util.Abort(_("destination '%s' already exists")
202 % dest)
202 % dest)
203 raise
203 raise
204
204
205 revs = None
205 revs = None
206 if rev:
206 if rev:
207 if 'lookup' not in src_repo.capabilities:
207 if 'lookup' not in src_repo.capabilities:
208 raise util.Abort(_("src repository does not support revision "
208 raise util.Abort(_("src repository does not support revision "
209 "lookup and so doesn't support clone by "
209 "lookup and so doesn't support clone by "
210 "revision"))
210 "revision"))
211 revs = [src_repo.lookup(r) for r in rev]
211 revs = [src_repo.lookup(r) for r in rev]
212
212
213 if dest_repo.local():
213 if dest_repo.local():
214 dest_repo.clone(src_repo, heads=revs, stream=stream)
214 dest_repo.clone(src_repo, heads=revs, stream=stream)
215 elif src_repo.local():
215 elif src_repo.local():
216 src_repo.push(dest_repo, revs=revs)
216 src_repo.push(dest_repo, revs=revs)
217 else:
217 else:
218 raise util.Abort(_("clone from remote to remote not supported"))
218 raise util.Abort(_("clone from remote to remote not supported"))
219
219
220 if dir_cleanup:
220 if dir_cleanup:
221 dir_cleanup.close()
221 dir_cleanup.close()
222
222
223 if dest_repo.local():
223 if dest_repo.local():
224 fp = dest_repo.opener("hgrc", "w", text=True)
224 fp = dest_repo.opener("hgrc", "w", text=True)
225 fp.write("[paths]\n")
225 fp.write("[paths]\n")
226 fp.write("default = %s\n" % abspath)
226 # percent needs to be escaped for ConfigParser
227 fp.write("default = %s\n" % abspath.replace('%', '%%'))
227 fp.close()
228 fp.close()
228
229
229 if update:
230 if update:
230 dest_repo.ui.status(_("updating working directory\n"))
231 dest_repo.ui.status(_("updating working directory\n"))
231 if update is not True:
232 if update is not True:
232 checkout = update
233 checkout = update
233 elif not checkout:
234 elif not checkout:
234 try:
235 try:
235 checkout = dest_repo.lookup("default")
236 checkout = dest_repo.lookup("default")
236 except:
237 except:
237 checkout = dest_repo.changelog.tip()
238 checkout = dest_repo.changelog.tip()
238 _update(dest_repo, checkout)
239 _update(dest_repo, checkout)
239
240
240 return src_repo, dest_repo
241 return src_repo, dest_repo
241 finally:
242 finally:
242 del src_lock, dest_lock, dir_cleanup
243 del src_lock, dest_lock, dir_cleanup
243
244
244 def _showstats(repo, stats):
245 def _showstats(repo, stats):
245 stats = ((stats[0], _("updated")),
246 stats = ((stats[0], _("updated")),
246 (stats[1], _("merged")),
247 (stats[1], _("merged")),
247 (stats[2], _("removed")),
248 (stats[2], _("removed")),
248 (stats[3], _("unresolved")))
249 (stats[3], _("unresolved")))
249 note = ", ".join([_("%d files %s") % s for s in stats])
250 note = ", ".join([_("%d files %s") % s for s in stats])
250 repo.ui.status("%s\n" % note)
251 repo.ui.status("%s\n" % note)
251
252
252 def _update(repo, node): return update(repo, node)
253 def _update(repo, node): return update(repo, node)
253
254
254 def update(repo, node):
255 def update(repo, node):
255 """update the working directory to node, merging linear changes"""
256 """update the working directory to node, merging linear changes"""
256 pl = repo.parents()
257 pl = repo.parents()
257 stats = _merge.update(repo, node, False, False, None)
258 stats = _merge.update(repo, node, False, False, None)
258 _showstats(repo, stats)
259 _showstats(repo, stats)
259 if stats[3]:
260 if stats[3]:
260 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
261 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
261 return stats[3] > 0
262 return stats[3] > 0
262
263
263 def clean(repo, node, show_stats=True):
264 def clean(repo, node, show_stats=True):
264 """forcibly switch the working directory to node, clobbering changes"""
265 """forcibly switch the working directory to node, clobbering changes"""
265 stats = _merge.update(repo, node, False, True, None)
266 stats = _merge.update(repo, node, False, True, None)
266 if show_stats: _showstats(repo, stats)
267 if show_stats: _showstats(repo, stats)
267 return stats[3] > 0
268 return stats[3] > 0
268
269
269 def merge(repo, node, force=None, remind=True):
270 def merge(repo, node, force=None, remind=True):
270 """branch merge with node, resolving changes"""
271 """branch merge with node, resolving changes"""
271 stats = _merge.update(repo, node, True, force, False)
272 stats = _merge.update(repo, node, True, force, False)
272 _showstats(repo, stats)
273 _showstats(repo, stats)
273 if stats[3]:
274 if stats[3]:
274 pl = repo.parents()
275 pl = repo.parents()
275 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
276 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
276 elif remind:
277 elif remind:
277 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
278 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
278 return stats[3] > 0
279 return stats[3] > 0
279
280
280 def revert(repo, node, choose):
281 def revert(repo, node, choose):
281 """revert changes to revision in node without updating dirstate"""
282 """revert changes to revision in node without updating dirstate"""
282 return _merge.update(repo, node, False, True, choose)[3] > 0
283 return _merge.update(repo, node, False, True, choose)[3] > 0
283
284
284 def verify(repo):
285 def verify(repo):
285 """verify the consistency of a repository"""
286 """verify the consistency of a repository"""
286 return _verify.verify(repo)
287 return _verify.verify(repo)
@@ -1,12 +1,14 b''
1 # this is hack to make sure no escape characters are inserted into the output
2 import os; del os.environ['TERM']
1 import doctest
3 import doctest
2
4
3 import mercurial.changelog
5 import mercurial.changelog
4 # test doctest from changelog
6 # test doctest from changelog
5
7
6 doctest.testmod(mercurial.changelog)
8 doctest.testmod(mercurial.changelog)
7
9
8 import mercurial.httprepo
10 import mercurial.httprepo
9 doctest.testmod(mercurial.httprepo)
11 doctest.testmod(mercurial.httprepo)
10
12
11 import mercurial.util
13 import mercurial.util
12 doctest.testmod(mercurial.util)
14 doctest.testmod(mercurial.util)
@@ -1,7 +1,18 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 mkdir t
3 mkdir t
4 cd t
4 cd t
5 hg init
5 hg init
6 echo "invalid" > .hg/hgrc
6 echo "invalid" > .hg/hgrc
7 hg status 2>&1 |sed -e "s:/.*\(/t/.*\):...\1:"
7 hg status 2>&1 |sed -e "s:/.*\(/t/.*\):...\1:"
8
9 #issue 1199, escaping
10
11 cd ..
12 hg init "foo%bar"
13 hg clone "foo%bar" foobar
14 p=`pwd`
15 cd foobar
16 cat .hg/hgrc |sed -e "s:$p:...:"
17 hg paths |sed -e "s:$p:...:"
18 hg showconfig |sed -e "s:$p:...:"
@@ -1,4 +1,16 b''
1 abort: Failed to parse .../t/.hg/hgrc
1 abort: Failed to parse .../t/.hg/hgrc
2 File contains no section headers.
2 File contains no section headers.
3 file: .../t/.hg/hgrc, line: 1
3 file: .../t/.hg/hgrc, line: 1
4 'invalid\n'
4 'invalid\n'
5 updating working directory
6 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
7 [paths]
8 default = .../foo%%bar
9 default = .../foo%bar
10 bundle.mainreporoot=.../foobar
11 defaults.backout=-d "0 0"
12 defaults.commit=-d "0 0"
13 defaults.debugrawcommit=-d "0 0"
14 defaults.tag=-d "0 0"
15 paths.default=.../foo%bar
16 ui.slash=True
@@ -1,539 +1,539 b''
1 #!/bin/sh
1 #!/bin/sh
2
2
3 checkundo()
3 checkundo()
4 {
4 {
5 if [ -f .hg/store/undo ]; then
5 if [ -f .hg/store/undo ]; then
6 echo ".hg/store/undo still exists after $1"
6 echo ".hg/store/undo still exists after $1"
7 fi
7 fi
8 }
8 }
9
9
10 echo "[extensions]" >> $HGRCPATH
10 echo "[extensions]" >> $HGRCPATH
11 echo "mq=" >> $HGRCPATH
11 echo "mq=" >> $HGRCPATH
12
12
13 echo % help
13 echo % help
14 hg help mq
14 hg help mq
15
15
16 hg init a
16 hg init a
17 cd a
17 cd a
18 echo a > a
18 echo a > a
19 hg ci -Ama
19 hg ci -Ama
20
20
21 hg clone . ../k
21 hg clone . ../k
22
22
23 mkdir b
23 mkdir b
24 echo z > b/z
24 echo z > b/z
25 hg ci -Ama
25 hg ci -Ama
26
26
27 echo % qinit
27 echo % qinit
28
28
29 hg qinit
29 hg qinit
30
30
31 cd ..
31 cd ..
32 hg init b
32 hg init b
33
33
34 echo % -R qinit
34 echo % -R qinit
35
35
36 hg -R b qinit
36 hg -R b qinit
37
37
38 hg init c
38 hg init c
39
39
40 echo % qinit -c
40 echo % qinit -c
41
41
42 hg --cwd c qinit -c
42 hg --cwd c qinit -c
43 hg -R c/.hg/patches st
43 hg -R c/.hg/patches st
44
44
45 echo % qnew should refuse bad patch names
45 echo % qnew should refuse bad patch names
46 hg -R c qnew series
46 hg -R c qnew series
47 hg -R c qnew status
47 hg -R c qnew status
48 hg -R c qnew guards
48 hg -R c qnew guards
49 hg -R c qnew .hgignore
49 hg -R c qnew .hgignore
50
50
51 echo % qnew implies add
51 echo % qnew implies add
52
52
53 hg -R c qnew test.patch
53 hg -R c qnew test.patch
54 hg -R c/.hg/patches st
54 hg -R c/.hg/patches st
55
55
56 echo '% qinit; qinit -c'
56 echo '% qinit; qinit -c'
57 hg init d
57 hg init d
58 cd d
58 cd d
59 hg qinit
59 hg qinit
60 hg qinit -c
60 hg qinit -c
61 # qinit -c should create both files if they don't exist
61 # qinit -c should create both files if they don't exist
62 echo ' .hgignore:'
62 echo ' .hgignore:'
63 cat .hg/patches/.hgignore
63 cat .hg/patches/.hgignore
64 echo ' series:'
64 echo ' series:'
65 cat .hg/patches/series
65 cat .hg/patches/series
66 hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
66 hg qinit -c 2>&1 | sed -e 's/repository.*already/repository already/'
67 cd ..
67 cd ..
68
68
69 echo '% qinit; <stuff>; qinit -c'
69 echo '% qinit; <stuff>; qinit -c'
70 hg init e
70 hg init e
71 cd e
71 cd e
72 hg qnew A
72 hg qnew A
73 checkundo qnew
73 checkundo qnew
74 echo foo > foo
74 echo foo > foo
75 hg add foo
75 hg add foo
76 hg qrefresh
76 hg qrefresh
77 hg qnew B
77 hg qnew B
78 echo >> foo
78 echo >> foo
79 hg qrefresh
79 hg qrefresh
80 echo status >> .hg/patches/.hgignore
80 echo status >> .hg/patches/.hgignore
81 echo bleh >> .hg/patches/.hgignore
81 echo bleh >> .hg/patches/.hgignore
82 hg qinit -c
82 hg qinit -c
83 hg -R .hg/patches status
83 hg -R .hg/patches status
84 # qinit -c shouldn't touch these files if they already exist
84 # qinit -c shouldn't touch these files if they already exist
85 echo ' .hgignore:'
85 echo ' .hgignore:'
86 cat .hg/patches/.hgignore
86 cat .hg/patches/.hgignore
87 echo ' series:'
87 echo ' series:'
88 cat .hg/patches/series
88 cat .hg/patches/series
89 cd ..
89 cd ..
90
90
91 cd a
91 cd a
92
92
93 echo a > somefile
93 echo a > somefile
94 hg add somefile
94 hg add somefile
95
95
96 echo % qnew with uncommitted changes
96 echo % qnew with uncommitted changes
97
97
98 hg qnew uncommitted.patch
98 hg qnew uncommitted.patch
99 hg st
99 hg st
100 hg qseries
100 hg qseries
101
101
102 echo '% qnew with uncommitted changes and missing file (issue 803)'
102 echo '% qnew with uncommitted changes and missing file (issue 803)'
103
103
104 hg qnew issue803.patch someotherfile 2>&1 | \
104 hg qnew issue803.patch someotherfile 2>&1 | \
105 sed -e 's/someotherfile:.*/someotherfile: No such file or directory/'
105 sed -e 's/someotherfile:.*/someotherfile: No such file or directory/'
106 hg st
106 hg st
107 hg qseries
107 hg qseries
108 hg qpop -f
108 hg qpop -f
109 hg qdel issue803.patch
109 hg qdel issue803.patch
110
110
111 hg revert --no-backup somefile
111 hg revert --no-backup somefile
112 rm somefile
112 rm somefile
113
113
114 echo % qnew -m
114 echo % qnew -m
115
115
116 hg qnew -m 'foo bar' test.patch
116 hg qnew -m 'foo bar' test.patch
117 cat .hg/patches/test.patch
117 cat .hg/patches/test.patch
118
118
119 echo % qrefresh
119 echo % qrefresh
120
120
121 echo a >> a
121 echo a >> a
122 hg qrefresh
122 hg qrefresh
123 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
123 sed -e "s/^\(diff -r \)\([a-f0-9]* \)/\1 x/" \
124 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
124 -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
125 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
125 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/test.patch
126
126
127 echo % empty qrefresh
127 echo % empty qrefresh
128
128
129 hg qrefresh -X a
129 hg qrefresh -X a
130 echo 'revision:'
130 echo 'revision:'
131 hg diff -r -2 -r -1
131 hg diff -r -2 -r -1
132 echo 'patch:'
132 echo 'patch:'
133 cat .hg/patches/test.patch
133 cat .hg/patches/test.patch
134 echo 'working dir diff:'
134 echo 'working dir diff:'
135 hg diff --nodates -q
135 hg diff --nodates -q
136 # restore things
136 # restore things
137 hg qrefresh
137 hg qrefresh
138 checkundo qrefresh
138 checkundo qrefresh
139
139
140 echo % qpop
140 echo % qpop
141
141
142 hg qpop
142 hg qpop
143 checkundo qpop
143 checkundo qpop
144
144
145 echo % qpush
145 echo % qpush
146
146
147 hg qpush
147 hg qpush
148 checkundo qpush
148 checkundo qpush
149
149
150 cd ..
150 cd ..
151
151
152 echo % pop/push outside repo
152 echo % pop/push outside repo
153
153
154 hg -R a qpop
154 hg -R a qpop
155 hg -R a qpush
155 hg -R a qpush
156
156
157 cd a
157 cd a
158 hg qnew test2.patch
158 hg qnew test2.patch
159
159
160 echo % qrefresh in subdir
160 echo % qrefresh in subdir
161
161
162 cd b
162 cd b
163 echo a > a
163 echo a > a
164 hg add a
164 hg add a
165 hg qrefresh
165 hg qrefresh
166
166
167 echo % pop/push -a in subdir
167 echo % pop/push -a in subdir
168
168
169 hg qpop -a
169 hg qpop -a
170 hg --traceback qpush -a
170 hg --traceback qpush -a
171
171
172 echo % qseries
172 echo % qseries
173 hg qseries
173 hg qseries
174 hg qpop
174 hg qpop
175 hg qseries -vs
175 hg qseries -vs
176 hg qpush
176 hg qpush
177
177
178 echo % qapplied
178 echo % qapplied
179 hg qapplied
179 hg qapplied
180
180
181 echo % qtop
181 echo % qtop
182 hg qtop
182 hg qtop
183
183
184 echo % qprev
184 echo % qprev
185 hg qprev
185 hg qprev
186
186
187 echo % qnext
187 echo % qnext
188 hg qnext
188 hg qnext
189
189
190 echo % pop, qnext, qprev, qapplied
190 echo % pop, qnext, qprev, qapplied
191 hg qpop
191 hg qpop
192 hg qnext
192 hg qnext
193 hg qprev
193 hg qprev
194 hg qapplied
194 hg qapplied
195
195
196 echo % commit should fail
196 echo % commit should fail
197 hg commit
197 hg commit
198
198
199 echo % push should fail
199 echo % push should fail
200 hg push ../../k
200 hg push ../../k
201
201
202 echo % qunapplied
202 echo % qunapplied
203 hg qunapplied
203 hg qunapplied
204
204
205 echo % qpush/qpop with index
205 echo % qpush/qpop with index
206 hg qnew test1b.patch
206 hg qnew test1b.patch
207 echo 1b > 1b
207 echo 1b > 1b
208 hg add 1b
208 hg add 1b
209 hg qrefresh
209 hg qrefresh
210 hg qpush 2
210 hg qpush 2
211 hg qpop 0
211 hg qpop 0
212 hg qpush test.patch+1
212 hg qpush test.patch+1
213 hg qpush test.patch+2
213 hg qpush test.patch+2
214 hg qpop test2.patch-1
214 hg qpop test2.patch-1
215 hg qpop test2.patch-2
215 hg qpop test2.patch-2
216 hg qpush test1b.patch+1
216 hg qpush test1b.patch+1
217
217
218 echo % push should succeed
218 echo % push should succeed
219 hg qpop -a
219 hg qpop -a
220 hg push ../../k
220 hg push ../../k
221
221
222 echo % qpush/qpop error codes
222 echo % qpush/qpop error codes
223 errorcode()
223 errorcode()
224 {
224 {
225 hg "$@" && echo " $@ succeeds" || echo " $@ fails"
225 hg "$@" && echo " $@ succeeds" || echo " $@ fails"
226 }
226 }
227
227
228 # we want to start with some patches applied
228 # we want to start with some patches applied
229 hg qpush -a
229 hg qpush -a
230 echo " % pops all patches and succeeds"
230 echo " % pops all patches and succeeds"
231 errorcode qpop -a
231 errorcode qpop -a
232 echo " % does nothing and succeeds"
232 echo " % does nothing and succeeds"
233 errorcode qpop -a
233 errorcode qpop -a
234 echo " % fails - nothing else to pop"
234 echo " % fails - nothing else to pop"
235 errorcode qpop
235 errorcode qpop
236 echo " % pushes a patch and succeeds"
236 echo " % pushes a patch and succeeds"
237 errorcode qpush
237 errorcode qpush
238 echo " % pops a patch and succeeds"
238 echo " % pops a patch and succeeds"
239 errorcode qpop
239 errorcode qpop
240 echo " % pushes up to test1b.patch and succeeds"
240 echo " % pushes up to test1b.patch and succeeds"
241 errorcode qpush test1b.patch
241 errorcode qpush test1b.patch
242 echo " % does nothing and succeeds"
242 echo " % does nothing and succeeds"
243 errorcode qpush test1b.patch
243 errorcode qpush test1b.patch
244 echo " % does nothing and succeeds"
244 echo " % does nothing and succeeds"
245 errorcode qpop test1b.patch
245 errorcode qpop test1b.patch
246 echo " % fails - can't push to this patch"
246 echo " % fails - can't push to this patch"
247 errorcode qpush test.patch
247 errorcode qpush test.patch
248 echo " % fails - can't pop to this patch"
248 echo " % fails - can't pop to this patch"
249 errorcode qpop test2.patch
249 errorcode qpop test2.patch
250 echo " % pops up to test.patch and succeeds"
250 echo " % pops up to test.patch and succeeds"
251 errorcode qpop test.patch
251 errorcode qpop test.patch
252 echo " % pushes all patches and succeeds"
252 echo " % pushes all patches and succeeds"
253 errorcode qpush -a
253 errorcode qpush -a
254 echo " % does nothing and succeeds"
254 echo " % does nothing and succeeds"
255 errorcode qpush -a
255 errorcode qpush -a
256 echo " % fails - nothing else to push"
256 echo " % fails - nothing else to push"
257 errorcode qpush
257 errorcode qpush
258 echo " % does nothing and succeeds"
258 echo " % does nothing and succeeds"
259 errorcode qpush test2.patch
259 errorcode qpush test2.patch
260
260
261
261
262 echo % strip
262 echo % strip
263 cd ../../b
263 cd ../../b
264 echo x>x
264 echo x>x
265 hg ci -Ama
265 hg ci -Ama
266 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
266 hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
267 hg unbundle .hg/strip-backup/*
267 hg unbundle .hg/strip-backup/*
268
268
269 echo % strip with local changes, should complain
269 echo % strip with local changes, should complain
270 hg up
270 hg up
271 echo y>y
271 echo y>y
272 hg add y
272 hg add y
273 hg strip tip | sed 's/\(saving bundle to \).*/\1/'
273 hg strip tip | sed 's/\(saving bundle to \).*/\1/'
274 echo % --force strip with local changes
274 echo % --force strip with local changes
275 hg strip -f tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
275 hg strip -f tip 2>&1 | sed 's/\(saving bundle to \).*/\1/'
276
276
277 echo '% cd b; hg qrefresh'
277 echo '% cd b; hg qrefresh'
278 hg init refresh
278 hg init refresh
279 cd refresh
279 cd refresh
280 echo a > a
280 echo a > a
281 hg ci -Ama -d'0 0'
281 hg ci -Ama -d'0 0'
282 hg qnew -mfoo foo
282 hg qnew -mfoo foo
283 echo a >> a
283 echo a >> a
284 hg qrefresh
284 hg qrefresh
285 mkdir b
285 mkdir b
286 cd b
286 cd b
287 echo f > f
287 echo f > f
288 hg add f
288 hg add f
289 hg qrefresh
289 hg qrefresh
290 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
290 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
291 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
291 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
292 echo % hg qrefresh .
292 echo % hg qrefresh .
293 hg qrefresh .
293 hg qrefresh .
294 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
294 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
295 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
295 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" ../.hg/patches/foo
296 hg status
296 hg status
297
297
298 echo % qpush failure
298 echo % qpush failure
299 cd ..
299 cd ..
300 hg qrefresh
300 hg qrefresh
301 hg qnew -mbar bar
301 hg qnew -mbar bar
302 echo foo > foo
302 echo foo > foo
303 echo bar > bar
303 echo bar > bar
304 hg add foo bar
304 hg add foo bar
305 hg qrefresh
305 hg qrefresh
306 hg qpop -a
306 hg qpop -a
307 echo bar > foo
307 echo bar > foo
308 hg qpush -a
308 hg qpush -a
309 hg st
309 hg st
310
310
311 echo % mq tags
311 echo % mq tags
312 hg log --template '{rev} {tags}\n' -r qparent:qtip
312 hg log --template '{rev} {tags}\n' -r qparent:qtip
313
313
314 echo % bad node in status
314 echo % bad node in status
315 hg qpop
315 hg qpop
316 hg strip -qn tip
316 hg strip -qn tip
317 hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
317 hg tip 2>&1 | sed -e 's/unknown node .*/unknown node/'
318 hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
318 hg branches 2>&1 | sed -e 's/unknown node .*/unknown node/'
319 hg qpop
319 hg qpop
320
320
321 cat >>$HGRCPATH <<EOF
321 cat >>$HGRCPATH <<EOF
322 [diff]
322 [diff]
323 git = True
323 git = True
324 EOF
324 EOF
325 cd ..
325 cd ..
326 hg init git
326 hg init git
327 cd git
327 cd git
328 hg qinit
328 hg qinit
329
329
330 hg qnew -m'new file' new
330 hg qnew -m'new file' new
331 echo foo > new
331 echo foo > new
332 chmod +x new
332 chmod +x new
333 hg add new
333 hg add new
334 hg qrefresh
334 hg qrefresh
335 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
335 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
336 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
336 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/new
337
337
338 hg qnew -m'copy file' copy
338 hg qnew -m'copy file' copy
339 hg cp new copy
339 hg cp new copy
340 hg qrefresh
340 hg qrefresh
341 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
341 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
342 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
342 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" .hg/patches/copy
343
343
344 hg qpop
344 hg qpop
345 hg qpush
345 hg qpush
346 hg qdiff
346 hg qdiff
347 cat >>$HGRCPATH <<EOF
347 cat >>$HGRCPATH <<EOF
348 [diff]
348 [diff]
349 git = False
349 git = False
350 EOF
350 EOF
351 hg qdiff --git
351 hg qdiff --git
352
352
353 cd ..
353 cd ..
354 hg init slow
354 hg init slow
355 cd slow
355 cd slow
356 hg qinit
356 hg qinit
357 echo foo > foo
357 echo foo > foo
358 hg add foo
358 hg add foo
359 hg ci -m 'add foo'
359 hg ci -m 'add foo'
360 hg qnew bar
360 hg qnew bar
361 echo bar > bar
361 echo bar > bar
362 hg add bar
362 hg add bar
363 hg mv foo baz
363 hg mv foo baz
364 hg qrefresh --git
364 hg qrefresh --git
365 hg up -C 0
365 hg up -C 0
366 echo >> foo
366 echo >> foo
367 hg ci -m 'change foo'
367 hg ci -m 'change foo'
368 hg up -C 1
368 hg up -C 1
369 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
369 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
370 cat .hg/patches/bar
370 cat .hg/patches/bar
371 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
371 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
372 hg qrefresh --git
372 hg qrefresh --git
373 cat .hg/patches/bar
373 cat .hg/patches/bar
374 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
374 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
375 hg qrefresh
375 hg qrefresh
376 grep 'diff --git' .hg/patches/bar
376 grep 'diff --git' .hg/patches/bar
377
377
378 echo
378 echo
379 hg up -C 1
379 hg up -C 1
380 echo >> foo
380 echo >> foo
381 hg ci -m 'change foo again'
381 hg ci -m 'change foo again'
382 hg up -C 2
382 hg up -C 2
383 hg mv bar quux
383 hg mv bar quux
384 hg mv baz bleh
384 hg mv baz bleh
385 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
385 hg qrefresh --git 2>&1 | grep -v 'saving bundle'
386 cat .hg/patches/bar
386 cat .hg/patches/bar
387 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
387 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
388 hg mv quux fred
388 hg mv quux fred
389 hg mv bleh barney
389 hg mv bleh barney
390 hg qrefresh --git
390 hg qrefresh --git
391 cat .hg/patches/bar
391 cat .hg/patches/bar
392 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
392 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
393
393
394 echo % refresh omitting an added file
394 echo % refresh omitting an added file
395 hg qnew baz
395 hg qnew baz
396 echo newfile > newfile
396 echo newfile > newfile
397 hg add newfile
397 hg add newfile
398 hg qrefresh
398 hg qrefresh
399 hg st -A newfile
399 hg st -A newfile
400 hg qrefresh -X newfile
400 hg qrefresh -X newfile
401 hg st -A newfile
401 hg st -A newfile
402 hg revert newfile
402 hg revert newfile
403 rm newfile
403 rm newfile
404 hg qpop
404 hg qpop
405 hg qdel baz
405 hg qdel baz
406
406
407 echo % create a git patch
407 echo % create a git patch
408 echo a > alexander
408 echo a > alexander
409 hg add alexander
409 hg add alexander
410 hg qnew -f --git addalexander
410 hg qnew -f --git addalexander
411 grep diff .hg/patches/addalexander
411 grep diff .hg/patches/addalexander
412
412
413 echo % create a git binary patch
413 echo % create a git binary patch
414 cat > writebin.py <<EOF
414 cat > writebin.py <<EOF
415 import sys
415 import sys
416 path = sys.argv[1]
416 path = sys.argv[1]
417 open(path, 'wb').write('BIN\x00ARY')
417 open(path, 'wb').write('BIN\x00ARY')
418 EOF
418 EOF
419 python writebin.py bucephalus
419 python writebin.py bucephalus
420
420
421 python "$TESTDIR/md5sum.py" bucephalus
421 python "$TESTDIR/md5sum.py" bucephalus
422 hg add bucephalus
422 hg add bucephalus
423 hg qnew -f --git addbucephalus
423 hg qnew -f --git addbucephalus
424 grep diff .hg/patches/addbucephalus
424 grep diff .hg/patches/addbucephalus
425
425
426 echo % check binary patches can be popped and pushed
426 echo % check binary patches can be popped and pushed
427 hg qpop
427 hg qpop
428 test -f bucephalus && echo % bucephalus should not be there
428 test -f bucephalus && echo % bucephalus should not be there
429 hg qpush
429 hg qpush
430 test -f bucephalus || echo % bucephalus should be there
430 test -f bucephalus || echo % bucephalus should be there
431 python "$TESTDIR/md5sum.py" bucephalus
431 python "$TESTDIR/md5sum.py" bucephalus
432
432
433
433
434 echo '% strip again'
434 echo '% strip again'
435 cd ..
435 cd ..
436 hg init strip
436 hg init strip
437 cd strip
437 cd strip
438 touch foo
438 touch foo
439 hg add foo
439 hg add foo
440 hg ci -m 'add foo' -d '0 0'
440 hg ci -m 'add foo' -d '0 0'
441 echo >> foo
441 echo >> foo
442 hg ci -m 'change foo 1' -d '0 0'
442 hg ci -m 'change foo 1' -d '0 0'
443 hg up -C 0
443 hg up -C 0
444 echo 1 >> foo
444 echo 1 >> foo
445 hg ci -m 'change foo 2' -d '0 0'
445 hg ci -m 'change foo 2' -d '0 0'
446 HGMERGE=true hg merge
446 HGMERGE=true hg merge
447 hg ci -m merge -d '0 0'
447 hg ci -m merge -d '0 0'
448 hg log
448 hg log
449 hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
449 hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/'
450 checkundo strip
450 checkundo strip
451 hg log
451 hg log
452 cd ..
452 cd ..
453
453
454 echo '% qclone'
454 echo '% qclone'
455 qlog()
455 qlog()
456 {
456 {
457 echo 'main repo:'
457 echo 'main repo:'
458 hg log --template ' rev {rev}: {desc}\n'
458 hg log --template ' rev {rev}: {desc}\n'
459 echo 'patch repo:'
459 echo 'patch repo:'
460 hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
460 hg -R .hg/patches log --template ' rev {rev}: {desc}\n'
461 }
461 }
462 hg init qclonesource
462 hg init qclonesource
463 cd qclonesource
463 cd qclonesource
464 echo foo > foo
464 echo foo > foo
465 hg add foo
465 hg add foo
466 hg ci -m 'add foo'
466 hg ci -m 'add foo'
467 hg qinit
467 hg qinit
468 hg qnew patch1
468 hg qnew patch1
469 echo bar >> foo
469 echo bar >> foo
470 hg qrefresh -m 'change foo'
470 hg qrefresh -m 'change foo'
471 cd ..
471 cd ..
472
472
473 # repo with unversioned patch dir
473 # repo with unversioned patch dir
474 hg qclone qclonesource failure
474 hg qclone qclonesource failure
475
475
476 cd qclonesource
476 cd qclonesource
477 hg qinit -c
477 hg qinit -c
478 hg qci -m checkpoint
478 hg qci -m checkpoint
479 qlog
479 qlog
480 cd ..
480 cd ..
481
481
482 # repo with patches applied
482 # repo with patches applied
483 hg qclone qclonesource qclonedest
483 hg qclone qclonesource qclonedest
484 cd qclonedest
484 cd qclonedest
485 qlog
485 qlog
486 cd ..
486 cd ..
487
487
488 # repo with patches unapplied
488 # repo with patches unapplied
489 cd qclonesource
489 cd qclonesource
490 hg qpop -a
490 hg qpop -a
491 qlog
491 qlog
492 cd ..
492 cd ..
493 hg qclone qclonesource qclonedest2
493 hg qclone qclonesource qclonedest2
494 cd qclonedest2
494 cd qclonedest2
495 qlog
495 qlog
496 cd ..
496 cd ..
497
497
498 echo % 'test applying on an empty file (issue 1033)'
498 echo % 'test applying on an empty file (issue 1033)'
499 hg init empty
499 hg init empty
500 cd empty
500 cd empty
501 touch a
501 touch a
502 hg ci -Am addempty
502 hg ci -Am addempty
503 echo a > a
503 echo a > a
504 hg qnew -f -e changea
504 hg qnew -f -e changea
505 hg qpop
505 hg qpop
506 hg qpush
506 hg qpush
507 cd ..
507 cd ..
508
508
509 echo % test qpush with --force, issue1087
509 echo % test qpush with --force, issue1087
510 hg init forcepush
510 hg init forcepush
511 cd forcepush
511 cd forcepush
512 echo hello > hello.txt
512 echo hello > hello.txt
513 echo bye > bye.txt
513 echo bye > bye.txt
514 hg ci -Ama
514 hg ci -Ama
515 hg qnew -d '0 0' empty
515 hg qnew -d '0 0' empty
516 hg qpop
516 hg qpop
517 echo world >> hello.txt
517 echo world >> hello.txt
518
518
519 echo % qpush should fail, local changes
519 echo % qpush should fail, local changes
520 hg qpush
520 hg qpush
521
521
522 echo % apply force, should not discard changes with empty patch
522 echo % apply force, should not discard changes with empty patch
523 hg qpush -f
523 hg qpush -f 2>&1 | sed 's,^.*/patch,patch,g'
524 hg diff --config diff.nodates=True
524 hg diff --config diff.nodates=True
525 hg qdiff --config diff.nodates=True
525 hg qdiff --config diff.nodates=True
526 hg log -l1 -p
526 hg log -l1 -p
527 hg qref -d '0 0'
527 hg qref -d '0 0'
528 hg qpop
528 hg qpop
529 echo universe >> hello.txt
529 echo universe >> hello.txt
530 echo universe >> bye.txt
530 echo universe >> bye.txt
531
531
532 echo % qpush should fail, local changes
532 echo % qpush should fail, local changes
533 hg qpush
533 hg qpush
534
534
535 echo % apply force, should discard changes in hello, but not bye
535 echo % apply force, should discard changes in hello, but not bye
536 hg qpush -f
536 hg qpush -f
537 hg st
537 hg st
538 hg diff --config diff.nodates=True
538 hg diff --config diff.nodates=True
539 hg qdiff --config diff.nodates=True
539 hg qdiff --config diff.nodates=True
@@ -1,554 +1,554 b''
1 % help
1 % help
2 mq extension - patch management and development
2 mq extension - patch management and development
3
3
4 This extension lets you work with a stack of patches in a Mercurial
4 This extension lets you work with a stack of patches in a Mercurial
5 repository. It manages two stacks of patches - all known patches, and
5 repository. It manages two stacks of patches - all known patches, and
6 applied patches (subset of known patches).
6 applied patches (subset of known patches).
7
7
8 Known patches are represented as patch files in the .hg/patches
8 Known patches are represented as patch files in the .hg/patches
9 directory. Applied patches are both patch files and changesets.
9 directory. Applied patches are both patch files and changesets.
10
10
11 Common tasks (use "hg help command" for more details):
11 Common tasks (use "hg help command" for more details):
12
12
13 prepare repository to work with patches qinit
13 prepare repository to work with patches qinit
14 create new patch qnew
14 create new patch qnew
15 import existing patch qimport
15 import existing patch qimport
16
16
17 print patch series qseries
17 print patch series qseries
18 print applied patches qapplied
18 print applied patches qapplied
19 print name of top applied patch qtop
19 print name of top applied patch qtop
20
20
21 add known patch to applied stack qpush
21 add known patch to applied stack qpush
22 remove patch from applied stack qpop
22 remove patch from applied stack qpop
23 refresh contents of top applied patch qrefresh
23 refresh contents of top applied patch qrefresh
24
24
25 list of commands:
25 list of commands:
26
26
27 qapplied print the patches already applied
27 qapplied print the patches already applied
28 qclone clone main and patch repository at same time
28 qclone clone main and patch repository at same time
29 qcommit commit changes in the queue repository
29 qcommit commit changes in the queue repository
30 qdelete remove patches from queue
30 qdelete remove patches from queue
31 qdiff diff of the current patch and subsequent modifications
31 qdiff diff of the current patch and subsequent modifications
32 qfinish move applied patches into repository history
32 qfinish move applied patches into repository history
33 qfold fold the named patches into the current patch
33 qfold fold the named patches into the current patch
34 qgoto push or pop patches until named patch is at top of stack
34 qgoto push or pop patches until named patch is at top of stack
35 qguard set or print guards for a patch
35 qguard set or print guards for a patch
36 qheader Print the header of the topmost or specified patch
36 qheader Print the header of the topmost or specified patch
37 qimport import a patch
37 qimport import a patch
38 qinit init a new queue repository
38 qinit init a new queue repository
39 qnew create a new patch
39 qnew create a new patch
40 qnext print the name of the next patch
40 qnext print the name of the next patch
41 qpop pop the current patch off the stack
41 qpop pop the current patch off the stack
42 qprev print the name of the previous patch
42 qprev print the name of the previous patch
43 qpush push the next patch onto the stack
43 qpush push the next patch onto the stack
44 qrefresh update the current patch
44 qrefresh update the current patch
45 qrename rename a patch
45 qrename rename a patch
46 qrestore restore the queue state saved by a rev
46 qrestore restore the queue state saved by a rev
47 qsave save current queue state
47 qsave save current queue state
48 qselect set or print guarded patches to push
48 qselect set or print guarded patches to push
49 qseries print the entire series file
49 qseries print the entire series file
50 qtop print the name of the current patch
50 qtop print the name of the current patch
51 qunapplied print the patches not yet applied
51 qunapplied print the patches not yet applied
52 strip strip a revision and all its descendants from the repository
52 strip strip a revision and all its descendants from the repository
53
53
54 use "hg -v help mq" to show aliases and global options
54 use "hg -v help mq" to show aliases and global options
55 adding a
55 adding a
56 updating working directory
56 updating working directory
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 adding b/z
58 adding b/z
59 % qinit
59 % qinit
60 % -R qinit
60 % -R qinit
61 % qinit -c
61 % qinit -c
62 A .hgignore
62 A .hgignore
63 A series
63 A series
64 % qnew should refuse bad patch names
64 % qnew should refuse bad patch names
65 abort: "series" cannot be used as the name of a patch
65 abort: "series" cannot be used as the name of a patch
66 abort: "status" cannot be used as the name of a patch
66 abort: "status" cannot be used as the name of a patch
67 abort: "guards" cannot be used as the name of a patch
67 abort: "guards" cannot be used as the name of a patch
68 abort: ".hgignore" cannot be used as the name of a patch
68 abort: ".hgignore" cannot be used as the name of a patch
69 % qnew implies add
69 % qnew implies add
70 A .hgignore
70 A .hgignore
71 A series
71 A series
72 A test.patch
72 A test.patch
73 % qinit; qinit -c
73 % qinit; qinit -c
74 .hgignore:
74 .hgignore:
75 ^\.hg
75 ^\.hg
76 ^\.mq
76 ^\.mq
77 syntax: glob
77 syntax: glob
78 status
78 status
79 guards
79 guards
80 series:
80 series:
81 abort: repository already exists!
81 abort: repository already exists!
82 % qinit; <stuff>; qinit -c
82 % qinit; <stuff>; qinit -c
83 adding .hg/patches/A
83 adding .hg/patches/A
84 adding .hg/patches/B
84 adding .hg/patches/B
85 A .hgignore
85 A .hgignore
86 A A
86 A A
87 A B
87 A B
88 A series
88 A series
89 .hgignore:
89 .hgignore:
90 status
90 status
91 bleh
91 bleh
92 series:
92 series:
93 A
93 A
94 B
94 B
95 % qnew with uncommitted changes
95 % qnew with uncommitted changes
96 abort: local changes found, refresh first
96 abort: local changes found, refresh first
97 A somefile
97 A somefile
98 % qnew with uncommitted changes and missing file (issue 803)
98 % qnew with uncommitted changes and missing file (issue 803)
99 someotherfile: No such file or directory
99 someotherfile: No such file or directory
100 someotherfile: No such file or directory
100 someotherfile: No such file or directory
101 A somefile
101 A somefile
102 issue803.patch
102 issue803.patch
103 Patch queue now empty
103 Patch queue now empty
104 % qnew -m
104 % qnew -m
105 foo bar
105 foo bar
106 % qrefresh
106 % qrefresh
107 foo bar
107 foo bar
108
108
109 diff -r xa
109 diff -r xa
110 --- a/a
110 --- a/a
111 +++ b/a
111 +++ b/a
112 @@ -1,1 +1,2 @@
112 @@ -1,1 +1,2 @@
113 a
113 a
114 +a
114 +a
115 % empty qrefresh
115 % empty qrefresh
116 revision:
116 revision:
117 patch:
117 patch:
118 foo bar
118 foo bar
119
119
120 working dir diff:
120 working dir diff:
121 --- a/a
121 --- a/a
122 +++ b/a
122 +++ b/a
123 @@ -1,1 +1,2 @@
123 @@ -1,1 +1,2 @@
124 a
124 a
125 +a
125 +a
126 % qpop
126 % qpop
127 Patch queue now empty
127 Patch queue now empty
128 % qpush
128 % qpush
129 applying test.patch
129 applying test.patch
130 Now at: test.patch
130 Now at: test.patch
131 % pop/push outside repo
131 % pop/push outside repo
132 Patch queue now empty
132 Patch queue now empty
133 applying test.patch
133 applying test.patch
134 Now at: test.patch
134 Now at: test.patch
135 % qrefresh in subdir
135 % qrefresh in subdir
136 % pop/push -a in subdir
136 % pop/push -a in subdir
137 Patch queue now empty
137 Patch queue now empty
138 applying test.patch
138 applying test.patch
139 applying test2.patch
139 applying test2.patch
140 Now at: test2.patch
140 Now at: test2.patch
141 % qseries
141 % qseries
142 test.patch
142 test.patch
143 test2.patch
143 test2.patch
144 Now at: test.patch
144 Now at: test.patch
145 0 A test.patch: foo bar
145 0 A test.patch: foo bar
146 1 U test2.patch:
146 1 U test2.patch:
147 applying test2.patch
147 applying test2.patch
148 Now at: test2.patch
148 Now at: test2.patch
149 % qapplied
149 % qapplied
150 test.patch
150 test.patch
151 test2.patch
151 test2.patch
152 % qtop
152 % qtop
153 test2.patch
153 test2.patch
154 % qprev
154 % qprev
155 test.patch
155 test.patch
156 % qnext
156 % qnext
157 All patches applied
157 All patches applied
158 % pop, qnext, qprev, qapplied
158 % pop, qnext, qprev, qapplied
159 Now at: test.patch
159 Now at: test.patch
160 test2.patch
160 test2.patch
161 Only one patch applied
161 Only one patch applied
162 test.patch
162 test.patch
163 % commit should fail
163 % commit should fail
164 abort: cannot commit over an applied mq patch
164 abort: cannot commit over an applied mq patch
165 % push should fail
165 % push should fail
166 pushing to ../../k
166 pushing to ../../k
167 abort: source has mq patches applied
167 abort: source has mq patches applied
168 % qunapplied
168 % qunapplied
169 test2.patch
169 test2.patch
170 % qpush/qpop with index
170 % qpush/qpop with index
171 applying test2.patch
171 applying test2.patch
172 Now at: test2.patch
172 Now at: test2.patch
173 Now at: test.patch
173 Now at: test.patch
174 applying test1b.patch
174 applying test1b.patch
175 Now at: test1b.patch
175 Now at: test1b.patch
176 applying test2.patch
176 applying test2.patch
177 Now at: test2.patch
177 Now at: test2.patch
178 Now at: test1b.patch
178 Now at: test1b.patch
179 Now at: test.patch
179 Now at: test.patch
180 applying test1b.patch
180 applying test1b.patch
181 applying test2.patch
181 applying test2.patch
182 Now at: test2.patch
182 Now at: test2.patch
183 % push should succeed
183 % push should succeed
184 Patch queue now empty
184 Patch queue now empty
185 pushing to ../../k
185 pushing to ../../k
186 searching for changes
186 searching for changes
187 adding changesets
187 adding changesets
188 adding manifests
188 adding manifests
189 adding file changes
189 adding file changes
190 added 1 changesets with 1 changes to 1 files
190 added 1 changesets with 1 changes to 1 files
191 % qpush/qpop error codes
191 % qpush/qpop error codes
192 applying test.patch
192 applying test.patch
193 applying test1b.patch
193 applying test1b.patch
194 applying test2.patch
194 applying test2.patch
195 Now at: test2.patch
195 Now at: test2.patch
196 % pops all patches and succeeds
196 % pops all patches and succeeds
197 Patch queue now empty
197 Patch queue now empty
198 qpop -a succeeds
198 qpop -a succeeds
199 % does nothing and succeeds
199 % does nothing and succeeds
200 no patches applied
200 no patches applied
201 qpop -a succeeds
201 qpop -a succeeds
202 % fails - nothing else to pop
202 % fails - nothing else to pop
203 no patches applied
203 no patches applied
204 qpop fails
204 qpop fails
205 % pushes a patch and succeeds
205 % pushes a patch and succeeds
206 applying test.patch
206 applying test.patch
207 Now at: test.patch
207 Now at: test.patch
208 qpush succeeds
208 qpush succeeds
209 % pops a patch and succeeds
209 % pops a patch and succeeds
210 Patch queue now empty
210 Patch queue now empty
211 qpop succeeds
211 qpop succeeds
212 % pushes up to test1b.patch and succeeds
212 % pushes up to test1b.patch and succeeds
213 applying test.patch
213 applying test.patch
214 applying test1b.patch
214 applying test1b.patch
215 Now at: test1b.patch
215 Now at: test1b.patch
216 qpush test1b.patch succeeds
216 qpush test1b.patch succeeds
217 % does nothing and succeeds
217 % does nothing and succeeds
218 qpush: test1b.patch is already at the top
218 qpush: test1b.patch is already at the top
219 qpush test1b.patch succeeds
219 qpush test1b.patch succeeds
220 % does nothing and succeeds
220 % does nothing and succeeds
221 qpop: test1b.patch is already at the top
221 qpop: test1b.patch is already at the top
222 qpop test1b.patch succeeds
222 qpop test1b.patch succeeds
223 % fails - can't push to this patch
223 % fails - can't push to this patch
224 abort: cannot push to a previous patch: test.patch
224 abort: cannot push to a previous patch: test.patch
225 qpush test.patch fails
225 qpush test.patch fails
226 % fails - can't pop to this patch
226 % fails - can't pop to this patch
227 abort: patch test2.patch is not applied
227 abort: patch test2.patch is not applied
228 qpop test2.patch fails
228 qpop test2.patch fails
229 % pops up to test.patch and succeeds
229 % pops up to test.patch and succeeds
230 Now at: test.patch
230 Now at: test.patch
231 qpop test.patch succeeds
231 qpop test.patch succeeds
232 % pushes all patches and succeeds
232 % pushes all patches and succeeds
233 applying test1b.patch
233 applying test1b.patch
234 applying test2.patch
234 applying test2.patch
235 Now at: test2.patch
235 Now at: test2.patch
236 qpush -a succeeds
236 qpush -a succeeds
237 % does nothing and succeeds
237 % does nothing and succeeds
238 all patches are currently applied
238 all patches are currently applied
239 qpush -a succeeds
239 qpush -a succeeds
240 % fails - nothing else to push
240 % fails - nothing else to push
241 patch series already fully applied
241 patch series already fully applied
242 qpush fails
242 qpush fails
243 % does nothing and succeeds
243 % does nothing and succeeds
244 all patches are currently applied
244 all patches are currently applied
245 qpush test2.patch succeeds
245 qpush test2.patch succeeds
246 % strip
246 % strip
247 adding x
247 adding x
248 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
248 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
249 saving bundle to
249 saving bundle to
250 adding changesets
250 adding changesets
251 adding manifests
251 adding manifests
252 adding file changes
252 adding file changes
253 added 1 changesets with 1 changes to 1 files
253 added 1 changesets with 1 changes to 1 files
254 (run 'hg update' to get a working copy)
254 (run 'hg update' to get a working copy)
255 % strip with local changes, should complain
255 % strip with local changes, should complain
256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 abort: local changes found
257 abort: local changes found
258 % --force strip with local changes
258 % --force strip with local changes
259 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
259 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
260 saving bundle to
260 saving bundle to
261 % cd b; hg qrefresh
261 % cd b; hg qrefresh
262 adding a
262 adding a
263 foo
263 foo
264
264
265 diff -r cb9a9f314b8b a
265 diff -r cb9a9f314b8b a
266 --- a/a
266 --- a/a
267 +++ b/a
267 +++ b/a
268 @@ -1,1 +1,2 @@
268 @@ -1,1 +1,2 @@
269 a
269 a
270 +a
270 +a
271 diff -r cb9a9f314b8b b/f
271 diff -r cb9a9f314b8b b/f
272 --- /dev/null
272 --- /dev/null
273 +++ b/b/f
273 +++ b/b/f
274 @@ -0,0 +1,1 @@
274 @@ -0,0 +1,1 @@
275 +f
275 +f
276 % hg qrefresh .
276 % hg qrefresh .
277 foo
277 foo
278
278
279 diff -r cb9a9f314b8b b/f
279 diff -r cb9a9f314b8b b/f
280 --- /dev/null
280 --- /dev/null
281 +++ b/b/f
281 +++ b/b/f
282 @@ -0,0 +1,1 @@
282 @@ -0,0 +1,1 @@
283 +f
283 +f
284 M a
284 M a
285 % qpush failure
285 % qpush failure
286 Patch queue now empty
286 Patch queue now empty
287 applying foo
287 applying foo
288 applying bar
288 applying bar
289 file foo already exists
289 file foo already exists
290 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
290 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
291 patch failed, unable to continue (try -v)
291 patch failed, unable to continue (try -v)
292 patch failed, rejects left in working dir
292 patch failed, rejects left in working dir
293 Errors during apply, please fix and refresh bar
293 Errors during apply, please fix and refresh bar
294 ? foo
294 ? foo
295 ? foo.rej
295 ? foo.rej
296 % mq tags
296 % mq tags
297 0 qparent
297 0 qparent
298 1 qbase foo
298 1 qbase foo
299 2 qtip bar tip
299 2 qtip bar tip
300 % bad node in status
300 % bad node in status
301 Now at: foo
301 Now at: foo
302 changeset: 0:cb9a9f314b8b
302 changeset: 0:cb9a9f314b8b
303 mq status file refers to unknown node
303 mq status file refers to unknown node
304 tag: tip
304 tag: tip
305 user: test
305 user: test
306 date: Thu Jan 01 00:00:00 1970 +0000
306 date: Thu Jan 01 00:00:00 1970 +0000
307 summary: a
307 summary: a
308
308
309 mq status file refers to unknown node
309 mq status file refers to unknown node
310 default 0:cb9a9f314b8b
310 default 0:cb9a9f314b8b
311 abort: working directory revision is not qtip
311 abort: working directory revision is not qtip
312 new file
312 new file
313
313
314 diff --git a/new b/new
314 diff --git a/new b/new
315 new file mode 100755
315 new file mode 100755
316 --- /dev/null
316 --- /dev/null
317 +++ b/new
317 +++ b/new
318 @@ -0,0 +1,1 @@
318 @@ -0,0 +1,1 @@
319 +foo
319 +foo
320 copy file
320 copy file
321
321
322 diff --git a/new b/copy
322 diff --git a/new b/copy
323 copy from new
323 copy from new
324 copy to copy
324 copy to copy
325 Now at: new
325 Now at: new
326 applying copy
326 applying copy
327 Now at: copy
327 Now at: copy
328 diff --git a/new b/copy
328 diff --git a/new b/copy
329 copy from new
329 copy from new
330 copy to copy
330 copy to copy
331 diff --git a/new b/copy
331 diff --git a/new b/copy
332 copy from new
332 copy from new
333 copy to copy
333 copy to copy
334 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
334 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
335 created new head
335 created new head
336 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
336 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
337 adding branch
337 adding branch
338 adding changesets
338 adding changesets
339 adding manifests
339 adding manifests
340 adding file changes
340 adding file changes
341 added 1 changesets with 1 changes to 1 files
341 added 1 changesets with 1 changes to 1 files
342 Patch queue now empty
342 Patch queue now empty
343 (working directory not at tip)
343 (working directory not at tip)
344 applying bar
344 applying bar
345 Now at: bar
345 Now at: bar
346 diff --git a/bar b/bar
346 diff --git a/bar b/bar
347 new file mode 100644
347 new file mode 100644
348 --- /dev/null
348 --- /dev/null
349 +++ b/bar
349 +++ b/bar
350 @@ -0,0 +1,1 @@
350 @@ -0,0 +1,1 @@
351 +bar
351 +bar
352 diff --git a/foo b/baz
352 diff --git a/foo b/baz
353 rename from foo
353 rename from foo
354 rename to baz
354 rename to baz
355 2 baz (foo)
355 2 baz (foo)
356 diff --git a/bar b/bar
356 diff --git a/bar b/bar
357 new file mode 100644
357 new file mode 100644
358 --- /dev/null
358 --- /dev/null
359 +++ b/bar
359 +++ b/bar
360 @@ -0,0 +1,1 @@
360 @@ -0,0 +1,1 @@
361 +bar
361 +bar
362 diff --git a/foo b/baz
362 diff --git a/foo b/baz
363 rename from foo
363 rename from foo
364 rename to baz
364 rename to baz
365 2 baz (foo)
365 2 baz (foo)
366 diff --git a/bar b/bar
366 diff --git a/bar b/bar
367 diff --git a/foo b/baz
367 diff --git a/foo b/baz
368
368
369 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
369 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
370 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
370 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
371 adding branch
371 adding branch
372 adding changesets
372 adding changesets
373 adding manifests
373 adding manifests
374 adding file changes
374 adding file changes
375 added 1 changesets with 1 changes to 1 files
375 added 1 changesets with 1 changes to 1 files
376 Patch queue now empty
376 Patch queue now empty
377 (working directory not at tip)
377 (working directory not at tip)
378 applying bar
378 applying bar
379 Now at: bar
379 Now at: bar
380 diff --git a/foo b/bleh
380 diff --git a/foo b/bleh
381 rename from foo
381 rename from foo
382 rename to bleh
382 rename to bleh
383 diff --git a/quux b/quux
383 diff --git a/quux b/quux
384 new file mode 100644
384 new file mode 100644
385 --- /dev/null
385 --- /dev/null
386 +++ b/quux
386 +++ b/quux
387 @@ -0,0 +1,1 @@
387 @@ -0,0 +1,1 @@
388 +bar
388 +bar
389 3 bleh (foo)
389 3 bleh (foo)
390 diff --git a/foo b/barney
390 diff --git a/foo b/barney
391 rename from foo
391 rename from foo
392 rename to barney
392 rename to barney
393 diff --git a/fred b/fred
393 diff --git a/fred b/fred
394 new file mode 100644
394 new file mode 100644
395 --- /dev/null
395 --- /dev/null
396 +++ b/fred
396 +++ b/fred
397 @@ -0,0 +1,1 @@
397 @@ -0,0 +1,1 @@
398 +bar
398 +bar
399 3 barney (foo)
399 3 barney (foo)
400 % refresh omitting an added file
400 % refresh omitting an added file
401 C newfile
401 C newfile
402 A newfile
402 A newfile
403 Now at: bar
403 Now at: bar
404 % create a git patch
404 % create a git patch
405 diff --git a/alexander b/alexander
405 diff --git a/alexander b/alexander
406 % create a git binary patch
406 % create a git binary patch
407 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
407 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
408 diff --git a/bucephalus b/bucephalus
408 diff --git a/bucephalus b/bucephalus
409 % check binary patches can be popped and pushed
409 % check binary patches can be popped and pushed
410 Now at: addalexander
410 Now at: addalexander
411 applying addbucephalus
411 applying addbucephalus
412 Now at: addbucephalus
412 Now at: addbucephalus
413 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
413 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus
414 % strip again
414 % strip again
415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 created new head
416 created new head
417 merging foo
417 merging foo
418 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
418 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
419 (branch merge, don't forget to commit)
419 (branch merge, don't forget to commit)
420 changeset: 3:99615015637b
420 changeset: 3:99615015637b
421 tag: tip
421 tag: tip
422 parent: 2:20cbbe65cff7
422 parent: 2:20cbbe65cff7
423 parent: 1:d2871fc282d4
423 parent: 1:d2871fc282d4
424 user: test
424 user: test
425 date: Thu Jan 01 00:00:00 1970 +0000
425 date: Thu Jan 01 00:00:00 1970 +0000
426 summary: merge
426 summary: merge
427
427
428 changeset: 2:20cbbe65cff7
428 changeset: 2:20cbbe65cff7
429 parent: 0:53245c60e682
429 parent: 0:53245c60e682
430 user: test
430 user: test
431 date: Thu Jan 01 00:00:00 1970 +0000
431 date: Thu Jan 01 00:00:00 1970 +0000
432 summary: change foo 2
432 summary: change foo 2
433
433
434 changeset: 1:d2871fc282d4
434 changeset: 1:d2871fc282d4
435 user: test
435 user: test
436 date: Thu Jan 01 00:00:00 1970 +0000
436 date: Thu Jan 01 00:00:00 1970 +0000
437 summary: change foo 1
437 summary: change foo 1
438
438
439 changeset: 0:53245c60e682
439 changeset: 0:53245c60e682
440 user: test
440 user: test
441 date: Thu Jan 01 00:00:00 1970 +0000
441 date: Thu Jan 01 00:00:00 1970 +0000
442 summary: add foo
442 summary: add foo
443
443
444 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
444 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
445 saving bundle to
445 saving bundle to
446 saving bundle to
446 saving bundle to
447 adding branch
447 adding branch
448 adding changesets
448 adding changesets
449 adding manifests
449 adding manifests
450 adding file changes
450 adding file changes
451 added 1 changesets with 1 changes to 1 files
451 added 1 changesets with 1 changes to 1 files
452 changeset: 1:20cbbe65cff7
452 changeset: 1:20cbbe65cff7
453 tag: tip
453 tag: tip
454 user: test
454 user: test
455 date: Thu Jan 01 00:00:00 1970 +0000
455 date: Thu Jan 01 00:00:00 1970 +0000
456 summary: change foo 2
456 summary: change foo 2
457
457
458 changeset: 0:53245c60e682
458 changeset: 0:53245c60e682
459 user: test
459 user: test
460 date: Thu Jan 01 00:00:00 1970 +0000
460 date: Thu Jan 01 00:00:00 1970 +0000
461 summary: add foo
461 summary: add foo
462
462
463 % qclone
463 % qclone
464 abort: versioned patch repository not found (see qinit -c)
464 abort: versioned patch repository not found (see qinit -c)
465 adding .hg/patches/patch1
465 adding .hg/patches/patch1
466 main repo:
466 main repo:
467 rev 1: change foo
467 rev 1: change foo
468 rev 0: add foo
468 rev 0: add foo
469 patch repo:
469 patch repo:
470 rev 0: checkpoint
470 rev 0: checkpoint
471 updating working directory
471 updating working directory
472 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
473 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
473 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 main repo:
474 main repo:
475 rev 0: add foo
475 rev 0: add foo
476 patch repo:
476 patch repo:
477 rev 0: checkpoint
477 rev 0: checkpoint
478 Patch queue now empty
478 Patch queue now empty
479 main repo:
479 main repo:
480 rev 0: add foo
480 rev 0: add foo
481 patch repo:
481 patch repo:
482 rev 0: checkpoint
482 rev 0: checkpoint
483 updating working directory
483 updating working directory
484 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
486 main repo:
486 main repo:
487 rev 0: add foo
487 rev 0: add foo
488 patch repo:
488 patch repo:
489 rev 0: checkpoint
489 rev 0: checkpoint
490 % test applying on an empty file (issue 1033)
490 % test applying on an empty file (issue 1033)
491 adding a
491 adding a
492 Patch queue now empty
492 Patch queue now empty
493 applying changea
493 applying changea
494 Now at: changea
494 Now at: changea
495 % test qpush with --force, issue1087
495 % test qpush with --force, issue1087
496 adding bye.txt
496 adding bye.txt
497 adding hello.txt
497 adding hello.txt
498 Patch queue now empty
498 Patch queue now empty
499 % qpush should fail, local changes
499 % qpush should fail, local changes
500 abort: local changes found, refresh first
500 abort: local changes found, refresh first
501 % apply force, should not discard changes with empty patch
501 % apply force, should not discard changes with empty patch
502 applying empty
502 applying empty
503 /usr/bin/patch: **** Only garbage was found in the patch input.
503 patch: **** Only garbage was found in the patch input.
504 patch failed, unable to continue (try -v)
504 patch failed, unable to continue (try -v)
505 patch empty is empty
505 patch empty is empty
506 Now at: empty
506 Now at: empty
507 diff -r bf5fc3f07a0a hello.txt
507 diff -r bf5fc3f07a0a hello.txt
508 --- a/hello.txt
508 --- a/hello.txt
509 +++ b/hello.txt
509 +++ b/hello.txt
510 @@ -1,1 +1,2 @@
510 @@ -1,1 +1,2 @@
511 hello
511 hello
512 +world
512 +world
513 diff -r 9ecee4f634e3 hello.txt
513 diff -r 9ecee4f634e3 hello.txt
514 --- a/hello.txt
514 --- a/hello.txt
515 +++ b/hello.txt
515 +++ b/hello.txt
516 @@ -1,1 +1,2 @@
516 @@ -1,1 +1,2 @@
517 hello
517 hello
518 +world
518 +world
519 changeset: 1:bf5fc3f07a0a
519 changeset: 1:bf5fc3f07a0a
520 tag: qtip
520 tag: qtip
521 tag: tip
521 tag: tip
522 tag: empty
522 tag: empty
523 tag: qbase
523 tag: qbase
524 user: test
524 user: test
525 date: Thu Jan 01 00:00:00 1970 +0000
525 date: Thu Jan 01 00:00:00 1970 +0000
526 summary: imported patch empty
526 summary: imported patch empty
527
527
528
528
529 Patch queue now empty
529 Patch queue now empty
530 % qpush should fail, local changes
530 % qpush should fail, local changes
531 abort: local changes found, refresh first
531 abort: local changes found, refresh first
532 % apply force, should discard changes in hello, but not bye
532 % apply force, should discard changes in hello, but not bye
533 applying empty
533 applying empty
534 Now at: empty
534 Now at: empty
535 M bye.txt
535 M bye.txt
536 diff -r ba252371dbc1 bye.txt
536 diff -r ba252371dbc1 bye.txt
537 --- a/bye.txt
537 --- a/bye.txt
538 +++ b/bye.txt
538 +++ b/bye.txt
539 @@ -1,1 +1,2 @@
539 @@ -1,1 +1,2 @@
540 bye
540 bye
541 +universe
541 +universe
542 diff -r 9ecee4f634e3 bye.txt
542 diff -r 9ecee4f634e3 bye.txt
543 --- a/bye.txt
543 --- a/bye.txt
544 +++ b/bye.txt
544 +++ b/bye.txt
545 @@ -1,1 +1,2 @@
545 @@ -1,1 +1,2 @@
546 bye
546 bye
547 +universe
547 +universe
548 diff -r 9ecee4f634e3 hello.txt
548 diff -r 9ecee4f634e3 hello.txt
549 --- a/hello.txt
549 --- a/hello.txt
550 +++ b/hello.txt
550 +++ b/hello.txt
551 @@ -1,1 +1,3 @@
551 @@ -1,1 +1,3 @@
552 hello
552 hello
553 +world
553 +world
554 +universe
554 +universe
General Comments 0
You need to be logged in to leave comments. Login now