summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-05-01 01:09:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-01 05:06:47 (GMT)
commitb25df87fad2b12349a55146d5c87625109a58221 (patch)
treed406fb7a111bd80b0fa22951a8dad4edef7dbb33 /contrib
parent38e7167e9bdc57262c7298912c4bf9df4d68f6fe (diff)
downloadgit-b25df87fad2b12349a55146d5c87625109a58221.zip
git-b25df87fad2b12349a55146d5c87625109a58221.tar.gz
git-b25df87fad2b12349a55146d5c87625109a58221.tar.bz2
remote-bzr: fix partially pushed merge
If part of the merge was already pushed, we don't have the blob_marks available, however, the commits are already stored in bazaar, so we can use the revision_tree to fetch the contents. We want to do this only when there's no other option. There's no easy way to test this. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/remote-helpers/git-remote-bzr17
1 files changed, 13 insertions, 4 deletions
diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr
index bf254a0..fdead31 100755
--- a/contrib/remote-helpers/git-remote-bzr
+++ b/contrib/remote-helpers/git-remote-bzr
@@ -387,6 +387,7 @@ class CustomTree():
global files_cache
self.updates = {}
+ self.branch = repo
def copy_tree(revid):
files = files_cache[revid] = {}
@@ -515,13 +516,21 @@ class CustomTree():
return changes
- def get_file_with_stat(self, file_id, path=None):
+ def get_content(self, file_id):
path, mark = self.rev_files[file_id]
- return (StringIO.StringIO(blob_marks[mark]), None)
+ if mark:
+ return blob_marks[mark]
+
+ # last resort
+ tree = self.branch.repository.revision_tree(self.base_id)
+ return tree.get_file_text(file_id)
+
+ def get_file_with_stat(self, file_id, path=None):
+ content = self.get_content(file_id)
+ return (StringIO.StringIO(content), None)
def get_symlink_target(self, file_id):
- path, mark = self.rev_files[file_id]
- return blob_marks[mark]
+ return self.get_content(file_id)
def id2path(self, file_id):
path, mark = self.rev_files[file_id]