/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/remote.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-08-23 01:15:41 UTC
  • mfrom: (7520.1.4 merge-3.1)
  • Revision ID: breezy.the.bot@gmail.com-20200823011541-nv0oh7nzaganx2qy
Merge lp:brz/3.1.

Merged from https://code.launchpad.net/~jelmer/brz/merge-3.1/+merge/389690

Show diffs side-by-side

added added

removed removed

Lines of Context:
201
201
        return PermissionDenied(url, message)
202
202
    if message.endswith(' does not appear to be a git repository'):
203
203
        return NotBranchError(url, message)
 
204
    if message == 'pre-receive hook declined':
 
205
        return PermissionDenied(url, message)
204
206
    if re.match('(.+) is not a valid repository name',
205
207
                message.splitlines()[0]):
206
208
        return NotBranchError(url, message)
600
602
        push_result.branch_push_result = None
601
603
        repo = self.find_repository()
602
604
        refname = self._get_selected_ref(name)
603
 
        ref_chain, old_sha = self.get_refs_container().follow(refname)
604
 
        if ref_chain:
605
 
            actual_refname = ref_chain[-1]
606
 
        else:
 
605
        try:
 
606
            ref_chain, old_sha = self.get_refs_container().follow(refname)
 
607
        except NotBranchError:
607
608
            actual_refname = refname
 
609
            old_sha = None
 
610
        else:
 
611
            if ref_chain:
 
612
                actual_refname = ref_chain[-1]
 
613
            else:
 
614
                actual_refname = refname
608
615
        if isinstance(source, GitBranch) and lossy:
609
616
            raise errors.LossyPushToSameVCS(source.controldir, self)
610
617
        source_store = get_object_store(source.repository)
624
631
                    raise errors.NoRoundtrippingSupport(
625
632
                        source, self.open_branch(name=name, nascent_ok=True))
626
633
            if not overwrite:
 
634
                old_sha = remote_refs.get(actual_refname)
627
635
                if remote_divergence(old_sha, new_sha, source_store):
628
636
                    raise DivergedBranches(
629
637
                        source, self.open_branch(name, nascent_ok=True))