Merge lp:~jelmer/bzr-git/merge-fetch into lp:bzr-git

Proposed by Jelmer Vernooij on 2011-03-26
Status: Merged
Merged at revision: 1155
Proposed branch: lp:~jelmer/bzr-git/merge-fetch
Merge into: lp:bzr-git
Diff against target: 52 lines (+14/-4)
2 files modified
NEWS (+3/-0)
branch.py (+11/-4)
To merge this branch: bzr merge lp:~jelmer/bzr-git/merge-fetch
Reviewer Review Type Date Requested Status
bzr-git developers 2011-03-26 Pending
Review via email: mp+54963@code.launchpad.net

Description of the change

Implement InterFromGitBranch.fetch.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2011-03-26 00:22:06 +0000
3+++ NEWS 2011-03-26 17:23:12 +0000
4@@ -16,6 +16,9 @@
5 * Fix recursion error merging tags for bound branches.
6 (Jelmer Vernooij, #742833)
7
8+ * Fix fetching from remote git repositories during merge.
9+ (Jelmer Vernooij, #741760)
10+
11 API COMPLETENESS
12
13 * Implement LocalGitControlDir.clone_on_transport. (Jelmer Vernooij, #721899)
14
15=== modified file 'branch.py'
16--- branch.py 2011-03-26 17:09:57 +0000
17+++ branch.py 2011-03-26 17:23:12 +0000
18@@ -570,9 +570,10 @@
19 not isinstance(target, GitBranch) and
20 (getattr(cls._get_interrepo(source, target), "fetch_objects", None) is not None))
21
22- def update_revisions(self, stop_revision=None, overwrite=False,
23- graph=None):
24- """See InterBranch.update_revisions()."""
25+ def fetch(self, stop_revision=None, fetch_tags=True):
26+ self.fetch_objects(stop_revision, fetch_tags=fetch_tags)
27+
28+ def fetch_objects(self, stop_revision, fetch_tags):
29 interrepo = self._get_interrepo(self.source, self.target)
30 def determine_wants(heads):
31 if self.source.ref is not None and not self.source.ref in heads:
32@@ -587,13 +588,19 @@
33 else:
34 self._last_revid = stop_revision
35 real = interrepo.get_determine_wants_revids(
36- [self._last_revid], include_tags=True)
37+ [self._last_revid], include_tags=fetch_tags)
38 return real(heads)
39 pack_hint, head, refs = interrepo.fetch_objects(
40 determine_wants, self.source.mapping)
41 if (pack_hint is not None and
42 self.target.repository._format.pack_compresses):
43 self.target.repository.pack(hint=pack_hint)
44+ return head, refs
45+
46+ def update_revisions(self, stop_revision=None, overwrite=False,
47+ graph=None):
48+ """See InterBranch.update_revisions()."""
49+ head, refs = self.fetch_objects(stop_revision, fetch_tags=True)
50 if overwrite:
51 prev_last_revid = None
52 else:

Subscribers

People subscribed via source and target branches

to all changes: