Mercurial > hg
comparison mercurial/repair.py @ 5898:52cfe86ebe55
repair.py: don't import commands.py
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 19 Jan 2008 18:01:16 -0200 |
parents | 18e91c9def0c |
children | d7388ad85511 |
comparison
equal
deleted
inserted
replaced
5897:158fa833d243 | 5898:52cfe86ebe55 |
---|---|
4 # Copyright 2007 Matt Mackall | 4 # Copyright 2007 Matt Mackall |
5 # | 5 # |
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, revlog, os, commands | 9 import changegroup, revlog, os |
10 | 10 |
11 def strip(ui, repo, rev, backup="all"): | 11 def strip(ui, repo, rev, backup="all"): |
12 def limitheads(chlog, stop): | 12 def limitheads(chlog, stop): |
13 """return the list of all nodes that have no children""" | 13 """return the list of all nodes that have no children""" |
14 p = {} | 14 p = {} |
119 change = chlog.read(rev) | 119 change = chlog.read(rev) |
120 chlog.strip(revnum, revnum) | 120 chlog.strip(revnum, revnum) |
121 repo.manifest.strip(repo.manifest.rev(change[0]), revnum) | 121 repo.manifest.strip(repo.manifest.rev(change[0]), revnum) |
122 if saveheads: | 122 if saveheads: |
123 ui.status("adding branch\n") | 123 ui.status("adding branch\n") |
124 commands.unbundle(ui, repo, "file:%s" % chgrpfile, update=False) | 124 f = open(chgrpfile, "rb") |
125 gen = changegroup.readbundle(f, chgrpfile) | |
126 repo.addchangegroup(gen, 'strip', 'bundle:' + chgrpfile) | |
127 f.close() | |
125 if backup != "strip": | 128 if backup != "strip": |
126 os.unlink(chgrpfile) | 129 os.unlink(chgrpfile) |
127 | 130 |