git-repo icon indicating copy to clipboard operation
git-repo copied to clipboard

Bitbutcket request ls shows more than just open PRs

Open mtfurlan opened this issue 5 years ago • 5 comments

For some reason the bitbucket PR list shows all PRs, not just open ones.

Delete this line (and the comma on the previous line) and it works fine.

https://github.com/guyzmo/git-repo/blob/devel/git_repo/services/ext/bitbucket.py#L323

I did not look into why that fixes it.

mtfurlan avatar Jan 15 '19 22:01 mtfurlan

what is the command to reproduce this from the cli?

cottrell avatar Feb 13 '19 09:02 cottrell

what is the command to reproduce this from the cli?

For example, I do this and get some errors:


$ git bb request create test --title=asdf --message=asdf
Fatal error: 'Repository' object has no attribute 'parent'

cottrell avatar Feb 13 '19 09:02 cottrell

I have no idea on why creating PRs is broken. The way I did this is to open two PRs in the web interface and merge one.

Also I was wrong about my initial statement to fix it the request ls issue, some formatting stuff had to be copied from services/ext/github.py

diff --git a/git_repo/services/ext/bitbucket.py b/git_repo/services/ext/bitbucket.py
index 5b2c43d..550b101 100644
--- a/git_repo/services/ext/bitbucket.py
+++ b/git_repo/services/ext/bitbucket.py
@@ -319,10 +319,11 @@ class BitbucketService(RepositoryService):
                 r.links['html']['href']
             ) for r in self.bb.repositoryPullRequestsInState(
                 owner=user,
-                repository_name=repo,
-                state='open'
+                repository_name=repo
             ) if not isinstance(r, dict) # if no PR is empty, result is a dict
         )
+        yield "{}\t{:<60}\t{}"
+        yield 'id', 'title', 'URL'
         for pull in sorted(requests):
             try:
                 yield pull

otherwise bb request ls will result in

Fatal error: 'tuple' object has no attribute 'format'

mtfurlan avatar Feb 13 '19 14:02 mtfurlan

Ok, but what I am typing is the expected way to create a repo? I can probably have a look at some point as long as I know the correct entry point.

cottrell avatar Feb 14 '19 13:02 cottrell

@cottrell to create a new repo, it should be git bb create my_new_repo

also I just pushed your fix within #198 ☺ thanks @mtfurlan 👍

guyzmo avatar Aug 27 '19 16:08 guyzmo