##// END OF EJS Templates
bisect: do silent init if necessary
Benoit Boissinot -
r5319:5b6e4036 default
parent child Browse files
Show More
@@ -37,10 +37,9 b' class bisect(object):'
37 self.ui = ui
37 self.ui = ui
38 self.goodrevs = []
38 self.goodrevs = []
39 self.badrev = None
39 self.badrev = None
40 self.good_dirty = 0
41 self.bad_dirty = 0
42 self.good_path = "good"
40 self.good_path = "good"
43 self.bad_path = "bad"
41 self.bad_path = "bad"
42 self.is_reset = False
44
43
45 if os.path.exists(os.path.join(self.path, self.good_path)):
44 if os.path.exists(os.path.join(self.path, self.good_path)):
46 self.goodrevs = self.opener(self.good_path).read().splitlines()
45 self.goodrevs = self.opener(self.good_path).read().splitlines()
@@ -51,8 +50,10 b' class bisect(object):'
51 self.badrev = hg.bin(r.pop(0))
50 self.badrev = hg.bin(r.pop(0))
52
51
53 def write(self):
52 def write(self):
53 if self.is_reset:
54 return
54 if not os.path.isdir(self.path):
55 if not os.path.isdir(self.path):
55 return
56 os.mkdir(self.path)
56 f = self.opener(self.good_path, "w")
57 f = self.opener(self.good_path, "w")
57 f.write("\n".join([hg.hex(r) for r in self.goodrevs]))
58 f.write("\n".join([hg.hex(r) for r in self.goodrevs]))
58 if len(self.goodrevs) > 0:
59 if len(self.goodrevs) > 0:
@@ -81,6 +82,7 b' class bisect(object):'
81 # Not sure about this
82 # Not sure about this
82 #self.ui.write("Going back to tip\n")
83 #self.ui.write("Going back to tip\n")
83 #self.repo.update(self.repo.changelog.tip())
84 #self.repo.update(self.repo.changelog.tip())
85 self.is_reset = True
84 return 0
86 return 0
85
87
86 def num_ancestors(self, head=None, stop=None):
88 def num_ancestors(self, head=None, stop=None):
General Comments 0
You need to be logged in to leave comments. Login now