##// END OF EJS Templates
bundle: prevent implicite bundling of internal changeset...
marmoute -
r51213:bcf54837 default
parent child Browse files
Show More
@@ -1703,6 +1703,7 b' def writenewbundle('
1703 1703 vfs=None,
1704 1704 compression=None,
1705 1705 compopts=None,
1706 allow_internal=False,
1706 1707 ):
1707 1708 if bundletype.startswith(b'HG10'):
1708 1709 cg = changegroup.makechangegroup(repo, outgoing, b'01', source)
@@ -1718,6 +1719,14 b' def writenewbundle('
1718 1719 elif not bundletype.startswith(b'HG20'):
1719 1720 raise error.ProgrammingError(b'unknown bundle type: %s' % bundletype)
1720 1721
1722 # enforce that no internal phase are to be bundled
1723 bundled_internal = repo.revs(b"%ln and _internal()", outgoing.ancestorsof)
1724 if bundled_internal and not allow_internal:
1725 count = len(repo.revs(b'%ln and _internal()', outgoing.missing))
1726 msg = "backup bundle would contains %d internal changesets"
1727 msg %= count
1728 raise error.ProgrammingError(msg)
1729
1721 1730 caps = {}
1722 1731 if opts.get(b'obsolescence', False):
1723 1732 caps[b'obsmarkers'] = (b'V1',)
@@ -36,7 +36,14 b' from .utils import ('
36 36
37 37
38 38 def backupbundle(
39 repo, bases, heads, node, suffix, compress=True, obsolescence=True
39 repo,
40 bases,
41 heads,
42 node,
43 suffix,
44 compress=True,
45 obsolescence=True,
46 tmp_backup=False,
40 47 ):
41 48 """create a bundle with the specified revisions as a backup"""
42 49
@@ -83,6 +90,7 b' def backupbundle('
83 90 contentopts,
84 91 vfs,
85 92 compression=comp,
93 allow_internal=tmp_backup,
86 94 )
87 95
88 96
@@ -199,6 +207,7 b' def strip(ui, repo, nodelist, backup=Tru'
199 207 b'temp',
200 208 compress=False,
201 209 obsolescence=False,
210 tmp_backup=True,
202 211 )
203 212
204 213 with ui.uninterruptible():
General Comments 0
You need to be logged in to leave comments. Login now