comparison mercurial/subrepo.py @ 30755:0fbb3a5c188e

rebase: provide detailed hint to abort message if working dir is not clean Detailed hint message is now provided when 'pull --rebase' operation detects unclean working dir, for example: abort: uncommitted changes (cannot pull with rebase: please commit or shelve your changes first) Added tests for uncommitted merge, and for subrepo support verifying that same hint is also passed to subrepo state check.
author Valters Vingolds <valters@vingolds.ch>
date Tue, 10 Jan 2017 09:32:27 +0100
parents d524c88511a7
children b44ab288358e 2915cc1d3429
comparison
equal deleted inserted replaced
30754:26209cb7184e 30755:0fbb3a5c188e
462 """ 462 """
463 if self.dirty(ignoreupdate=ignoreupdate): 463 if self.dirty(ignoreupdate=ignoreupdate):
464 return _("uncommitted changes in subrepository '%s'" 464 return _("uncommitted changes in subrepository '%s'"
465 ) % subrelpath(self) 465 ) % subrelpath(self)
466 466
467 def bailifchanged(self, ignoreupdate=False): 467 def bailifchanged(self, ignoreupdate=False, hint=None):
468 """raise Abort if subrepository is ``dirty()`` 468 """raise Abort if subrepository is ``dirty()``
469 """ 469 """
470 dirtyreason = self.dirtyreason(ignoreupdate=ignoreupdate) 470 dirtyreason = self.dirtyreason(ignoreupdate=ignoreupdate)
471 if dirtyreason: 471 if dirtyreason:
472 raise error.Abort(dirtyreason) 472 raise error.Abort(dirtyreason, hint=hint)
473 473
474 def basestate(self): 474 def basestate(self):
475 """current working directory base state, disregarding .hgsubstate 475 """current working directory base state, disregarding .hgsubstate
476 state and working directory modifications""" 476 state and working directory modifications"""
477 raise NotImplementedError 477 raise NotImplementedError