Skip to content

Commit

Permalink
[Fix] get_branch_status secondary status is now a list
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed Feb 17, 2018
1 parent 6f3b372 commit 5cffb7d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
20 changes: 12 additions & 8 deletions github/commands/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,18 @@ def run_async(self):
else:
status, secondary = self.get_branch_status()
if secondary:
sublime.message_dialog(
"Your current branch is different from its remote counterpart. %s" % secondary)
else:
owner = github.parse_remote(self.get_remotes()[remote_branch.remote]).owner
self.open_comparision_in_browser(
owner,
remote_branch.name
)
secondary = "\n".join(secondary)
if "ahead" in secondary or "behind" in secondary:
sublime.message_dialog(
"Your current branch is different from its remote counterpart.\n" +
secondary)
return

owner = github.parse_remote(self.get_remotes()[remote_branch.remote]).owner
self.open_comparision_in_browser(
owner,
remote_branch.name
)

def open_comparision_in_browser(self, owner, branch):
base_remote = github.parse_remote(self.get_integrated_remote_url())
Expand Down
26 changes: 15 additions & 11 deletions gitlab/commands/merge_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,21 @@ def open_mr_in_browser(self):
# remote_branch = self.get_active_remote_branch()
# if not remote_branch:
# sublime.message_dialog("Unable to determine remote.")
# else:
# status, secondary = self.get_branch_status()
# if secondary:
# sublime.message_dialog(
# "Your current branch is different from its remote counterpart. %s" % secondary)
# else:
# owner = github.parse_remote(self.get_remotes()[remote_branch.remote]).owner
# self.open_comparision_in_browser(
# owner,
# remote_branch.name
# )
# else:
# status, secondary = self.get_branch_status()
# if secondary:
# secondary = "\n".join(secondary)
# if "ahead" in secondary or "behind" in secondary:
# sublime.message_dialog(
# "Your current branch is different from its remote counterpart.\n" +
# secondary)
# return

# owner = github.parse_remote(self.get_remotes()[remote_branch.remote]).owner
# self.open_comparision_in_browser(
# owner,
# remote_branch.name
# )

# def open_comparision_in_browser(self, owner, branch):
# base_remote = github.parse_remote(self.get_integrated_remote_url())
Expand Down

0 comments on commit 5cffb7d

Please sign in to comment.