~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Aaron Bentley
  • Date: 2009-04-14 14:53:22 UTC
  • mto: This revision was merged to the branch mainline in revision 4302.
  • Revision ID: aaron@aaronbentley.com-20090414145322-2z6fjycf3j17hjbm
Handle references in push, pull, merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1049
1049
        revision_id: if not None, the revision history in the new branch will
1050
1050
                     be truncated to end with revision_id.
1051
1051
        """
 
1052
        self.update_references(destination)
1052
1053
        self._synchronize_history(destination, revision_id)
1053
1054
        try:
1054
1055
            parent = self.get_parent()
1059
1060
                destination.set_parent(parent)
1060
1061
        if self._push_should_merge_tags():
1061
1062
            self.tags.merge_to(destination.tags)
1062
 
        if getattr(self._format, 'supports_reference_locations', False):
1063
 
            self.update_references(destination)
1064
1063
 
1065
1064
    def update_references(self, target):
 
1065
        if not getattr(self._format, 'supports_reference_locations', False):
 
1066
            return
1066
1067
        reference_dict = self._get_info_dict()
1067
1068
        old_base = self.base
1068
1069
        new_base = target.base
1073
1074
                                                  old_base, new_base)
1074
1075
            target_reference_dict.setdefault(
1075
1076
                file_id, (tree_path, branch_location))
1076
 
        target._save_reference_dict(target_reference_dict)
 
1077
        try:
 
1078
            target._save_reference_dict(target_reference_dict)
 
1079
        except UnsupportedOperation:
 
1080
            pass
1077
1081
 
1078
1082
    @needs_read_lock
1079
1083
    def check(self):
2120
2124
        try:
2121
2125
            # We assume that during 'pull' the local repository is closer than
2122
2126
            # the remote one.
 
2127
            source.update_references(self)
2123
2128
            graph = self.repository.get_graph(source.repository)
2124
2129
            result.old_revno, result.old_revid = self.last_revision_info()
2125
2130
            self.update_revisions(source, stop_revision, overwrite=overwrite,
2222
2227
        result.source_branch = self
2223
2228
        result.target_branch = target
2224
2229
        result.old_revno, result.old_revid = target.last_revision_info()
 
2230
        self.update_references(target)
2225
2231
        if result.old_revid != self.last_revision():
2226
2232
            # We assume that during 'push' this repository is closer than
2227
2233
            # the target.