Show More
@@ -6,7 +6,8 b'' | |||||
6 | # This software may be used and distributed according to the terms |
|
6 | # This software may be used and distributed according to the terms | |
7 | # of the GNU General Public License, incorporated herein by reference. |
|
7 | # of the GNU General Public License, incorporated herein by reference. | |
8 |
|
8 | |||
9 |
import changegroup, |
|
9 | import changegroup, os | |
|
10 | from node import * | |||
10 |
|
11 | |||
11 | def strip(ui, repo, rev, backup="all"): |
|
12 | def strip(ui, repo, rev, backup="all"): | |
12 | def limitheads(chlog, stop): |
|
13 | def limitheads(chlog, stop): | |
@@ -34,7 +35,7 b' def strip(ui, repo, rev, backup="all"):' | |||||
34 | backupdir = repo.join("strip-backup") |
|
35 | backupdir = repo.join("strip-backup") | |
35 | if not os.path.isdir(backupdir): |
|
36 | if not os.path.isdir(backupdir): | |
36 | os.mkdir(backupdir) |
|
37 | os.mkdir(backupdir) | |
37 |
name = os.path.join(backupdir, "%s-%s" % ( |
|
38 | name = os.path.join(backupdir, "%s-%s" % (short(rev), suffix)) | |
38 | ui.warn("saving bundle to %s\n" % name) |
|
39 | ui.warn("saving bundle to %s\n" % name) | |
39 | return changegroup.writebundle(cg, name, "HG10BZ") |
|
40 | return changegroup.writebundle(cg, name, "HG10BZ") | |
40 |
|
41 | |||
@@ -90,11 +91,11 b' def strip(ui, repo, rev, backup="all"):' | |||||
90 | while True: |
|
91 | while True: | |
91 | seen[n] = 1 |
|
92 | seen[n] = 1 | |
92 | pp = chlog.parents(n) |
|
93 | pp = chlog.parents(n) | |
93 |
if pp[1] != |
|
94 | if pp[1] != nullid: | |
94 | for p in pp: |
|
95 | for p in pp: | |
95 | if chlog.rev(p) > revnum and p not in seen: |
|
96 | if chlog.rev(p) > revnum and p not in seen: | |
96 | heads.append(p) |
|
97 | heads.append(p) | |
97 |
if pp[0] == |
|
98 | if pp[0] == nullid: | |
98 | break |
|
99 | break | |
99 | if chlog.rev(pp[0]) < revnum: |
|
100 | if chlog.rev(pp[0]) < revnum: | |
100 | break |
|
101 | break |
General Comments 0
You need to be logged in to leave comments.
Login now