Add jjui
This commit is contained in:
parent
b16db77f04
commit
2951e81a77
3 changed files with 25 additions and 5 deletions
|
@ -209,17 +209,15 @@ elif sys.argv[1] in ("merge", "mr"):
|
|||
to_glab()
|
||||
elif sys.argv[2] == "checkout":
|
||||
# Bypass the original checkout command so it doesn't run git commands.
|
||||
# If there's no commit on the branch, add one with the MR title
|
||||
# so jj has a current bookmark.
|
||||
mr = glab_get_mr(sys.argv[3])
|
||||
jj.run("git", "fetch")
|
||||
jj.run("new", mr.source_branch)
|
||||
# If there's no commit on the branch, add one with the MR title
|
||||
# so jj has a current bookmark.
|
||||
if len(jj.log(f"{mr.source_branch} | {mr.target_branch}")) == 1:
|
||||
title = re.sub(r"^(WIP|Draft): ", "", mr.title)
|
||||
jj.run("new", mr.source_branch)
|
||||
jj.run("describe", "-m", title)
|
||||
jj.run("bookmark", "move", mr.source_branch)
|
||||
else:
|
||||
jj.run("edit", mr.source_branch)
|
||||
elif sys.argv[2] in (
|
||||
# If no MR number/branch is given, insert the current bookmark,
|
||||
# as the current branch concept doesn't exist in jj
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue