##// END OF EJS Templates
mq: update subrepos when applying / unapplying patches that change .hgsubstate...
Angel Ezquerra -
r19638:20096384 default
parent child Browse files
Show More
@@ -66,6 +66,7 from mercurial import commands, cmdutil,
66 66 from mercurial import repair, extensions, error, phases
67 67 from mercurial import patch as patchmod
68 68 from mercurial import localrepo
69 from mercurial import subrepo
69 70 import os, re, errno, shutil
70 71
71 72 commands.norepo += " qclone"
@@ -800,6 +801,14 class queue(object):
800 801 p1, p2 = repo.dirstate.parents()
801 802 repo.setparents(p1, merge)
802 803
804 if all_files and '.hgsubstate' in all_files:
805 wctx = repo['.']
806 mctx = actx = repo[None]
807 overwrite = False
808 mergedsubstate = subrepo.submerge(repo, wctx, mctx, actx,
809 overwrite)
810 files += mergedsubstate.keys()
811
803 812 match = scmutil.matchfiles(repo, files or [])
804 813 oldtip = repo['tip']
805 814 n = newcommit(repo, None, message, ph.user, ph.date, match=match,
@@ -1459,6 +1468,8 class queue(object):
1459 1468 self.ui.status(_("popping %s\n") % patch.name)
1460 1469 del self.applied[start:end]
1461 1470 self.strip(repo, [rev], update=False, backup='strip')
1471 for s, state in repo['.'].substate.items():
1472 repo['.'].sub(s).get(state)
1462 1473 if self.applied:
1463 1474 self.ui.write(_("now at: %s\n") % self.applied[-1].name)
1464 1475 else:
@@ -230,6 +230,8 handle subrepos safely on qpush/qpop
230 230 $ hg -R sub commit -m foo
231 231 $ hg commit -m1
232 232 $ hg qimport -r "0:tip"
233 $ hg -R sub id --id
234 aa037b301eba
233 235
234 236 qpop
235 237 $ hg -R sub update 0000
@@ -244,13 +246,11 qpop
244 246 popping 1.diff
245 247 now at: 0.diff
246 248 $ hg status -AS
247 M sub/a
248 249 C .hgsub
249 250 C .hgsubstate
250 $ hg debugsub
251 path sub
252 source sub
253 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
251 C sub/a
252 $ hg -R sub id --id
253 b2fdb12cd82b
254 254
255 255 qpush
256 256 $ hg -R sub update 0000
@@ -263,15 +263,14 qpush
263 263 adding sub/a
264 264 $ hg qpush
265 265 applying 1.diff
266 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 267 now at: 1.diff
267 268 $ hg status -AS
268 M .hgsubstate
269 269 C .hgsub
270 C .hgsubstate
270 271 C sub/a
271 $ hg debugsub
272 path sub
273 source sub
274 revision aa037b301eba54f350c75951b5486727fb98cbb5
272 $ hg -R sub id --id
273 aa037b301eba
275 274
276 275 $ cd ..
277 276
General Comments 0
You need to be logged in to leave comments. Login now