Mercurial > hg-stable
comparison hgext/largefiles/overrides.py @ 17579:cbacb5a813dd stable
largefiles: preserve the exit status of the forget command
This maintains the exit codes documented in commands.py.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 05 Sep 2012 22:42:23 -0400 |
parents | 40c988f108d0 |
children | 55724f42fa14 b7302d65006c |
comparison
equal
deleted
inserted
replaced
17578:40c988f108d0 | 17579:cbacb5a813dd |
---|---|
892 raise util.Abort(_('outstanding uncommitted changes')) | 892 raise util.Abort(_('outstanding uncommitted changes')) |
893 return orig(ui, repo, *pats, **opts) | 893 return orig(ui, repo, *pats, **opts) |
894 | 894 |
895 def overrideforget(orig, ui, repo, *pats, **opts): | 895 def overrideforget(orig, ui, repo, *pats, **opts): |
896 installnormalfilesmatchfn(repo[None].manifest()) | 896 installnormalfilesmatchfn(repo[None].manifest()) |
897 orig(ui, repo, *pats, **opts) | 897 result = orig(ui, repo, *pats, **opts) |
898 restorematchfn() | 898 restorematchfn() |
899 m = scmutil.match(repo[None], pats, opts) | 899 m = scmutil.match(repo[None], pats, opts) |
900 | 900 |
901 try: | 901 try: |
902 repo.lfstatus = True | 902 repo.lfstatus = True |
909 for f in forget: | 909 for f in forget: |
910 if lfutil.standin(f) not in repo.dirstate and not \ | 910 if lfutil.standin(f) not in repo.dirstate and not \ |
911 os.path.isdir(m.rel(lfutil.standin(f))): | 911 os.path.isdir(m.rel(lfutil.standin(f))): |
912 ui.warn(_('not removing %s: file is already untracked\n') | 912 ui.warn(_('not removing %s: file is already untracked\n') |
913 % m.rel(f)) | 913 % m.rel(f)) |
914 result = 1 | |
914 | 915 |
915 for f in forget: | 916 for f in forget: |
916 if ui.verbose or not m.exact(f): | 917 if ui.verbose or not m.exact(f): |
917 ui.status(_('removing %s\n') % m.rel(f)) | 918 ui.status(_('removing %s\n') % m.rel(f)) |
918 | 919 |
929 lfdirstate.write() | 930 lfdirstate.write() |
930 lfutil.reporemove(repo, [lfutil.standin(f) for f in forget], | 931 lfutil.reporemove(repo, [lfutil.standin(f) for f in forget], |
931 unlink=True) | 932 unlink=True) |
932 finally: | 933 finally: |
933 wlock.release() | 934 wlock.release() |
935 | |
936 return result | |
934 | 937 |
935 def getoutgoinglfiles(ui, repo, dest=None, **opts): | 938 def getoutgoinglfiles(ui, repo, dest=None, **opts): |
936 dest = ui.expandpath(dest or 'default-push', dest or 'default') | 939 dest = ui.expandpath(dest or 'default-push', dest or 'default') |
937 dest, branches = hg.parseurl(dest, opts.get('branch')) | 940 dest, branches = hg.parseurl(dest, opts.get('branch')) |
938 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) | 941 revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) |