Show More
@@ -16,6 +16,7 b' from .node import short' | |||
|
16 | 16 | from . import ( |
|
17 | 17 | bundle2, |
|
18 | 18 | changegroup, |
|
19 | discovery, | |
|
19 | 20 | error, |
|
20 | 21 | exchange, |
|
21 | 22 | obsolete, |
@@ -24,10 +25,7 b' from . import (' | |||
|
24 | 25 | |
|
25 | 26 | def _bundle(repo, bases, heads, node, suffix, compress=True): |
|
26 | 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 | 29 | backupdir = "strip-backup" |
|
32 | 30 | vfs = repo.vfs |
|
33 | 31 | if not vfs.isdir(backupdir): |
@@ -39,6 +37,7 b' def _bundle(repo, bases, heads, node, su' | |||
|
39 | 37 | totalhash = hashlib.sha1(''.join(allhashes)).hexdigest() |
|
40 | 38 | name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix) |
|
41 | 39 | |
|
40 | cgversion = changegroup.safeversion(repo) | |
|
42 | 41 | comp = None |
|
43 | 42 | if cgversion != '01': |
|
44 | 43 | bundletype = "HG20" |
@@ -48,8 +47,11 b' def _bundle(repo, bases, heads, node, su' | |||
|
48 | 47 | bundletype = "HG10BZ" |
|
49 | 48 | else: |
|
50 | 49 | bundletype = "HG10UN" |
|
51 | return bundle2.writebundle(repo.ui, cg, name, bundletype, vfs, | |
|
52 | compression=comp) | |
|
50 | ||
|
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 | 56 | def _collectfiles(repo, striprev): |
|
55 | 57 | """find out the filelogs affected by the strip""" |
General Comments 0
You need to be logged in to leave comments.
Login now