##// END OF EJS Templates
Implemented generation of changesets based...
Implemented generation of changesets based on whole diff instead of per file diff. That can give a big speed improvement for large changesets in repositories with large history. - improved handling of binary files - show renames of binary files - implemented new diff limit functionality - unify diff generation between hg and git - Added binary indicators for changed files, - added diff lib tests

File last commit:

r2695:26fac32c beta
r2995:32471bd1 beta
Show More
paths.py
37 lines | 834 B | text/x-python | PythonLexer
import os
abspath = lambda * p: os.path.abspath(os.path.join(*p))
def get_dirs_for_path(*paths):
"""
Returns list of directories, including intermediate.
"""
for path in paths:
head = path
while head:
head, tail = os.path.split(head)
if head:
yield head
else:
# We don't need to yield empty path
break
def get_dir_size(path):
root_path = path
size = 0
for path, dirs, files in os.walk(root_path):
for f in files:
try:
size += os.path.getsize(os.path.join(path, f))
except OSError:
pass
return size
def get_user_home():
"""
Returns home path of the user.
"""
return os.getenv('HOME', os.getenv('USERPROFILE')) or ''