/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to workingtree.py

Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    Index,
34
34
    changes_from_tree,
35
35
    cleanup_mode,
 
36
    commit_tree,
36
37
    index_entry_from_stat,
37
 
    refresh_index,
 
38
    iter_fresh_blobs,
38
39
    )
39
40
from dulwich.object_store import (
40
41
    tree_lookup_path,
1086
1087
        # TODO(jelmer): Handle require_versioned
1087
1088
        # TODO(jelmer): Restrict to specific_files, for performance reasons.
1088
1089
        with self.lock_read():
1089
 
            return changes_between_git_tree_and_index(
 
1090
            return changes_between_git_tree_and_working_copy(
1090
1091
                self.source.store, self.source.tree,
1091
1092
                self.target, want_unchanged=want_unchanged)
1092
1093
 
1150
1151
    """Determine the changes between a git tree and a working tree with index.
1151
1152
 
1152
1153
    """
1153
 
    # TODO(jelmer): Avoid creating and storing tree objects; ideally, use
1154
 
    # dulwich.index.changes_from_tree with a include_trees argument.
1155
 
    refresh_index(target.index, target.abspath('.').encode(sys.getfilesystemencoding()))
1156
1154
    to_tree_sha = target.index.commit(store)
1157
 
    target.index.write()
 
1155
    return store.tree_changes(from_tree_sha, to_tree_sha, include_trees=True,
 
1156
            want_unchanged=want_unchanged)
 
1157
 
 
1158
 
 
1159
def changes_between_git_tree_and_working_copy(store, from_tree_sha, target,
 
1160
        want_unchanged=False, update_index=False):
 
1161
    """Determine the changes between a git tree and a working tree with index.
 
1162
 
 
1163
    """
 
1164
    blobs = iter_fresh_blobs(target.index, target.abspath('.').encode(sys.getfilesystemencoding()))
 
1165
    to_tree_sha = commit_tree(store, blobs)
1158
1166
    return store.tree_changes(from_tree_sha, to_tree_sha, include_trees=True,
1159
1167
            want_unchanged=want_unchanged)