Example #1
0
 def testBranchBomb(self):
     f = phlgitu_fixture.CentralisedWithTwoWorkers()
     with contextlib.closing(f):
         self._setupBranchBomb(f)
         phlgit_fetch.prune_safe(f.w0.repo, 'origin')
         f.w0.repo('fetch', '--prune')
         phlgit_fetch.all_prune(f.w0.repo)
    def fetch_prune(self):
        """Fetch from the remote and prune branches.

        :returns: None

        """
        phlgit_fetch.prune_safe(self, self._remote)
 def testBranchBomb(self):
     f = phlgitu_fixture.CentralisedWithTwoWorkers()
     with contextlib.closing(f):
         self._setupBranchBomb(f)
         phlgit_fetch.prune_safe(f.w0.repo, 'origin')
         f.w0.repo('fetch', '--prune')
         phlgit_fetch.all_prune(f.w0.repo)
Example #4
0
 def testBreathing(self):
     # pychecker won't recognise the attributes on 'f' if we create it in
     # the closing parameter list and use 'as', at least not if we create an
     # alias to the CentralisedWithTwoWorkers class
     #
     f = phlgitu_fixture.CentralisedWithTwoWorkers()
     with contextlib.closing(f):
         phlgit_fetch.prune_safe(f.w0.repo, 'origin')
 def testBreathing(self):
     # pychecker won't recognise the attributes on 'f' if we create it in
     # the closing parameter list and use 'as', at least not if we create an
     # alias to the CentralisedWithTwoWorkers class
     #
     f = phlgitu_fixture.CentralisedWithTwoWorkers()
     with contextlib.closing(f):
         phlgit_fetch.prune_safe(f.w0.repo, 'origin')
Example #6
0
    def checkout_master_fetch_prune(self):
        """Checkout master, fetch from the remote and prune branches.

        Please see checkout_master_fetch_special_refs() for why we must
        checkout master first.

        :returns: None

        """
        phlgit_fetch.prune_safe(self, self._remote)
        checkout_master_fetch_special_refs(self, self._remote)
Example #7
0
def checkout_master_fetch_special_refs(repo, remote):
    # fetch the 'landed' and 'abandoned' refs, if they exist

    # We must checkout master before fetching the special refs to the
    # local branches. Otherwise we might be attempting to overwrite the
    # current branch with fetch, which would fail.
    phlgit_checkout.branch(repo, 'master')

    branch_refspec = '+refs/heads/*:refs/remotes/origin/*'
    arcyd_refspec = '+{refspace}/*:refs/heads/{branchspace}/*'.format(
        refspace=_ARCYD_REFSPACE, branchspace=_PRIVATE_ARCYD_BRANCHSPACE)
    refspec_list = [branch_refspec, arcyd_refspec]

    phlgit_fetch.prune_safe(repo, remote, refspec_list)
Example #8
0
def checkout_master_fetch_special_refs(repo, remote):
    # fetch the 'landed' and 'abandoned' refs, if they exist

    # We must checkout master before fetching the special refs to the
    # local branches. Otherwise we might be attempting to overwrite the
    # current branch with fetch, which would fail.
    phlgit_checkout.branch(repo, 'master')

    branch_refspec = '+refs/heads/*:refs/remotes/origin/*'
    arcyd_refspec = '+{refspace}/*:refs/heads/{branchspace}/*'.format(
        refspace=_ARCYD_REFSPACE, branchspace=_PRIVATE_ARCYD_BRANCHSPACE)
    refspec_list = [branch_refspec, arcyd_refspec]

    phlgit_fetch.prune_safe(repo, remote, refspec_list)
    def testBranchBomb(self):
        f = phlgitu_fixture.CentralisedWithTwoWorkers()
        with contextlib.closing(f):
            self._setupBranchBomb(f)

            fetch_prune = lambda: f.w0.repo('fetch', '--prune')
            fetch_all_prune = lambda: phlgit_fetch.all_prune(f.w0.repo)
            self.assertRaises(
                phlsys_subprocess.CalledProcessError,
                fetch_prune)
            self.assertRaises(
                phlsys_subprocess.CalledProcessError,
                fetch_all_prune)

            phlgit_fetch.prune_safe(f.w0.repo, 'origin')
            f.w0.repo('fetch', '--prune')
            phlgit_fetch.all_prune(f.w0.repo)
Example #10
0
    def testFetchSpec(self):
        fetchspec = ["+refs/heads/*:refs/remotes/origin/*"]
        fetchspec_nonexistant = ["+refs/nope/*:refs/heads/__private_nope/*"]

        f = phlgitu_fixture.CentralisedWithTwoWorkers()
        with contextlib.closing(f):
            phlgit_fetch.prune_safe(f.w0.repo, 'origin', [])
            phlgit_fetch.prune_safe(f.w0.repo, 'origin', fetchspec)
            phlgit_fetch.prune_safe(f.w0.repo, 'origin', fetchspec_nonexistant)
Example #11
0
    def testFetchSpec(self):
        fetchspec = ["+refs/heads/*:refs/remotes/origin/*"]
        fetchspec_nonexistant = ["+refs/nope/*:refs/heads/__private_nope/*"]

        f = phlgitu_fixture.CentralisedWithTwoWorkers()
        with contextlib.closing(f):
            phlgit_fetch.prune_safe(f.w0.repo, 'origin', [])
            phlgit_fetch.prune_safe(f.w0.repo, 'origin', fetchspec)
            phlgit_fetch.prune_safe(f.w0.repo, 'origin', fetchspec_nonexistant)