82
82
# is, missing) in both trees are skipped as well.
83
83
if parent == (None, None) or kind == (None, None):
85
path_encoded = (get_encoded_path(paths[0]),
85
path_encoded = (get_encoded_path(paths[0]),
86
86
get_encoded_path(paths[1]))
87
87
present = ((kind[0] is not None and versioned[0]),
88
88
(kind[1] is not None and versioned[1]))
89
89
contents = (get_blob(present[0], trees[0], file_id),
90
90
get_blob(present[1], trees[1], file_id))
91
91
renamed = (parent[0], name[0]) != (parent[1], name[1])
92
mode = (get_file_mode(trees[0], path_encoded[0],
93
kind[0], executable[0]),
94
get_file_mode(trees[1], path_encoded[1],
92
mode = (get_file_mode(trees[0], path_encoded[0],
93
kind[0], executable[0]),
94
get_file_mode(trees[1], path_encoded[1],
95
95
kind[1], executable[1]))
96
write_blob_diff(self.to_file,
97
(path_encoded[0], mode[0], contents[0]),
96
write_blob_diff(self.to_file,
97
(path_encoded[0], mode[0], contents[0]),
98
98
(path_encoded[1], mode[1], contents[1]))
99
99
has_changes |= (changed_content or renamed)
100
100
return has_changes
118
118
tree_1 = repository.revision_tree(lhs_parent)
119
119
tree_2 = repository.revision_tree(revision_id)
120
120
contents = StringIO()
121
differ = GitDiffTree.from_trees_options(tree_1, tree_2,
121
differ = GitDiffTree.from_trees_options(tree_1, tree_2,
122
122
contents, 'utf8', None, 'a/', 'b/', None)
123
123
differ.show_diff(None, None)
124
write_commit_patch(s, commit, contents.getvalue(), (num, total),
124
write_commit_patch(s, commit, contents.getvalue(), (num, total),
126
126
summary = "%04d-%s" % (num, get_summary(commit))
127
127
return summary, s.getvalue()
140
140
todo = graph.find_difference(submit_revision_id, revision_id)[1]
141
141
total = len(todo)
142
142
for i, revid in enumerate(graph.iter_topo_order(todo)):
143
patches.append(cls._generate_commit(repository, revid, i+1,
143
patches.append(cls._generate_commit(repository, revid, i+1,
146
146
submit_branch.unlock()
147
return cls(revision_id, None, time, timezone, target_branch,
148
"".join([patch for (summary, patch) in patches]),
147
return cls(revision_id, None, time, timezone, target_branch,
148
"".join([patch for (summary, patch) in patches]),
149
149
None, public_branch, message)
152
def send_git(branch, revision_id, submit_branch, public_branch, no_patch,
152
def send_git(branch, revision_id, submit_branch, public_branch, no_patch,
153
153
no_bundle, message, base_revision_id):
155
155
raise errors.BzrCommandError("no patch not supported for git-am style patches")