Show More
@@ -78,7 +78,7 b' def composenormalfilematcher(match, mani' | |||
|
78 | 78 | m.matchfn = lambda f: notlfile(f) and origmatchfn(f) |
|
79 | 79 | return m |
|
80 | 80 | |
|
81 | def addlargefiles(ui, repo, isaddremove, matcher, **opts): | |
|
81 | def addlargefiles(ui, repo, isaddremove, matcher, uipathfn, **opts): | |
|
82 | 82 | large = opts.get(r'large') |
|
83 | 83 | lfsize = lfutil.getminsize( |
|
84 | 84 | ui, lfutil.islfilesrepo(repo), opts.get(r'lfsize')) |
@@ -99,17 +99,11 b' def addlargefiles(ui, repo, isaddremove,' | |||
|
99 | 99 | nfile = f in wctx |
|
100 | 100 | exists = lfile or nfile |
|
101 | 101 | |
|
102 | # addremove in core gets fancy with the name, add doesn't | |
|
103 | if isaddremove: | |
|
104 | name = m.uipath(f) | |
|
105 | else: | |
|
106 | name = m.rel(f) | |
|
107 | ||
|
108 | 102 | # Don't warn the user when they attempt to add a normal tracked file. |
|
109 | 103 | # The normal add code will do that for us. |
|
110 | 104 | if exact and exists: |
|
111 | 105 | if lfile: |
|
112 |
ui.warn(_('%s already a largefile\n') % |
|
|
106 | ui.warn(_('%s already a largefile\n') % uipathfn(f)) | |
|
113 | 107 | continue |
|
114 | 108 | |
|
115 | 109 | if (exact or not exists) and not lfutil.isstandin(f): |
@@ -123,7 +117,7 b' def addlargefiles(ui, repo, isaddremove,' | |||
|
123 | 117 | if large or abovemin or (lfmatcher and lfmatcher(f)): |
|
124 | 118 | lfnames.append(f) |
|
125 | 119 | if ui.verbose or not exact: |
|
126 |
ui.status(_('adding %s as a largefile\n') % |
|
|
120 | ui.status(_('adding %s as a largefile\n') % uipathfn(f)) | |
|
127 | 121 | |
|
128 | 122 | bad = [] |
|
129 | 123 | |
@@ -150,7 +144,7 b' def addlargefiles(ui, repo, isaddremove,' | |||
|
150 | 144 | added = [f for f in lfnames if f not in bad] |
|
151 | 145 | return added, bad |
|
152 | 146 | |
|
153 | def removelargefiles(ui, repo, isaddremove, matcher, dryrun, **opts): | |
|
147 | def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts): | |
|
154 | 148 | after = opts.get(r'after') |
|
155 | 149 | m = composelargefilematcher(matcher, repo[None].manifest()) |
|
156 | 150 | try: |
@@ -166,7 +160,7 b' def removelargefiles(ui, repo, isaddremo' | |||
|
166 | 160 | |
|
167 | 161 | def warn(files, msg): |
|
168 | 162 | for f in files: |
|
169 |
ui.warn(msg % |
|
|
163 | ui.warn(msg % uipathfn(f)) | |
|
170 | 164 | return int(len(files) > 0) |
|
171 | 165 | |
|
172 | 166 | if after: |
@@ -186,12 +180,7 b' def removelargefiles(ui, repo, isaddremo' | |||
|
186 | 180 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
187 | 181 | for f in sorted(remove): |
|
188 | 182 | if ui.verbose or not m.exact(f): |
|
189 | # addremove in core gets fancy with the name, remove doesn't | |
|
190 | if isaddremove: | |
|
191 | name = m.uipath(f) | |
|
192 | else: | |
|
193 | name = m.rel(f) | |
|
194 | ui.status(_('removing %s\n') % name) | |
|
183 | ui.status(_('removing %s\n') % uipathfn(f)) | |
|
195 | 184 | |
|
196 | 185 | if not dryrun: |
|
197 | 186 | if not after: |
@@ -240,7 +229,7 b' def cmdutiladd(orig, ui, repo, matcher, ' | |||
|
240 | 229 | if opts.get(r'normal'): |
|
241 | 230 | return orig(ui, repo, matcher, prefix, uipathfn, explicitonly, **opts) |
|
242 | 231 | |
|
243 | ladded, lbad = addlargefiles(ui, repo, False, matcher, **opts) | |
|
232 | ladded, lbad = addlargefiles(ui, repo, False, matcher, uipathfn, **opts) | |
|
244 | 233 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest(), |
|
245 | 234 | ladded) |
|
246 | 235 | bad = orig(ui, repo, normalmatcher, prefix, uipathfn, explicitonly, **opts) |
@@ -254,8 +243,8 b' def cmdutilremove(orig, ui, repo, matche' | |||
|
254 | 243 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest()) |
|
255 | 244 | result = orig(ui, repo, normalmatcher, prefix, uipathfn, after, force, |
|
256 | 245 | subrepos, dryrun) |
|
257 |
return removelargefiles(ui, repo, False, matcher, dryrun, |
|
|
258 | force=force) or result | |
|
246 | return removelargefiles(ui, repo, False, matcher, uipathfn, dryrun, | |
|
247 | after=after, force=force) or result | |
|
259 | 248 | |
|
260 | 249 | @eh.wrapfunction(subrepo.hgsubrepo, 'status') |
|
261 | 250 | def overridestatusfn(orig, repo, rev2, **opts): |
@@ -1250,11 +1239,11 b' def scmutiladdremove(orig, repo, matcher' | |||
|
1250 | 1239 | matchfn = m.matchfn |
|
1251 | 1240 | m.matchfn = lambda f: f in s.deleted and matchfn(f) |
|
1252 | 1241 | |
|
1253 | removelargefiles(repo.ui, repo, True, m, opts.get('dry_run'), | |
|
1242 | removelargefiles(repo.ui, repo, True, m, uipathfn, opts.get('dry_run'), | |
|
1254 | 1243 | **pycompat.strkwargs(opts)) |
|
1255 | 1244 | # Call into the normal add code, and any files that *should* be added as |
|
1256 | 1245 | # largefiles will be |
|
1257 | added, bad = addlargefiles(repo.ui, repo, True, matcher, | |
|
1246 | added, bad = addlargefiles(repo.ui, repo, True, matcher, uipathfn, | |
|
1258 | 1247 | **pycompat.strkwargs(opts)) |
|
1259 | 1248 | # Now that we've handled largefiles, hand off to the original addremove |
|
1260 | 1249 | # function to take care of the rest. Make sure it doesn't do anything with |
General Comments 0
You need to be logged in to leave comments.
Login now