##// END OF EJS Templates
strip: use the 'writenewbundle' function to get bundle on disk...
marmoute -
r32468:4c4d9190 default
parent child Browse files
Show More
@@ -16,6 +16,7 b' from .node import short'
16 from . import (
16 from . import (
17 bundle2,
17 bundle2,
18 changegroup,
18 changegroup,
19 discovery,
19 error,
20 error,
20 exchange,
21 exchange,
21 obsolete,
22 obsolete,
@@ -24,10 +25,7 b' from . import ('
24
25
25 def _bundle(repo, bases, heads, node, suffix, compress=True):
26 def _bundle(repo, bases, heads, node, suffix, compress=True):
26 """create a bundle with the specified revisions as a backup"""
27 """create a bundle with the specified revisions as a backup"""
27 cgversion = changegroup.safeversion(repo)
28
28
29 cg = changegroup.changegroupsubset(repo, bases, heads, 'strip',
30 version=cgversion)
31 backupdir = "strip-backup"
29 backupdir = "strip-backup"
32 vfs = repo.vfs
30 vfs = repo.vfs
33 if not vfs.isdir(backupdir):
31 if not vfs.isdir(backupdir):
@@ -39,6 +37,7 b' def _bundle(repo, bases, heads, node, su'
39 totalhash = hashlib.sha1(''.join(allhashes)).hexdigest()
37 totalhash = hashlib.sha1(''.join(allhashes)).hexdigest()
40 name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)
38 name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix)
41
39
40 cgversion = changegroup.safeversion(repo)
42 comp = None
41 comp = None
43 if cgversion != '01':
42 if cgversion != '01':
44 bundletype = "HG20"
43 bundletype = "HG20"
@@ -48,8 +47,11 b' def _bundle(repo, bases, heads, node, su'
48 bundletype = "HG10BZ"
47 bundletype = "HG10BZ"
49 else:
48 else:
50 bundletype = "HG10UN"
49 bundletype = "HG10UN"
51 return bundle2.writebundle(repo.ui, cg, name, bundletype, vfs,
50
52 compression=comp)
51 outgoing = discovery.outgoing(repo, missingroots=bases, missingheads=heads)
52 contentopts = {'cg.version': cgversion}
53 return bundle2.writenewbundle(repo.ui, repo, 'strip', name, bundletype,
54 outgoing, contentopts, vfs, compression=comp)
53
55
54 def _collectfiles(repo, striprev):
56 def _collectfiles(repo, striprev):
55 """find out the filelogs affected by the strip"""
57 """find out the filelogs affected by the strip"""
General Comments 0
You need to be logged in to leave comments. Login now