By default it checks the tree status and checks out the given tree id.
This can be done with 'git-read-tree -m old new'.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
def switch(tree_id):
"""Switch the tree to the given id
"""
def switch(tree_id):
"""Switch the tree to the given id
"""
- to_delete = filter(lambda x: x[0] in ['N', 'A'],
- __tree_status(tree_id = tree_id))
+ if __run('git-read-tree -u -m', [get_head(), tree_id]) != 0:
+ raise GitException, 'git-read-tree failed (local changes maybe?)'
- checkout(tree_id = tree_id, force = True)
- # checkout doesn't remove files
- for fs in to_delete:
- os.remove(fs[1])
-
def pull(location, head = None, tag = None):
"""Fetch changes from the remote repository. At the moment, just
use the 'git fetch' scripts
def pull(location, head = None, tag = None):
"""Fetch changes from the remote repository. At the moment, just
use the 'git fetch' scripts