hgext/mq.py
changeset 14585 74bf9c84cfd0
parent 14584 3343a74eea4e
child 14586 af91cb281975
equal deleted inserted replaced
14584:3343a74eea4e 14585:74bf9c84cfd0
   911             match = scmutil.matchfiles(repo, m + a + r + inclsubs)
   911             match = scmutil.matchfiles(repo, m + a + r + inclsubs)
   912         if len(repo[None].parents()) > 1:
   912         if len(repo[None].parents()) > 1:
   913             raise util.Abort(_('cannot manage merge changesets'))
   913             raise util.Abort(_('cannot manage merge changesets'))
   914         commitfiles = m + a + r
   914         commitfiles = m + a + r
   915         self.checktoppatch(repo)
   915         self.checktoppatch(repo)
   916         insert = self.full_series_end()
   916         insert = self.fullseriesend()
   917         wlock = repo.wlock()
   917         wlock = repo.wlock()
   918         try:
   918         try:
   919             try:
   919             try:
   920                 # if patch file write fails, abort early
   920                 # if patch file write fails, abort early
   921                 p = self.opener(patchfn, "w")
   921                 p = self.opener(patchfn, "w")
  1691             return 1
  1691             return 1
  1692         self.applied.append(statusentry(n, '.hg.patches.save.line'))
  1692         self.applied.append(statusentry(n, '.hg.patches.save.line'))
  1693         self.applied_dirty = 1
  1693         self.applied_dirty = 1
  1694         self.removeundo(repo)
  1694         self.removeundo(repo)
  1695 
  1695 
  1696     def full_series_end(self):
  1696     def fullseriesend(self):
  1697         if self.applied:
  1697         if self.applied:
  1698             p = self.applied[-1].name
  1698             p = self.applied[-1].name
  1699             end = self.findseries(p)
  1699             end = self.findseries(p)
  1700             if end is None:
  1700             if end is None:
  1701                 return len(self.fullseries)
  1701                 return len(self.fullseries)
  1842                 patchf.write(text)
  1842                 patchf.write(text)
  1843                 patchf.close()
  1843                 patchf.close()
  1844             if not force:
  1844             if not force:
  1845                 checkseries(patchname)
  1845                 checkseries(patchname)
  1846             if patchname not in self.series:
  1846             if patchname not in self.series:
  1847                 index = self.full_series_end() + i
  1847                 index = self.fullseriesend() + i
  1848                 self.fullseries[index:index] = [patchname]
  1848                 self.fullseries[index:index] = [patchname]
  1849             self.parseseries()
  1849             self.parseseries()
  1850             self.series_dirty = True
  1850             self.series_dirty = True
  1851             self.ui.warn(_("adding %s to series file\n") % patchname)
  1851             self.ui.warn(_("adding %s to series file\n") % patchname)
  1852             self.added.append(patchname)
  1852             self.added.append(patchname)