import errno
import itertools
import os
+import posixpath
import stat
import tempfile
import urllib2
else:
ttree = {}
for name, oldmode, oldhexsha in stree.iteritems():
- if path == "":
- oldchildpath = name
- else:
- oldchildpath = "%s/%s" % (path, name)
+ oldchildpath = posixpath.join(path, name)
try:
(newmode, newhexsha) = ttree[name]
newchildpath = oldchildpath
yield ((oldchildpath, newchildpath), (oldmode, newmode), (oldhexsha, newhexsha))
for name, newmode, newhexsha in ttree.iteritems():
- if path == "":
- childpath = name
- else:
- childpath = "%s/%s" % (path, name)
+ childpath = posixpath.join(path, name)
if not name in stree:
if not stat.S_ISDIR(newmode):
yield ((None, childpath), (None, newmode), (None, newhexsha))
(tid, tpath) = todo.pop()
tree = self[tid]
for name, mode, hexsha in tree.iteritems():
- if tpath == "":
- path = name
- else:
- path = "%s/%s" % (tpath, name)
+ path = posixpath.join(tpath, name)
if stat.S_ISDIR(mode):
todo.add((hexsha, path))
else:
for (offset, type, obj, crc32) in todo:
assert isinstance(offset, int)
assert isinstance(type, int)
- assert isinstance(obj, list) or isinstance(obj, str)
try:
type, obj = self.resolve_object(offset, type, obj, get_ref_text)
except Postpone, (sha, ):