Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitbutcket request ls shows more than just open PRs #193

Open
mtfurlan opened this issue Jan 15, 2019 · 5 comments
Open

Bitbutcket request ls shows more than just open PRs #193

mtfurlan opened this issue Jan 15, 2019 · 5 comments

Comments

@mtfurlan
Copy link

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.

@cottrell
Copy link

what is the command to reproduce this from the cli?

@cottrell
Copy link

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'

@mtfurlan
Copy link
Author

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'

@cottrell
Copy link

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.

guyzmo added a commit that referenced this issue Aug 27, 2019
@guyzmo
Copy link
Owner

guyzmo commented Aug 27, 2019

@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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants