| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -106,9 +106,6 @@ Remote | |||
| 106 | 106 | ------ | |
| 107 | 107 | * iter_items should parse the configuration file manually - currently a command | |
| 108 | 108 | is issued which is much slower than it has to be ( compared to manual parsing ) | |
| 109 | - * 'push' method needs a test, a true test repository is required though, a fork | ||
| 110 | - of a fork would do :)! | ||
| 111 | - * Fetch should return heads that where updated, pull as well. | ||
| 112 | 109 | * Creation and deletion methods for references should be part of the interface, allowing | |
| 113 | 110 | repo.create_head(...) instaed of Head.create(repo, ...). Its a convenience thing, clearly | |
| 114 | 111 | * When parsing fetch-info, the regex will not allow spaces in the target remote ref as | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -197,7 +197,6 @@ def _from_line(cls, remote, line): | |||
| 197 | 197 | Create a new PushInfo instance as parsed from line which is expected to be like | |
| 198 | 198 | c refs/heads/master:refs/heads/master 05d2687..1d0568e | |
| 199 | 199 | """ | |
| 200 | - print line | ||
| 201 | 200 | control_character, from_to, summary = line.split('\t', 3) | |
| 202 | 201 | flags = 0 | |
| 203 | 202 | ||
@@ -619,6 +618,10 @@ def fetch(self, refspec=None, **kwargs): | |||
| 619 | 618 | Returns | |
| 620 | 619 | IterableList(FetchInfo, ...) list of FetchInfo instances providing detailed | |
| 621 | 620 | information about the fetch results | |
| 621 | + | ||
| 622 | + Note | ||
| 623 | + As fetch does not provide progress information to non-ttys, we cannot make | ||
| 624 | + it available here unfortunately as in the 'push' method. | ||
| 622 | 625 | """ | |
| 623 | 626 | status, stdout, stderr = self.repo.git.fetch(self, refspec, with_extended_output=True, v=True, **kwargs) | |
| 624 | 627 | return self._get_fetch_info_from_stderr(stderr) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -299,17 +299,34 @@ def _test_push_and_pull(self,remote, rw_repo, remote_repo): | |||
| 299 | 299 | self._test_push_result(res, remote) | |
| 300 | 300 | assert res[0].flags & PushInfo.DELETED | |
| 301 | 301 | ||
| 302 | - self.fail("test --all") | ||
| 303 | - | ||
| 304 | 302 | # push new branch | |
| 303 | + new_head = Head.create(rw_repo, "my_new_branch") | ||
| 304 | + progress = TestPushProgress() | ||
| 305 | + res = remote.push(new_head, progress) | ||
| 306 | + assert res[0].flags & PushInfo.NEW_HEAD | ||
| 307 | + progress.make_assertion() | ||
| 308 | + self._test_push_result(res, remote) | ||
| 305 | 309 | ||
| 306 | - # delete new branch | ||
| 310 | + # delete new branch on the remote end and locally | ||
| 311 | + res = remote.push(":%s" % new_head.path) | ||
| 312 | + self._test_push_result(res, remote) | ||
| 313 | + Head.delete(rw_repo, new_head) | ||
| 314 | + assert res[-1].flags & PushInfo.DELETED | ||
| 315 | + | ||
| 316 | + # --all | ||
| 317 | + res = remote.push(all=True) | ||
| 318 | + self._test_push_result(res, remote) | ||
| 307 | 319 | ||
| 308 | 320 | # pull is essentially a fetch + merge, hence we just do a light | |
| 309 | 321 | # test here, leave the reset to the actual merge testing | |
| 310 | 322 | # fails as we did not specify a branch and there is no configuration for it | |
| 311 | 323 | self.failUnlessRaises(GitCommandError, remote.pull) | |
| 312 | 324 | remote.pull('master') | |
| 325 | + | ||
| 326 | + # cleanup - delete created tags and branches as we are in an innerloop on | ||
| 327 | + # the same repository | ||
| 328 | + TagReference.delete(rw_repo, new_tag, other_tag) | ||
| 329 | + remote.push(":%s" % other_tag.path) | ||
| 313 | 330 | ||
| 314 | 331 | @with_rw_and_rw_remote_repo('0.1.6') | |
| 315 | 332 | def test_base(self, rw_repo, remote_repo): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments