Kiln » largefiles » Unity
Clone URL:  

readstandin: add node keyword argument and use contexts to read the standin at any node

Changeset 0c921ab7f3c3

Parent 636f153cfcb1

by Profile picture of User 521Andrew Pritchard <andrewp@fogcreek.com>

Changes to one file · Browse files at 0c921ab7f3c3 Showing diff from parent 636f153cfcb1 Diff from another changeset...

Change 1 of 3 Show Entire File lfutil.py Stacked
 
191
192
193
194
 
195
196
197
 
253
254
255
256
 
257
258
259
 
353
354
355
356
357
358
 
 
 
 
359
360
361
 
191
192
193
 
194
195
196
197
 
253
254
255
 
256
257
258
259
 
353
354
355
 
 
 
356
357
358
359
360
361
362
@@ -191,7 +191,7 @@
  matcher = getstandinmatcher(repo)   for standin in dirstate_walk(repo.dirstate, matcher):   bigfile = splitstandin(standin) - hash = readstandin(repo, standin) + hash = readstandin(repo, bigfile)   try:   curhash = hashfile(bigfile)   except IOError, err: @@ -253,7 +253,7 @@
  return repo.join(os.path.join(longname, hash))    def copytocache(repo, rev, file, uploaded=False): - hash = readstandin(repo, standin(file)) + hash = readstandin(repo, file)   if incache(repo, hash):   return   copytocacheabsolute(repo, repo.wjoin(file), hash) @@ -353,9 +353,10 @@
  executable = getexecutable(file)   writestandin(repo, standin, hash, executable)   -def readstandin(repo, standin): - '''read hex hash from <repo.root>/<standin>''' - return readhash(repo.wjoin(standin)) +def readstandin(repo, filename, node=None): + '''read hex hash from standin for filename at given node, or working + directory if no node is given''' + return repo[node][standin(filename)].data().strip()    def writestandin(repo, standin, hash, executable):   '''write hhash to <repo.root>/<standin>'''