##// END OF EJS Templates
bundle: include required phases when saving a bundle (issue6794)...
Jason R. Coombs , Pierre-Yves David pierre-yves.david@octobus.net -
r51206:385a4f80 default
parent child Browse files
Show More
@@ -1750,12 +1750,16 b' def _addpartsfromopts(ui, repo, bundler,'
1750 part.addparam(
1750 part.addparam(
1751 b'nbchanges', b'%d' % cg.extras[b'clcount'], mandatory=False
1751 b'nbchanges', b'%d' % cg.extras[b'clcount'], mandatory=False
1752 )
1752 )
1753 if opts.get(b'phases') and repo.revs(
1753 if opts.get(b'phases'):
1754 b'%ln and secret()', outgoing.ancestorsof
1754 target_phase = phases.draft
1755 ):
1755 for head in outgoing.ancestorsof:
1756 part.addparam(
1756 target_phase = max(target_phase, repo[head].phase())
1757 b'targetphase', b'%d' % phases.secret, mandatory=False
1757 if target_phase > phases.draft:
1758 )
1758 part.addparam(
1759 b'targetphase',
1760 b'%d' % target_phase,
1761 mandatory=False,
1762 )
1759 if repository.REPO_FEATURE_SIDE_DATA in repo.features:
1763 if repository.REPO_FEATURE_SIDE_DATA in repo.features:
1760 part.addparam(b'exp-sidedata', b'1')
1764 part.addparam(b'exp-sidedata', b'1')
1761
1765
@@ -827,10 +827,8 b' def subsetphaseheads(repo, subset):'
827 cl = repo.changelog
827 cl = repo.changelog
828
828
829 headsbyphase = {i: [] for i in allphases}
829 headsbyphase = {i: [] for i in allphases}
830 # No need to keep track of secret phase; any heads in the subset that
830 for phase in allphases:
831 # are not mentioned are implicitly secret.
831 revset = b"heads(%%ln & _phase(%d))" % phase
832 for phase in allphases[:secret]:
833 revset = b"heads(%%ln & %s())" % phasenames[phase]
834 headsbyphase[phase] = [cl.node(r) for r in repo.revs(revset, subset)]
832 headsbyphase[phase] = [cl.node(r) for r in repo.revs(revset, subset)]
835 return headsbyphase
833 return headsbyphase
836
834
@@ -44,6 +44,7 b' Set up repo with linear history'
44 cache:rev-branch-cache -- {} (mandatory: False)
44 cache:rev-branch-cache -- {} (mandatory: False)
45 phase-heads -- {} (mandatory: True)
45 phase-heads -- {} (mandatory: True)
46 26805aba1e600a82e93661149f2313866a221a7b draft
46 26805aba1e600a82e93661149f2313866a221a7b draft
47 9bc730a19041f9ec7cb33c626e811aa233efb18c secret
47 $ hg strip --no-backup C
48 $ hg strip --no-backup C
48
49
49 Phases show on incoming, and are also restored when pulling. Secret commits
50 Phases show on incoming, and are also restored when pulling. Secret commits
@@ -374,6 +375,7 b' Restore bundle of entire repo'
374 phase-heads -- {} (mandatory: True)
375 phase-heads -- {} (mandatory: True)
375 dc0947a82db884575bb76ea10ac97b08536bfa03 public
376 dc0947a82db884575bb76ea10ac97b08536bfa03 public
376 03ca77807e919db8807c3749086dc36fb478cac0 draft
377 03ca77807e919db8807c3749086dc36fb478cac0 draft
378 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4 secret
377 $ hg strip --no-backup A
379 $ hg strip --no-backup A
378 $ hg unbundle -q bundle
380 $ hg unbundle -q bundle
379 $ rm bundle
381 $ rm bundle
@@ -398,6 +400,7 b' Restore bundle of entire repo'
398 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
400 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
399 cache:rev-branch-cache -- {} (mandatory: False)
401 cache:rev-branch-cache -- {} (mandatory: False)
400 phase-heads -- {} (mandatory: True)
402 phase-heads -- {} (mandatory: True)
403 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4 secret
401 $ rm bundle
404 $ rm bundle
402
405
403 $ hg bundle --base A -r D bundle
406 $ hg bundle --base A -r D bundle
@@ -411,6 +414,7 b' Restore bundle of entire repo'
411 cache:rev-branch-cache -- {} (mandatory: False)
414 cache:rev-branch-cache -- {} (mandatory: False)
412 phase-heads -- {} (mandatory: True)
415 phase-heads -- {} (mandatory: True)
413 dc0947a82db884575bb76ea10ac97b08536bfa03 public
416 dc0947a82db884575bb76ea10ac97b08536bfa03 public
417 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4 secret
414 $ rm bundle
418 $ rm bundle
415
419
416 $ hg bundle --base 'B + C' -r 'D + E' bundle
420 $ hg bundle --base 'B + C' -r 'D + E' bundle
@@ -423,4 +427,5 b' Restore bundle of entire repo'
423 cache:rev-branch-cache -- {} (mandatory: False)
427 cache:rev-branch-cache -- {} (mandatory: False)
424 phase-heads -- {} (mandatory: True)
428 phase-heads -- {} (mandatory: True)
425 03ca77807e919db8807c3749086dc36fb478cac0 draft
429 03ca77807e919db8807c3749086dc36fb478cac0 draft
430 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4 secret
426 $ rm bundle
431 $ rm bundle
@@ -383,6 +383,7 b' unfortunate that the phase information f'
383 66e2c4b43e0cf8f0bdff0733a0b97ce57874e35d public
383 66e2c4b43e0cf8f0bdff0733a0b97ce57874e35d public
384 a8c3a1ed30eb71f03f476c5fa7ead831ef991a55 draft
384 a8c3a1ed30eb71f03f476c5fa7ead831ef991a55 draft
385 2ea90778052ba7558fab36e3fd5d149512ff986b draft
385 2ea90778052ba7558fab36e3fd5d149512ff986b draft
386 b9f5f740a8cd76700020e3903ee55ecff78bd3e5 secret
386 bzip2-v2;cg.version=03
387 bzip2-v2;cg.version=03
387
388
388 adding changesets
389 adding changesets
@@ -181,8 +181,6 b' Strips the other (lower rev-num) head'
181 The archived changeset should still be hidden
181 The archived changeset should still be hidden
182
182
183 $ hg log -G -T '{rev} {node|short} [{phase}] {desc|firstline}\n'
183 $ hg log -G -T '{rev} {node|short} [{phase}] {desc|firstline}\n'
184 o 2 f90bf4e57854 [draft] some more commit (known-bad-output !)
185 | (known-bad-output !)
186 @ 1 d1e73e428f29 [draft] unbundletesting
184 @ 1 d1e73e428f29 [draft] unbundletesting
187 |
185 |
188 o 0 c1863a3840c6 [draft] root
186 o 0 c1863a3840c6 [draft] root
@@ -191,8 +189,7 b' The archived changeset should still be h'
191 It may still be around:
189 It may still be around:
192
190
193 $ hg log --hidden -G -T '{rev} {node|short} [{phase}] {desc|firstline}\n'
191 $ hg log --hidden -G -T '{rev} {node|short} [{phase}] {desc|firstline}\n'
194 o 2 f90bf4e57854 [draft] some more commit (known-bad-output !)
192 o 2 f90bf4e57854 [archived] some more commit
195 o 2 f90bf4e57854 [archived] some more commit (missing-correct-output !)
196 |
193 |
197 @ 1 d1e73e428f29 [draft] unbundletesting
194 @ 1 d1e73e428f29 [draft] unbundletesting
198 |
195 |
General Comments 0
You need to be logged in to leave comments. Login now