#24 add merge pr
Merged 5 years ago by lenkaseg. Opened 5 years ago by lenkaseg.
lenkaseg/cranc merge_pr  into  master

file modified
+22 -2
@@ -57,6 +57,7 @@ 

          _log.exception("Failed to connect to the server")

  

  

+ # Adding pr_list into the group 'get'

  get.add_command(pr_list)

  

  @click.command(name="issues")
@@ -84,13 +85,32 @@ 

      pprint.pprint(issues)

  

  

- 

+ # Adding issue_list into the group 'get'

  get.add_command(issue_list)

  

+ # Create subgroup 'merge'

+ @click.group()

+ def merge():

+     pass

+ 

+ @click.command(name="pr")

+ @click.option("--request_id")

+ def merge_pr(request_id):

+     """This command merges a pull request"""

+     try:

+         request = PAGURE.merge_request(request_id=request_id)

+         pprint.pprint(request)

+         print("Pull request succesfully merged")

+     except Exception:

+         _log.exception("Failed to connect to the server")

+ 

+ # Adding merge_pr into the group 'merge'

+ merge.add_command(merge_pr)

+ 

  

  ################################################################################

  # General section

  ################################################################################

  

  cranc.add_command(get)

- 

+ cranc.add_command(merge)

run with cranc merge pr

manually tested on pagure.io, works
I wanted to test it on localhost run on docker, but I cannot clone a repo: ssh is not supported in docker localhost

needs tests

Pull-Request has been merged by lenkaseg

5 years ago
Metadata