fs = tuple(line.rstrip().split(' ',4)[-1].split('\t',1))
if fs[1] not in conflicts:
cache_files.append(fs)
fs = tuple(line.rstrip().split(' ',4)[-1].split('\t',1))
if fs[1] not in conflicts:
cache_files.append(fs)
raise GitException, 'Unable to add file'
def rm(files, force = False):
raise GitException, 'Unable to add file'
def rm(files, force = False):
def update_cache(files = [], force = False):
"""Update the cache information for the given files
def update_cache(files = [], force = False):
"""Update the cache information for the given files
rm_files = [x[1] for x in cache_files if x[0] in ['D']]
m_files = [x[1] for x in cache_files if x[0] in ['M']]
rm_files = [x[1] for x in cache_files if x[0] in ['D']]
m_files = [x[1] for x in cache_files if x[0] in ['M']]
- if add_files and __run('git-update-cache --add --', add_files) != 0:
- raise GitException, 'Failed git-update-cache --add'
- if rm_files and __run('git-update-cache --force-remove --', rm_files) != 0:
- raise GitException, 'Failed git-update-cache --rm'
- if m_files and __run('git-update-cache --', m_files) != 0:
- raise GitException, 'Failed git-update-cache'
+ if add_files and __run('git-update-index --add --', add_files) != 0:
+ raise GitException, 'Failed git-update-index --add'
+ if rm_files and __run('git-update-index --force-remove --', rm_files) != 0:
+ raise GitException, 'Failed git-update-index --rm'
+ if m_files and __run('git-update-index --', m_files) != 0:
+ raise GitException, 'Failed git-update-index'
raise GitException, 'git-read-tree failed (local changes maybe?)'
# this can fail if there are conflicts
raise GitException, 'git-read-tree failed (local changes maybe?)'
# this can fail if there are conflicts
raise GitException, 'git-merge-cache failed (possible conflicts)'
def status(files = [], modified = False, new = False, deleted = False,
raise GitException, 'git-merge-cache failed (possible conflicts)'
def status(files = [], modified = False, new = False, deleted = False,
if rev2:
diff_str = _output(['git-diff-tree', '-p', rev1, rev2] + files)
else:
if rev2:
diff_str = _output(['git-diff-tree', '-p', rev1, rev2] + files)
else:
- os.system('git-update-cache --refresh > /dev/null')
- diff_str = _output(['git-diff-cache', '-p', rev1] + files)
+ os.system('git-update-index --refresh > /dev/null')
+ diff_str = _output(['git-diff-index', '-p', rev1] + files)
if tree_id and __run('git-read-tree -m', [tree_id]) != 0:
raise GitException, 'Failed git-read-tree -m %s' % tree_id
if tree_id and __run('git-read-tree -m', [tree_id]) != 0:
raise GitException, 'Failed git-read-tree -m %s' % tree_id
"""Apply a patch onto the current index. There must not be any
local changes in the tree, otherwise the command fails
"""
"""Apply a patch onto the current index. There must not be any
local changes in the tree, otherwise the command fails
"""