comparison hgext/mq.py @ 19856:28b1b7b9b4a9

shelve: allow shelving of a change with an mq patch applied We allow shelving of of changes on top of a MQ repository. MQ will not allow repository changes on top of applied patches. We introduce checkapplied in MQ to bypass this check.
author David Soria Parra <dsp@experimentalworks.net>
date Thu, 29 Aug 2013 09:22:15 -0700
parents 4b1cbcfdabf7
children fb583a1efef0
comparison
equal deleted inserted replaced
19855:a3b285882724 19856:28b1b7b9b4a9
345 raise error.ConfigError 345 raise error.ConfigError
346 self.gitmode = gitmode and 'yes' or 'no' 346 self.gitmode = gitmode and 'yes' or 'no'
347 except error.ConfigError: 347 except error.ConfigError:
348 self.gitmode = ui.config('mq', 'git', 'auto').lower() 348 self.gitmode = ui.config('mq', 'git', 'auto').lower()
349 self.plainmode = ui.configbool('mq', 'plain', False) 349 self.plainmode = ui.configbool('mq', 'plain', False)
350 self.checkapplied = True
350 351
351 @util.propertycache 352 @util.propertycache
352 def applied(self): 353 def applied(self):
353 def parselines(lines): 354 def parselines(lines):
354 for l in lines: 355 for l in lines:
3262 @localrepo.unfilteredpropertycache 3263 @localrepo.unfilteredpropertycache
3263 def mq(self): 3264 def mq(self):
3264 return queue(self.ui, self.baseui, self.path) 3265 return queue(self.ui, self.baseui, self.path)
3265 3266
3266 def abortifwdirpatched(self, errmsg, force=False): 3267 def abortifwdirpatched(self, errmsg, force=False):
3267 if self.mq.applied and not force: 3268 if self.mq.applied and self.mq.checkapplied and not force:
3268 parents = self.dirstate.parents() 3269 parents = self.dirstate.parents()
3269 patches = [s.node for s in self.mq.applied] 3270 patches = [s.node for s in self.mq.applied]
3270 if parents[0] in patches or parents[1] in patches: 3271 if parents[0] in patches or parents[1] in patches:
3271 raise util.Abort(errmsg) 3272 raise util.Abort(errmsg)
3272 3273
3278 3279
3279 return super(mqrepo, self).commit(text, user, date, match, force, 3280 return super(mqrepo, self).commit(text, user, date, match, force,
3280 editor, extra) 3281 editor, extra)
3281 3282
3282 def checkpush(self, force, revs): 3283 def checkpush(self, force, revs):
3283 if self.mq.applied and not force: 3284 if self.mq.applied and self.mq.checkapplied and not force:
3284 outapplied = [e.node for e in self.mq.applied] 3285 outapplied = [e.node for e in self.mq.applied]
3285 if revs: 3286 if revs:
3286 # Assume applied patches have no non-patch descendants and 3287 # Assume applied patches have no non-patch descendants and
3287 # are not on remote already. Filtering any changeset not 3288 # are not on remote already. Filtering any changeset not
3288 # pushed. 3289 # pushed.