Mercurial > hg
comparison hgext/largefiles/lfutil.py @ 31615:f0f316cb8259
largefiles: omit redundant splitstandin() invocations
There are 3 splitstandin() invocations in updatestandin() for same
"standin" value.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 24 Mar 2017 22:24:59 +0900 |
parents | 5c1d3f1b8f44 |
children | 10561eb97c7f |
comparison
equal
deleted
inserted
replaced
31614:d5d0e6ca62ad | 31615:f0f316cb8259 |
---|---|
341 return bits[1] | 341 return bits[1] |
342 else: | 342 else: |
343 return None | 343 return None |
344 | 344 |
345 def updatestandin(repo, standin): | 345 def updatestandin(repo, standin): |
346 file = repo.wjoin(splitstandin(standin)) | 346 lfile = splitstandin(standin) |
347 if repo.wvfs.exists(splitstandin(standin)): | 347 file = repo.wjoin(lfile) |
348 if repo.wvfs.exists(lfile): | |
348 hash = hashfile(file) | 349 hash = hashfile(file) |
349 executable = getexecutable(file) | 350 executable = getexecutable(file) |
350 writestandin(repo, standin, hash, executable) | 351 writestandin(repo, standin, hash, executable) |
351 else: | 352 else: |
352 raise error.Abort(_('%s: file not found!') % splitstandin(standin)) | 353 raise error.Abort(_('%s: file not found!') % lfile) |
353 | 354 |
354 def readstandin(repo, filename, node=None): | 355 def readstandin(repo, filename, node=None): |
355 '''read hex hash from standin for filename at given node, or working | 356 '''read hex hash from standin for filename at given node, or working |
356 directory if no node is given''' | 357 directory if no node is given''' |
357 return repo[node][standin(filename)].data().strip() | 358 return repo[node][standin(filename)].data().strip() |