~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

(andrew) Add Repository.get_rev_id_for_revno HPSS verb (and API).

Show diffs side-by-side

added added

removed removed

Lines of Context:
946
946
            if branch_to.get_parent() is None or remember:
947
947
                branch_to.set_parent(branch_from.base)
948
948
 
949
 
        if revision is not None:
950
 
            revision_id = revision.as_revision_id(branch_from)
951
 
 
952
 
        branch_to.lock_write()
 
949
        if branch_from is not branch_to:
 
950
            branch_from.lock_read()
953
951
        try:
954
 
            if tree_to is not None:
955
 
                view_info = _get_view_info_for_change_reporter(tree_to)
956
 
                change_reporter = delta._ChangeReporter(
957
 
                    unversioned_filter=tree_to.is_ignored, view_info=view_info)
958
 
                result = tree_to.pull(branch_from, overwrite, revision_id,
959
 
                                      change_reporter,
960
 
                                      possible_transports=possible_transports,
961
 
                                      local=local)
962
 
            else:
963
 
                result = branch_to.pull(branch_from, overwrite, revision_id,
964
 
                                      local=local)
965
 
 
966
 
            result.report(self.outf)
967
 
            if verbose and result.old_revid != result.new_revid:
968
 
                log.show_branch_change(branch_to, self.outf, result.old_revno,
969
 
                                       result.old_revid)
 
952
            if revision is not None:
 
953
                revision_id = revision.as_revision_id(branch_from)
 
954
 
 
955
            branch_to.lock_write()
 
956
            try:
 
957
                if tree_to is not None:
 
958
                    view_info = _get_view_info_for_change_reporter(tree_to)
 
959
                    change_reporter = delta._ChangeReporter(
 
960
                        unversioned_filter=tree_to.is_ignored,
 
961
                        view_info=view_info)
 
962
                    result = tree_to.pull(
 
963
                        branch_from, overwrite, revision_id, change_reporter,
 
964
                        possible_transports=possible_transports, local=local)
 
965
                else:
 
966
                    result = branch_to.pull(
 
967
                        branch_from, overwrite, revision_id, local=local)
 
968
 
 
969
                result.report(self.outf)
 
970
                if verbose and result.old_revid != result.new_revid:
 
971
                    log.show_branch_change(
 
972
                        branch_to, self.outf, result.old_revno,
 
973
                        result.old_revid)
 
974
            finally:
 
975
                branch_to.unlock()
970
976
        finally:
971
 
            branch_to.unlock()
 
977
            if branch_from is not branch_to:
 
978
                branch_from.unlock()
972
979
 
973
980
 
974
981
class cmd_push(Command):