Show More
@@ -972,12 +972,10 b' def overridebailifchanged(orig, repo):' | |||
|
972 | 972 | if s.modified or s.added or s.removed or s.deleted: |
|
973 | 973 | raise util.Abort(_('uncommitted changes')) |
|
974 | 974 | |
|
975 |
def |
|
|
976 |
|
|
|
977 | result = orig(ui, repo, *pats, **opts) | |
|
978 | restorematchfn() | |
|
979 | m = composelargefilematcher(scmutil.match(repo[None], pats, opts), | |
|
980 | repo[None].manifest()) | |
|
975 | def cmdutilforget(orig, ui, repo, match, prefix, explicitonly): | |
|
976 | normalmatcher = composenormalfilematcher(match, repo[None].manifest()) | |
|
977 | bad, forgot = orig(ui, repo, normalmatcher, prefix, explicitonly) | |
|
978 | m = composelargefilematcher(match, repo[None].manifest()) | |
|
981 | 979 | |
|
982 | 980 | try: |
|
983 | 981 | repo.lfstatus = True |
@@ -992,7 +990,7 b' def overrideforget(orig, ui, repo, *pats' | |||
|
992 | 990 | repo.wvfs.isdir(lfutil.standin(f)): |
|
993 | 991 | ui.warn(_('not removing %s: file is already untracked\n') |
|
994 | 992 | % m.rel(f)) |
|
995 | result = 1 | |
|
993 | bad.append(f) | |
|
996 | 994 | |
|
997 | 995 | for f in forget: |
|
998 | 996 | if ui.verbose or not m.exact(f): |
@@ -1012,11 +1010,13 b' def overrideforget(orig, ui, repo, *pats' | |||
|
1012 | 1010 | standins = [lfutil.standin(f) for f in forget] |
|
1013 | 1011 | for f in standins: |
|
1014 | 1012 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) |
|
1015 | repo[None].forget(standins) | |
|
1013 | rejected = repo[None].forget(standins) | |
|
1016 | 1014 | finally: |
|
1017 | 1015 | wlock.release() |
|
1018 | 1016 | |
|
1019 | return result | |
|
1017 | bad.extend(f for f in rejected if f in m.files()) | |
|
1018 | forgot.extend(f for f in forget if f not in rejected) | |
|
1019 | return bad, forgot | |
|
1020 | 1020 | |
|
1021 | 1021 | def _getoutgoings(repo, other, missing, addfunc): |
|
1022 | 1022 | """get pairs of filename and largefile hash in outgoing revisions |
@@ -34,8 +34,7 b' def uisetup(ui):' | |||
|
34 | 34 | entry = extensions.wrapfunction(scmutil, 'addremove', |
|
35 | 35 | overrides.scmutiladdremove) |
|
36 | 36 | extensions.wrapfunction(cmdutil, 'remove', overrides.cmdutilremove) |
|
37 | entry = extensions.wrapcommand(commands.table, 'forget', | |
|
38 | overrides.overrideforget) | |
|
37 | extensions.wrapfunction(cmdutil, 'forget', overrides.cmdutilforget) | |
|
39 | 38 | |
|
40 | 39 | # Subrepos call status function |
|
41 | 40 | entry = extensions.wrapcommand(commands.table, 'status', |
@@ -323,4 +323,25 b' Find an exact match to a standin (should' | |||
|
323 | 323 | $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf |
|
324 | 324 | $ find ../archive_lf 2> /dev/null | sort |
|
325 | 325 | |
|
326 | $ cat >> $HGRCPATH <<EOF | |
|
327 | > [extensions] | |
|
328 | > largefiles= | |
|
329 | > EOF | |
|
330 | ||
|
331 | Test forget through a deep subrepo with the largefiles extension, both a | |
|
332 | largefile and a normal file. Then a largefile that hasn't been committed yet. | |
|
333 | $ touch sub1/sub2/untracked.txt | |
|
334 | $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt | |
|
335 | not removing sub1/sub2/untracked.txt: file is already untracked (glob) | |
|
336 | [1] | |
|
337 | $ hg add -v --large -R sub1/sub2 sub1/sub2/untracked.txt | |
|
338 | adding sub1/sub2/untracked.txt as a largefile (glob) | |
|
339 | $ hg forget -v sub1/sub2/untracked.txt | |
|
340 | removing sub1/sub2/untracked.txt (glob) | |
|
341 | $ hg status -S | |
|
342 | R sub1/sub2/large.bin | |
|
343 | R sub1/sub2/test.txt | |
|
344 | ? foo/bar/abc | |
|
345 | ? sub1/sub2/untracked.txt | |
|
346 | ||
|
326 | 347 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now