comparison hgext/largefiles/overrides.py @ 17661:67deea9c1c42

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 27 Sep 2012 15:51:14 -0500
parents ccd28eca37f6 a02c1ffddae9
children 57fe5aca86af
comparison
equal deleted inserted replaced
17654:1dc37491e9fb 17661:67deea9c1c42
1016 if toupload is None: 1016 if toupload is None:
1017 ui.status(_('largefiles: No remote repo\n')) 1017 ui.status(_('largefiles: No remote repo\n'))
1018 else: 1018 else:
1019 ui.status(_('largefiles: %d to upload\n') % len(toupload)) 1019 ui.status(_('largefiles: %d to upload\n') % len(toupload))
1020 1020
1021 def overrideaddremove(orig, ui, repo, *pats, **opts): 1021 def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None,
1022 similarity=None):
1022 if not lfutil.islfilesrepo(repo): 1023 if not lfutil.islfilesrepo(repo):
1023 return orig(ui, repo, *pats, **opts) 1024 return orig(repo, pats, opts, dry_run, similarity)
1024 # Get the list of missing largefiles so we can remove them 1025 # Get the list of missing largefiles so we can remove them
1025 lfdirstate = lfutil.openlfdirstate(ui, repo) 1026 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1026 s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False, 1027 s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False,
1027 False, False) 1028 False, False)
1028 (unsure, modified, added, removed, missing, unknown, ignored, clean) = s 1029 (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
1029 1030
1030 # Call into the normal remove code, but the removing of the standin, we want 1031 # Call into the normal remove code, but the removing of the standin, we want
1032 # we don't remove the standin in the largefiles code, preventing a very 1033 # we don't remove the standin in the largefiles code, preventing a very
1033 # confused state later. 1034 # confused state later.
1034 if missing: 1035 if missing:
1035 m = [repo.wjoin(f) for f in missing] 1036 m = [repo.wjoin(f) for f in missing]
1036 repo._isaddremove = True 1037 repo._isaddremove = True
1037 removelargefiles(ui, repo, *m, **opts) 1038 removelargefiles(repo.ui, repo, *m, **opts)
1038 repo._isaddremove = False 1039 repo._isaddremove = False
1039 # Call into the normal add code, and any files that *should* be added as 1040 # Call into the normal add code, and any files that *should* be added as
1040 # largefiles will be 1041 # largefiles will be
1041 addlargefiles(ui, repo, *pats, **opts) 1042 addlargefiles(repo.ui, repo, *pats, **opts)
1042 # Now that we've handled largefiles, hand off to the original addremove 1043 # Now that we've handled largefiles, hand off to the original addremove
1043 # function to take care of the rest. Make sure it doesn't do anything with 1044 # function to take care of the rest. Make sure it doesn't do anything with
1044 # largefiles by installing a matcher that will ignore them. 1045 # largefiles by installing a matcher that will ignore them.
1045 installnormalfilesmatchfn(repo[None].manifest()) 1046 installnormalfilesmatchfn(repo[None].manifest())
1046 result = orig(ui, repo, *pats, **opts) 1047 result = orig(repo, pats, opts, dry_run, similarity)
1047 restorematchfn() 1048 restorematchfn()
1048 return result 1049 return result
1049 1050
1050 # Calling purge with --all will cause the largefiles to be deleted. 1051 # Calling purge with --all will cause the largefiles to be deleted.
1051 # Override repo.status to prevent this from happening. 1052 # Override repo.status to prevent this from happening.