##// END OF EJS Templates
largefile: use `self` in repo method instead of `repo`...
Pierre-Yves David -
r17803:1479572d default
parent child Browse files
Show More
@@ -100,11 +100,11 b' def reposetup(ui, repo):'
100 if isinstance(node1, context.changectx):
100 if isinstance(node1, context.changectx):
101 ctx1 = node1
101 ctx1 = node1
102 else:
102 else:
103 ctx1 = repo[node1]
103 ctx1 = self[node1]
104 if isinstance(node2, context.changectx):
104 if isinstance(node2, context.changectx):
105 ctx2 = node2
105 ctx2 = node2
106 else:
106 else:
107 ctx2 = repo[node2]
107 ctx2 = self[node2]
108 working = ctx2.rev() is None
108 working = ctx2.rev() is None
109 parentworking = working and ctx1 == self['.']
109 parentworking = working and ctx1 == self['.']
110
110
@@ -140,7 +140,7 b' def reposetup(ui, repo):'
140 if not working:
140 if not working:
141 return files
141 return files
142 newfiles = []
142 newfiles = []
143 dirstate = repo.dirstate
143 dirstate = self.dirstate
144 for f in files:
144 for f in files:
145 sf = lfutil.standin(f)
145 sf = lfutil.standin(f)
146 if sf in dirstate:
146 if sf in dirstate:
@@ -181,7 +181,7 b' def reposetup(ui, repo):'
181
181
182 def sfindirstate(f):
182 def sfindirstate(f):
183 sf = lfutil.standin(f)
183 sf = lfutil.standin(f)
184 dirstate = repo.dirstate
184 dirstate = self.dirstate
185 return sf in dirstate or sf in dirstate.dirs()
185 return sf in dirstate or sf in dirstate.dirs()
186 match._files = [f for f in match._files
186 match._files = [f for f in match._files
187 if sfindirstate(f)]
187 if sfindirstate(f)]
@@ -244,13 +244,13 b' def reposetup(ui, repo):'
244 # files are not really removed if it's still in
244 # files are not really removed if it's still in
245 # lfdirstate. This happens in merges where files
245 # lfdirstate. This happens in merges where files
246 # change type.
246 # change type.
247 removed = [f for f in removed if f not in repo.dirstate]
247 removed = [f for f in removed if f not in self.dirstate]
248 result[2] = [f for f in result[2] if f not in lfdirstate]
248 result[2] = [f for f in result[2] if f not in lfdirstate]
249
249
250 # Unknown files
250 # Unknown files
251 unknown = set(unknown).difference(ignored)
251 unknown = set(unknown).difference(ignored)
252 result[4] = [f for f in unknown
252 result[4] = [f for f in unknown
253 if (repo.dirstate[f] == '?' and
253 if (self.dirstate[f] == '?' and
254 not lfutil.isstandin(f))]
254 not lfutil.isstandin(f))]
255 # Ignored files were calculated earlier by the dirstate,
255 # Ignored files were calculated earlier by the dirstate,
256 # and we already stripped out the largefiles from the list
256 # and we already stripped out the largefiles from the list
@@ -292,7 +292,7 b' def reposetup(ui, repo):'
292 force=False, editor=False, extra={}):
292 force=False, editor=False, extra={}):
293 orig = super(lfilesrepo, self).commit
293 orig = super(lfilesrepo, self).commit
294
294
295 wlock = repo.wlock()
295 wlock = self.wlock()
296 try:
296 try:
297 # Case 0: Rebase or Transplant
297 # Case 0: Rebase or Transplant
298 # We have to take the time to pull down the new largefiles now.
298 # We have to take the time to pull down the new largefiles now.
@@ -301,9 +301,9 b' def reposetup(ui, repo):'
301 # or in the first commit after the rebase or transplant.
301 # or in the first commit after the rebase or transplant.
302 # updatelfiles will update the dirstate to mark any pulled
302 # updatelfiles will update the dirstate to mark any pulled
303 # largefiles as modified
303 # largefiles as modified
304 if getattr(repo, "_isrebasing", False) or \
304 if getattr(self, "_isrebasing", False) or \
305 getattr(repo, "_istransplanting", False):
305 getattr(self, "_istransplanting", False):
306 lfcommands.updatelfiles(repo.ui, repo, filelist=None,
306 lfcommands.updatelfiles(self.ui, self, filelist=None,
307 printmessage=False)
307 printmessage=False)
308 result = orig(text=text, user=user, date=date, match=match,
308 result = orig(text=text, user=user, date=date, match=match,
309 force=force, editor=editor, extra=extra)
309 force=force, editor=editor, extra=extra)
@@ -319,7 +319,7 b' def reposetup(ui, repo):'
319 # otherwise to update all standins if the largefiles are
319 # otherwise to update all standins if the largefiles are
320 # large.
320 # large.
321 lfdirstate = lfutil.openlfdirstate(ui, self)
321 lfdirstate = lfutil.openlfdirstate(ui, self)
322 dirtymatch = match_.always(repo.root, repo.getcwd())
322 dirtymatch = match_.always(self.root, self.getcwd())
323 s = lfdirstate.status(dirtymatch, [], False, False, False)
323 s = lfdirstate.status(dirtymatch, [], False, False, False)
324 modifiedfiles = []
324 modifiedfiles = []
325 for i in s:
325 for i in s:
@@ -345,9 +345,9 b' def reposetup(ui, repo):'
345 if result is not None:
345 if result is not None:
346 for lfile in lfdirstate:
346 for lfile in lfdirstate:
347 if lfile in modifiedfiles:
347 if lfile in modifiedfiles:
348 if (not os.path.exists(repo.wjoin(
348 if (not os.path.exists(self.wjoin(
349 lfutil.standin(lfile)))) or \
349 lfutil.standin(lfile)))) or \
350 (not os.path.exists(repo.wjoin(lfile))):
350 (not os.path.exists(self.wjoin(lfile))):
351 lfdirstate.drop(lfile)
351 lfdirstate.drop(lfile)
352
352
353 # This needs to be after commit; otherwise precommit hooks
353 # This needs to be after commit; otherwise precommit hooks
@@ -390,7 +390,7 b' def reposetup(ui, repo):'
390 # standins corresponding to the big files requested by the
390 # standins corresponding to the big files requested by the
391 # user. Have to modify _files to prevent commit() from
391 # user. Have to modify _files to prevent commit() from
392 # complaining "not tracked" for big files.
392 # complaining "not tracked" for big files.
393 lfiles = lfutil.listlfiles(repo)
393 lfiles = lfutil.listlfiles(self)
394 match = copy.copy(match)
394 match = copy.copy(match)
395 origmatchfn = match.matchfn
395 origmatchfn = match.matchfn
396
396
@@ -431,14 +431,14 b' def reposetup(ui, repo):'
431 wlock.release()
431 wlock.release()
432
432
433 def push(self, remote, force=False, revs=None, newbranch=False):
433 def push(self, remote, force=False, revs=None, newbranch=False):
434 o = lfutil.findoutgoing(repo, remote, force)
434 o = lfutil.findoutgoing(self, remote, force)
435 if o:
435 if o:
436 toupload = set()
436 toupload = set()
437 o = repo.changelog.nodesbetween(o, revs)[0]
437 o = self.changelog.nodesbetween(o, revs)[0]
438 for n in o:
438 for n in o:
439 parents = [p for p in repo.changelog.parents(n)
439 parents = [p for p in self.changelog.parents(n)
440 if p != node_.nullid]
440 if p != node_.nullid]
441 ctx = repo[n]
441 ctx = self[n]
442 files = set(ctx.files())
442 files = set(ctx.files())
443 if len(parents) == 2:
443 if len(parents) == 2:
444 mc = ctx.manifest()
444 mc = ctx.manifest()
General Comments 0
You need to be logged in to leave comments. Login now