##// END OF EJS Templates
largefiles: align the output messages for an added file with core methods...
Matt Harbison -
r23767:749dc66e default
parent child Browse files
Show More
@@ -85,7 +85,7 def restorematchandpatsfn():
85 85 scmutil.matchandpats = getattr(scmutil.matchandpats, 'oldmatchandpats',
86 86 scmutil.matchandpats)
87 87
88 def addlargefiles(ui, repo, matcher, **opts):
88 def addlargefiles(ui, repo, isaddremove, matcher, **opts):
89 89 large = opts.pop('large', None)
90 90 lfsize = lfutil.getminsize(
91 91 ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None))
@@ -106,11 +106,17 def addlargefiles(ui, repo, matcher, **o
106 106 nfile = f in wctx
107 107 exists = lfile or nfile
108 108
109 # addremove in core gets fancy with the name, add doesn't
110 if isaddremove:
111 name = m.uipath(f)
112 else:
113 name = m.rel(f)
114
109 115 # Don't warn the user when they attempt to add a normal tracked file.
110 116 # The normal add code will do that for us.
111 117 if exact and exists:
112 118 if lfile:
113 ui.warn(_('%s already a largefile\n') % f)
119 ui.warn(_('%s already a largefile\n') % name)
114 120 continue
115 121
116 122 if (exact or not exists) and not lfutil.isstandin(f):
@@ -124,7 +130,7 def addlargefiles(ui, repo, matcher, **o
124 130 if large or abovemin or (lfmatcher and lfmatcher(f)):
125 131 lfnames.append(f)
126 132 if ui.verbose or not exact:
127 ui.status(_('adding %s as a largefile\n') % m.rel(f))
133 ui.status(_('adding %s as a largefile\n') % name)
128 134
129 135 bad = []
130 136
@@ -241,7 +247,7 def overrideadd(orig, ui, repo, *pats, *
241 247 raise util.Abort(_('--normal cannot be used with --large'))
242 248 return orig(ui, repo, *pats, **opts)
243 249 matcher = scmutil.match(repo[None], pats, opts)
244 bad = addlargefiles(ui, repo, matcher, **opts)
250 bad = addlargefiles(ui, repo, False, matcher, **opts)
245 251 installnormalfilesmatchfn(repo[None].manifest())
246 252 result = orig(ui, repo, *pats, **opts)
247 253 restorematchfn()
@@ -1124,7 +1130,7 def scmutiladdremove(orig, repo, matcher
1124 1130 removelargefiles(repo.ui, repo, True, m, **opts)
1125 1131 # Call into the normal add code, and any files that *should* be added as
1126 1132 # largefiles will be
1127 addlargefiles(repo.ui, repo, matcher, **opts)
1133 addlargefiles(repo.ui, repo, True, matcher, **opts)
1128 1134 # Now that we've handled largefiles, hand off to the original addremove
1129 1135 # function to take care of the rest. Make sure it doesn't do anything with
1130 1136 # largefiles by passing a matcher that will ignore them.
@@ -291,7 +291,7 Add a normal file to the subrepo, then t
291 291 ? subrepo/renamed-large.txt
292 292
293 293 $ hg -R statusmatch addremove --dry-run -S
294 adding statusmatch/large.dat as a largefile (glob)
294 adding large.dat as a largefile
295 295 removing subrepo/large.txt
296 296 adding subrepo/normal.txt
297 297 adding subrepo/renamed-large.txt
@@ -493,7 +493,7 Test addremove with -R
493 493 $ cd ..
494 494 $ hg -R a -v addremove
495 495 removing sub/large4
496 adding a/testaddremove.dat as a largefile (glob)
496 adding testaddremove.dat as a largefile
497 497 removing normal3
498 498 adding normaladdremove
499 499 $ cd a
@@ -1731,7 +1731,7 coexist.
1731 1731 $ rm sub2/large7
1732 1732 $ echo "largeasnormal" > sub2/large7
1733 1733 $ hg add sub2/large7
1734 sub2/large7 already a largefile
1734 sub2/large7 already a largefile (glob)
1735 1735
1736 1736 Test that transplanting a largefile change works correctly.
1737 1737
General Comments 0
You need to be logged in to leave comments. Login now