comparison mercurial/localrepo.py @ 25114:d1d69ca78883

match: add match.ispartial() match.ispartial() will return the opposite of match.always() in core, but this function will be extensible by extensions to produce another result even if match.always() will be untouched. This will be useful for narrowhg, where ispartial() will return False even if the match won't always match. This would happen in the case where the only time the match function is False is when the path is outside of the narrow spec.
author Drew Gottlieb <drgott@google.com>
date Fri, 15 May 2015 15:43:26 -0700
parents 9a74b9919581
children 49c583ca48c4
comparison
equal deleted inserted replaced
25113:0ca8410ea345 25114:d1d69ca78883
1375 wlock = self.wlock() 1375 wlock = self.wlock()
1376 try: 1376 try:
1377 wctx = self[None] 1377 wctx = self[None]
1378 merge = len(wctx.parents()) > 1 1378 merge = len(wctx.parents()) > 1
1379 1379
1380 if not force and merge and not match.always(): 1380 if not force and merge and match.ispartial():
1381 raise util.Abort(_('cannot partially commit a merge ' 1381 raise util.Abort(_('cannot partially commit a merge '
1382 '(do not specify files or patterns)')) 1382 '(do not specify files or patterns)'))
1383 1383
1384 status = self.status(match=match, clean=force) 1384 status = self.status(match=match, clean=force)
1385 if force: 1385 if force: