Skip to content

Commit

Permalink
Add support for TREES of .reviewboardrc in RBT 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
misery committed Jan 9, 2025
1 parent d3be692 commit c1c0103
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion contrib/mercurial_git_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
match_mimetype,
parse_mimetype)

if rbversion >= '5.1':
from rbtools.commands.base.errors import NeedsReinitialize

MAX_MERGE_ENTRIES = 30

FAKE_DIFF_TEMPL = b'''diff --git /a /b
Expand Down Expand Up @@ -1224,6 +1227,9 @@ class MercurialGitHookCmd(BaseCommand):

def __init__(self):
super(MercurialGitHookCmd, self).__init__()
self.exec()

def exec(self):
parser = self.create_arg_parser([])
self.options = parser.parse_args([])

Expand Down Expand Up @@ -1671,7 +1677,15 @@ def _set_root(self):
cmd = MercurialGitHookCmd()
try:
if rbversion >= '3':
cmd.initialize()
if rbversion >= '5.1':
try:
cmd.initialize()
except NeedsReinitialize:
cmd.exec()
cmd.initialize()
else:
cmd.initialize()

self.root = cmd.api_root
global SERVER
SERVER = cmd.get_capabilities(self.root)
Expand Down

0 comments on commit c1c0103

Please sign in to comment.