Mercurial > hg
comparison hgext/largefiles/overrides.py @ 23441:d289ba74dba3
largefiles: drop the override for 'fetch'
The fetch extension has been calling cmdutil.bailifchanged() since a014fdc97154,
so this is redundant. Add test coverage to prevent regression. It doesn't look
like there is any testing for fetch with largefiles.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 30 Nov 2014 23:30:31 -0500 |
parents | b5e3f3d25395 |
children | 2b23a25f06fd |
comparison
equal
deleted
inserted
replaced
23439:743736fc7c41 | 23441:d289ba74dba3 |
---|---|
944 submatch) | 944 submatch) |
945 | 945 |
946 # If a largefile is modified, the change is not reflected in its | 946 # If a largefile is modified, the change is not reflected in its |
947 # standin until a commit. cmdutil.bailifchanged() raises an exception | 947 # standin until a commit. cmdutil.bailifchanged() raises an exception |
948 # if the repo has uncommitted changes. Wrap it to also check if | 948 # if the repo has uncommitted changes. Wrap it to also check if |
949 # largefiles were changed. This is used by bisect and backout. | 949 # largefiles were changed. This is used by bisect, backout and fetch. |
950 def overridebailifchanged(orig, repo): | 950 def overridebailifchanged(orig, repo): |
951 orig(repo) | 951 orig(repo) |
952 repo.lfstatus = True | 952 repo.lfstatus = True |
953 s = repo.status() | 953 s = repo.status() |
954 repo.lfstatus = False | 954 repo.lfstatus = False |
955 if s.modified or s.added or s.removed or s.deleted: | 955 if s.modified or s.added or s.removed or s.deleted: |
956 raise util.Abort(_('uncommitted changes')) | 956 raise util.Abort(_('uncommitted changes')) |
957 | |
958 # Fetch doesn't use cmdutil.bailifchanged so override it to add the check | |
959 def overridefetch(orig, ui, repo, *pats, **opts): | |
960 repo.lfstatus = True | |
961 s = repo.status() | |
962 repo.lfstatus = False | |
963 if s.modified or s.added or s.removed or s.deleted: | |
964 raise util.Abort(_('uncommitted changes')) | |
965 return orig(ui, repo, *pats, **opts) | |
966 | 957 |
967 def overrideforget(orig, ui, repo, *pats, **opts): | 958 def overrideforget(orig, ui, repo, *pats, **opts): |
968 installnormalfilesmatchfn(repo[None].manifest()) | 959 installnormalfilesmatchfn(repo[None].manifest()) |
969 result = orig(ui, repo, *pats, **opts) | 960 result = orig(ui, repo, *pats, **opts) |
970 restorematchfn() | 961 restorematchfn() |