Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 24472:1bf71faf042e
cmdutil: allow bailifchanged to ignore merging in progress
In "commands.update()", "cmdutil.bailifchanged()" isn't used for
"abort if the working directory is dirty", because it forcibly
examines about merging in progress.
"workingctx.dirty()" used in "commands.update()" can't detect changes
of largefiles in the working directory without "repo.lfstatus = True"
wrapping. This is only reason of "commands.update()" wrapping by
largefiles extension.
On the other hand, "cmdutil.bailifchanged()" already wrapped by
largefiles extension can detect changes of largefiles.
This patch is a preparations for replacing "workingctx.dirty()" and
raising Abort in "commands.update()" by "cmdutil.bailifchanged()". It
can remove redundant "commands.update()" wrapping.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 25 Mar 2015 13:55:35 +0900 |
parents | 1ff35d76421c |
children | 06cbff4674a3 |
comparison
equal
deleted
inserted
replaced
24471:1ff35d76421c | 24472:1bf71faf042e |
---|---|
272 if p == oldp: | 272 if p == oldp: |
273 return None | 273 return None |
274 | 274 |
275 return p | 275 return p |
276 | 276 |
277 def bailifchanged(repo): | 277 def bailifchanged(repo, merge=True): |
278 if repo.dirstate.p2() != nullid: | 278 if merge and repo.dirstate.p2() != nullid: |
279 raise util.Abort(_('outstanding uncommitted merge')) | 279 raise util.Abort(_('outstanding uncommitted merge')) |
280 modified, added, removed, deleted = repo.status()[:4] | 280 modified, added, removed, deleted = repo.status()[:4] |
281 if modified or added or removed or deleted: | 281 if modified or added or removed or deleted: |
282 raise util.Abort(_('uncommitted changes')) | 282 raise util.Abort(_('uncommitted changes')) |
283 ctx = repo[None] | 283 ctx = repo[None] |