comparison hgext/mq.py @ 2845:addd03c7fbfa

Disallow commit over an applied mq patch.
author Brendan Cully <brendan@kublai.com>
date Thu, 10 Aug 2006 11:18:48 -0700
parents 582cbc4392cb
children 307439d6fede
comparison
equal deleted inserted replaced
2844:582cbc4392cb 2845:addd03c7fbfa
1830 finally: 1830 finally:
1831 q.save_dirty() 1831 q.save_dirty()
1832 1832
1833 def reposetup(ui, repo): 1833 def reposetup(ui, repo):
1834 class mqrepo(repo.__class__): 1834 class mqrepo(repo.__class__):
1835 def commit(self, *args, **opts):
1836 if len(args) >= 6:
1837 force = args[5]
1838 else:
1839 force = opts.get('force')
1840 if self.mq.applied and not force:
1841 parent = revlog.hex(self.dirstate.parents()[0])
1842 if parent in [s.rev for s in self.mq.applied]:
1843 raise util.Abort(_('cannot commit over an applied mq patch'))
1844
1845 return super(mqrepo, self).commit(*args, **opts)
1846
1835 def tags(self): 1847 def tags(self):
1836 if self.tagscache: 1848 if self.tagscache:
1837 return self.tagscache 1849 return self.tagscache
1838 1850
1839 tagscache = super(mqrepo, self).tags() 1851 tagscache = super(mqrepo, self).tags()