##// END OF EJS Templates
mq: consistently use boolean values for dirty flags
Mads Kiilerich -
r15879:710e6bf1 default
parent child Browse files
Show More
@@ -267,8 +267,8 b' class queue(object):'
267 self.path = patchdir or curpath
267 self.path = patchdir or curpath
268 self.opener = scmutil.opener(self.path)
268 self.opener = scmutil.opener(self.path)
269 self.ui = ui
269 self.ui = ui
270 self.applieddirty = 0
270 self.applieddirty = False
271 self.seriesdirty = 0
271 self.seriesdirty = False
272 self.added = []
272 self.added = []
273 self.seriespath = "series"
273 self.seriespath = "series"
274 self.statuspath = "status"
274 self.statuspath = "status"
@@ -327,8 +327,8 b' class queue(object):'
327 for a in 'applied fullseries series seriesguards'.split():
327 for a in 'applied fullseries series seriesguards'.split():
328 if a in self.__dict__:
328 if a in self.__dict__:
329 delattr(self, a)
329 delattr(self, a)
330 self.applieddirty = 0
330 self.applieddirty = False
331 self.seriesdirty = 0
331 self.seriesdirty = False
332 self.guardsdirty = False
332 self.guardsdirty = False
333 self.activeguards = None
333 self.activeguards = None
334
334
@@ -593,7 +593,7 b' class queue(object):'
593 n = repo.commit('[mq]: merge marker', force=True)
593 n = repo.commit('[mq]: merge marker', force=True)
594 self.removeundo(repo)
594 self.removeundo(repo)
595 self.applied.append(statusentry(n, pname))
595 self.applied.append(statusentry(n, pname))
596 self.applieddirty = 1
596 self.applieddirty = True
597
597
598 head = self.qparents(repo)
598 head = self.qparents(repo)
599
599
@@ -614,7 +614,7 b' class queue(object):'
614 err, head = self.mergeone(repo, mergeq, head, patch, rev, diffopts)
614 err, head = self.mergeone(repo, mergeq, head, patch, rev, diffopts)
615 if head:
615 if head:
616 self.applied.append(statusentry(head, patch))
616 self.applied.append(statusentry(head, patch))
617 self.applieddirty = 1
617 self.applieddirty = True
618 if err:
618 if err:
619 return (err, head)
619 return (err, head)
620 self.savedirty()
620 self.savedirty()
@@ -749,7 +749,7 b' class queue(object):'
749 if numrevs:
749 if numrevs:
750 qfinished = self.applied[:numrevs]
750 qfinished = self.applied[:numrevs]
751 del self.applied[:numrevs]
751 del self.applied[:numrevs]
752 self.applieddirty = 1
752 self.applieddirty = True
753
753
754 unknown = []
754 unknown = []
755
755
@@ -771,7 +771,7 b' class queue(object):'
771 raise util.Abort(''.join(msg % p for p in unknown))
771 raise util.Abort(''.join(msg % p for p in unknown))
772
772
773 self.parseseries()
773 self.parseseries()
774 self.seriesdirty = 1
774 self.seriesdirty = True
775
775
776 def _revpatches(self, repo, revs):
776 def _revpatches(self, repo, revs):
777 firstrev = repo[self.applied[0].node].rev()
777 firstrev = repo[self.applied[0].node].rev()
@@ -955,8 +955,8 b' class queue(object):'
955 self.fullseries[insert:insert] = [patchfn]
955 self.fullseries[insert:insert] = [patchfn]
956 self.applied.append(statusentry(n, patchfn))
956 self.applied.append(statusentry(n, patchfn))
957 self.parseseries()
957 self.parseseries()
958 self.seriesdirty = 1
958 self.seriesdirty = True
959 self.applieddirty = 1
959 self.applieddirty = True
960 if msg:
960 if msg:
961 msg = msg + "\n\n"
961 msg = msg + "\n\n"
962 p.write(msg)
962 p.write(msg)
@@ -1165,9 +1165,9 b' class queue(object):'
1165 del self.fullseries[index]
1165 del self.fullseries[index]
1166 self.fullseries.insert(start, fullpatch)
1166 self.fullseries.insert(start, fullpatch)
1167 self.parseseries()
1167 self.parseseries()
1168 self.seriesdirty = 1
1168 self.seriesdirty = True
1169
1169
1170 self.applieddirty = 1
1170 self.applieddirty = True
1171 if start > 0:
1171 if start > 0:
1172 self.checktoppatch(repo)
1172 self.checktoppatch(repo)
1173 if not patch:
1173 if not patch:
@@ -1260,7 +1260,7 b' class queue(object):'
1260 if not force and update:
1260 if not force and update:
1261 self.checklocalchanges(repo)
1261 self.checklocalchanges(repo)
1262
1262
1263 self.applieddirty = 1
1263 self.applieddirty = True
1264 end = len(self.applied)
1264 end = len(self.applied)
1265 rev = self.applied[start].node
1265 rev = self.applied[start].node
1266 if update:
1266 if update:
@@ -1483,7 +1483,7 b' class queue(object):'
1483 # assumes strip can roll itself back if interrupted
1483 # assumes strip can roll itself back if interrupted
1484 repo.dirstate.setparents(*cparents)
1484 repo.dirstate.setparents(*cparents)
1485 self.applied.pop()
1485 self.applied.pop()
1486 self.applieddirty = 1
1486 self.applieddirty = True
1487 self.strip(repo, [top], update=False,
1487 self.strip(repo, [top], update=False,
1488 backup='strip')
1488 backup='strip')
1489 except:
1489 except:
@@ -1630,8 +1630,8 b' class queue(object):'
1630 self.fullseries = series
1630 self.fullseries = series
1631 self.applied = applied
1631 self.applied = applied
1632 self.parseseries()
1632 self.parseseries()
1633 self.seriesdirty = 1
1633 self.seriesdirty = True
1634 self.applieddirty = 1
1634 self.applieddirty = True
1635 heads = repo.changelog.heads()
1635 heads = repo.changelog.heads()
1636 if delete:
1636 if delete:
1637 if rev not in heads:
1637 if rev not in heads:
@@ -1679,7 +1679,7 b' class queue(object):'
1679 self.ui.warn(_("repo commit failed\n"))
1679 self.ui.warn(_("repo commit failed\n"))
1680 return 1
1680 return 1
1681 self.applied.append(statusentry(n, '.hg.patches.save.line'))
1681 self.applied.append(statusentry(n, '.hg.patches.save.line'))
1682 self.applieddirty = 1
1682 self.applieddirty = True
1683 self.removeundo(repo)
1683 self.removeundo(repo)
1684
1684
1685 def fullseriesend(self):
1685 def fullseriesend(self):
@@ -1793,7 +1793,7 b' class queue(object):'
1793 self.added.append(patchname)
1793 self.added.append(patchname)
1794 patchname = None
1794 patchname = None
1795 self.parseseries()
1795 self.parseseries()
1796 self.applieddirty = 1
1796 self.applieddirty = True
1797 self.seriesdirty = True
1797 self.seriesdirty = True
1798
1798
1799 for i, filename in enumerate(files):
1799 for i, filename in enumerate(files):
@@ -2594,12 +2594,12 b' def rename(ui, repo, patch, name=None, *'
2594 guards = q.guard_re.findall(q.fullseries[i])
2594 guards = q.guard_re.findall(q.fullseries[i])
2595 q.fullseries[i] = name + ''.join([' #' + g for g in guards])
2595 q.fullseries[i] = name + ''.join([' #' + g for g in guards])
2596 q.parseseries()
2596 q.parseseries()
2597 q.seriesdirty = 1
2597 q.seriesdirty = True
2598
2598
2599 info = q.isapplied(patch)
2599 info = q.isapplied(patch)
2600 if info:
2600 if info:
2601 q.applied[info[0]] = statusentry(info[1], name)
2601 q.applied[info[0]] = statusentry(info[1], name)
2602 q.applieddirty = 1
2602 q.applieddirty = True
2603
2603
2604 destdir = os.path.dirname(absdest)
2604 destdir = os.path.dirname(absdest)
2605 if not os.path.isdir(destdir):
2605 if not os.path.isdir(destdir):
General Comments 0
You need to be logged in to leave comments. Login now