Closed Bug 720283 Opened 12 years ago Closed 12 years ago

Allow forcing pushes in hgutil

Categories

(Release Engineering :: General, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mjessome, Assigned: mjessome)

Details

Attachments

(1 file, 2 obsolete files)

Allow for forcing a push in hgutils push() and apply_and_push() functions.
Attached patch Force push v1 (obsolete) — Splinter Review
Attachment #590615 - Flags: review?(bhearsum)
Attached patch Force push v2 (obsolete) — Splinter Review
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+
Attached patch Force push v3Splinter Review
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+
Status: NEW → RESOLVED
Closed: 12 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.

Attachment

General

Created:
Updated:
Size: