Closed Bug 508955 Opened 15 years ago Closed 14 years ago

Add to client.py --hg-clone-options

Categories

(MailNews Core :: Build Config, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.1b1

People

(Reporter: gozer, Assigned: gozer)

References

Details

Attachments

(1 file)

Right now, you can use --hg-options to pass arbitrary extra options to hg invocations. Unfotunately, in some cases, it would be nice to pass an option only to clone operations, so this patch adds support for --hg-clone-options.

The reason I am asking for this is that when you have the hg server on the same LAN as the machine running hg clone (i.e. a local hg mirror), you can dramatically increase the speed of the clone by passing --uncompressed to hg clone.

I want to start testing this out, and the only clean way to do that via buildbot is if client.py had such an option.
Attachment #393115 - Flags: review? → review?(kairo)
Comment on attachment 393115 [details] [diff] [review]
client.py --hg-clone-options

>     # Locally clone common repository history.
>-    check_call_noisy([options.hg, 'clone', '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path])
>+    check_call_noisy([options.hg, 'clone', hgcloneopts, '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path])

>     if not os.path.exists(fulldir):
>         fulldir = os.path.join(topsrcdir, dir)
>-        check_call_noisy([hg, 'clone'] + hgopts + [repository, fulldir])
>+        check_call_noisy([hg, 'clone'] + hgcloneopts + hgopts + [repository, fulldir])

You're inconsistent in how to add the options to the call, please fix that (not that I like us mixing the conventions there in the first place but my python foo is too weak to know if/why that is necessary).

With that made consistent, r=me.
Attachment #393115 - Flags: review?(kairo) → review+
gozer, fell through the cracks?

Do you plan on updating/pushing this?
(In reply to comment #3)
> gozer, fell through the cracks?

Indeed.

> Do you plan on updating/pushing this?

pushing to ssh://hg.mozilla.org/comm-central
changeset:   4839:bb438fe036d2
tag:         tip
user:        Philippe M. Chiasson <gozer@mozillamessaging.com>
date:        Fri Feb 05 11:08:45 2010 -0500
summary:     Bug 508955 - Add to client.py --hg-clone-options r=kairo
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee: nobody → gozer
Severity: normal → enhancement
Flags: in-testsuite-
Product: Thunderbird → MailNews Core
QA Contact: build-config → build-config
Target Milestone: --- → Thunderbird 3.1b1
Comment on attachment 393115 [details] [diff] [review]
client.py --hg-clone-options

Wrt your checkin:

>diff --git a/client.py b/client.py
>@@ -122,28 +122,32 @@ def move_to_stable():
>+    
>+    hgcloneopts = []
>+    if options.hgcloneopts:
>+        hgcloneopts = options.hgcloneopts.split()

Either this is not needed anymore,

>-    check_call_noisy([options.hg, 'clone', '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path])
>+    check_call_noisy([options.hg, 'clone', hgcloneopts, '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path])

or you missed to re-add hgcloneopts at the right place.
(In reply to comment #5)
> (From update of attachment 393115 [details] [diff] [review])
> Wrt your checkin:
> 
> >diff --git a/client.py b/client.py
> >@@ -122,28 +122,32 @@ def move_to_stable():
> >+    
> >+    hgcloneopts = []
> >+    if options.hgcloneopts:
> >+        hgcloneopts = options.hgcloneopts.split()
> 
> Either this is not needed anymore,
> 
> >-    check_call_noisy([options.hg, 'clone', '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path])
> >+    check_call_noisy([options.hg, 'clone', hgcloneopts, '-r', MOZILLA_BASE_REV] + hgopts + [mozilla_trunk_path, mozilla_path])
> 
> or you missed to re-add hgcloneopts at the right place.

I missed re-adding hgcloneopts at that hg clone invocation, when un-bitrotting that patch. Good catch.

searching for changes
changeset:   4936:415147d48e3b
tag:         tip
user:        Philippe M. Chiasson <gozer@mozillamessaging.com>
date:        Wed Feb 17 12:41:41 2010 -0500
summary:     Bug 508955. Missed one instance of hgcloneopts when un-bitrotting the original patch.
(In reply to comment #6)

Argh, you add it back where it was: comment 2 still applies...
(In reply to comment #7)
> (In reply to comment #6)
> 
> Argh, you add it back where it was: comment 2 still applies...

yea, if hgcloneopts is an array we need it added via + outside of the array (where you added it in changeset 4935 above.)
Ah, missed comment 2, is this what you would be looking for ?

diff --git a/client.py b/client.py
--- a/client.py
+++ b/client.py
@@ -232,7 +232,7 @@
         return
 
     # Locally clone common repository history.
-    check_call_noisy([options.hg, 'clone', hgcloneopts, '-r', SWITCH_MOZILLA_BASE_REV] + hgopts + [backup_mozilla_path, mozilla_path],
+    check_call_noisy([options.hg, 'clone', '-r', SWITCH_MOZILLA_BASE_REV] + hgcloneopts + hgopts + [backup_mozilla_path, mozilla_path],
                      retryMax=options.retries)
 
     # Rewrite hgrc for new local mozilla repo based on pre-existing hgrc
Finally adressed correctly

changeset:   4943:8c50713ab30c
tag:         tip
user:        Philippe M. Chiasson <gozer@mozillamessaging.com>
date:        Wed Feb 17 15:24:59 2010 -0500
summary:     Bug 508955. Address comment #2 in proper handling of hg clone options. r=Callek
Attachment #393115 - Flags: approval-thunderbird3.0.4?
Comment on attachment 393115 [details] [diff] [review]
client.py --hg-clone-options

Please make sure all parts make it in in one go.
Attachment #393115 - Flags: approval-thunderbird3.0.4? → approval-thunderbird3.0.4+
Comment on attachment 393115 [details] [diff] [review]
client.py --hg-clone-options

I take that back, if someone can post a complete, unbitrotted patch, then we can consider it for 1.9.1 branch.

As it is, I'm not going to try and unbitrot this for 3.0.4.
Attachment #393115 - Flags: approval-thunderbird3.0.4+ → approval-thunderbird3.0.4-
(In reply to comment #12)

I filed bug 552955...
You need to log in before you can comment on or make changes to this bug.