Allow forcing pushes in hgutil

RESOLVED FIXED

Status

Release Engineering
General
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: mjessome, Assigned: mjessome)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

7 years ago
Allow for forcing a push in hgutils push() and apply_and_push() functions.
(Assignee)

Comment 1

7 years ago
Created attachment 590615 [details] [diff] [review]
Force push v1
Attachment #590615 - Flags: review?(bhearsum)
(Assignee)

Comment 2

7 years ago
Created attachment 590617 [details] [diff] [review]
Force push v2

I forgot to take out two commented lines in the tests, so here is v2.
Attachment #590615 - Attachment is obsolete: true
Attachment #590615 - Flags: review?(bhearsum)
Attachment #590617 - Flags: review?(bhearsum)
Comment on attachment 590617 [details] [diff] [review]
Force push v2

Review of attachment 590617 [details] [diff] [review]:
-----------------------------------------------------------------

::: lib/python/mozilla_buildtools/test/test_util_hg.py
@@ +222,5 @@
>                            push_new_branches=False)
>  
> +    def testPushWithForce(self):
> +        clone(self.repodir, self.wc, revision=self.revisions[0], clone_by_rev=True)
> +        push(self.repodir, self.wc, push_new_branches=False, force=False)

Hmmm, this is actually pushing _without_ force, which makes it more or less the same as http://hg.mozilla.org/build/tools/file/29a930fe1eb6/lib/python/buildtools/test/test_util_hg.py#l194

Can you modify this to: a) use force=True, b) modify the original repository in such a way that a push won't work without being forced. The original repository looks like this:
        0 (default)
       / \
      1   2 (default)
(branch2)

And the new repository just has revision 0. So, if you create a second commit on the default branch of the new repository, pushing back to the original will fail without force, because you'd be creating new heads.

Additionally, a test with the same set-up with force=False would be good - to make sure that you _can't_ push things like that without force=True.

Looks good otherwise. r=me with those changes.
Attachment #590617 - Flags: review?(bhearsum) → review+
(Assignee)

Comment 4

7 years ago
Created attachment 590707 [details] [diff] [review]
Force push v3
Attachment #590617 - Attachment is obsolete: true
Attachment #590707 - Flags: review?(bhearsum)
Comment on attachment 590707 [details] [diff] [review]
Force push v3

Review of attachment 590707 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good! I landed this.
Attachment #590707 - Flags: review?(bhearsum)
Attachment #590707 - Flags: review+
Attachment #590707 - Flags: checked-in+
(Assignee)

Updated

7 years ago
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
You need to log in before you can comment on or make changes to this bug.