Mercurial > hg
comparison hgext/largefiles/overrides.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 | 5b85a5bc5bbb |
children | 61a99993f8a7 |
comparison
equal
deleted
inserted
replaced
24471:1ff35d76421c | 24472:1bf71faf042e |
---|---|
1027 | 1027 |
1028 # If a largefile is modified, the change is not reflected in its | 1028 # If a largefile is modified, the change is not reflected in its |
1029 # standin until a commit. cmdutil.bailifchanged() raises an exception | 1029 # standin until a commit. cmdutil.bailifchanged() raises an exception |
1030 # if the repo has uncommitted changes. Wrap it to also check if | 1030 # if the repo has uncommitted changes. Wrap it to also check if |
1031 # largefiles were changed. This is used by bisect, backout and fetch. | 1031 # largefiles were changed. This is used by bisect, backout and fetch. |
1032 def overridebailifchanged(orig, repo): | 1032 def overridebailifchanged(orig, repo, *args, **kwargs): |
1033 orig(repo) | 1033 orig(repo, *args, **kwargs) |
1034 repo.lfstatus = True | 1034 repo.lfstatus = True |
1035 s = repo.status() | 1035 s = repo.status() |
1036 repo.lfstatus = False | 1036 repo.lfstatus = False |
1037 if s.modified or s.added or s.removed or s.deleted: | 1037 if s.modified or s.added or s.removed or s.deleted: |
1038 raise util.Abort(_('uncommitted changes')) | 1038 raise util.Abort(_('uncommitted changes')) |