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