/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/tests/test_remote.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 10:19:08 UTC
  • mfrom: (7131.12.2 git-remote-uncommit)
  • Revision ID: breezy.the.bot@gmail.com-20181116101908-33lz5f3acvmymg38
Support uncommit on remote git branches.

Merged from https://code.launchpad.net/~jelmer/brz/git-remote-uncommit/+merge/355576

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
        self.assertTrue(self.format.supports_tags())
142
142
 
143
143
 
 
144
class TestRemoteGitBranch(TestCaseWithTransport):
 
145
 
 
146
    def setUp(self):
 
147
        TestCaseWithTransport.setUp(self)
 
148
        self.remote_real = GitRepo.init('remote', mkdir=True)
 
149
        self.remote_url = 'git://%s/' % os.path.abspath(self.remote_real.path)
 
150
        self.permit_url(self.remote_url)
 
151
 
 
152
    def test_set_last_revision_info(self):
 
153
        c1 = self.remote_real.do_commit(
 
154
                message=b'message 1',
 
155
                committer=b'committer <committer@example.com>',
 
156
                author=b'author <author@example.com>',
 
157
                ref=b'refs/heads/newbranch')
 
158
        c2 = self.remote_real.do_commit(
 
159
                message=b'message 2',
 
160
                committer=b'committer <committer@example.com>',
 
161
                author=b'author <author@example.com>',
 
162
                ref=b'refs/heads/newbranch')
 
163
 
 
164
        remote = ControlDir.open(self.remote_url)
 
165
        newbranch = remote.open_branch('newbranch')
 
166
        self.assertEqual(newbranch.lookup_foreign_revision_id(c2),
 
167
                         newbranch.last_revision())
 
168
        newbranch.set_last_revision_info(
 
169
            1, newbranch.lookup_foreign_revision_id(c1))
 
170
        self.assertEqual(c1, self.remote_real.refs[b'refs/heads/newbranch'])
 
171
        self.assertEqual(newbranch.last_revision(),
 
172
                         newbranch.lookup_foreign_revision_id(c1))
 
173
 
 
174
 
144
175
class FetchFromRemoteTestBase(object):
145
176
 
146
177
    _test_needs_features = [ExecutableFeature('git')]