Skip to content

Commit

Permalink
Use "create_with_history" if TOPIC is defined
Browse files Browse the repository at this point in the history
This fixes #4.
  • Loading branch information
misery committed May 29, 2024
1 parent 17242bb commit 93b4277
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contrib/mercurial_git_push.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def branch(self):
return self._changesets[0].branch()

def summary(self):
if len(self._changesets) > 1:
if self._topic:
return "Topic: " + self._topic
else:
return self._changesets[0].summary()
Expand Down Expand Up @@ -692,7 +692,7 @@ def _create(self):

return c.create(commit_id=self.commit_id,
repository=self.repo,
create_with_history=len(self._changesets) > 1,
create_with_history=self._topic is not None,
submit_as=self.submitter)

def _modified_description(self):
Expand All @@ -712,7 +712,7 @@ def _modified_description(self):
def _commit_id_data(self):
content = []

if len(self._changesets) > 1:
if self._topic:
content.append(self._topic.encode('utf-8'))
content.append(self.submitter.encode('utf-8'))
content.append(six.text_type(self.repo).encode('utf-8'))
Expand Down Expand Up @@ -806,7 +806,7 @@ def __init__(self, root, repo, changeset, base,
def _commit_id_data(self):
content = super(MercurialReviewRequest, self)._commit_id_data()

if len(self._changesets) == 1:
if self._topic is None:
graft = self._changesets[0].graft(False)
if graft:
if six.PY2:
Expand Down

0 comments on commit 93b4277

Please sign in to comment.