Closed Bug 1413922 Opened 2 years ago Closed Last year

[tryselect] Merge vcs.py into mozversioncontrol

Categories

(Testing :: General, enhancement)

enhancement
Not set

Tracking

(firefox-esr60 fixed, firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox-esr60 --- fixed
firefox63 --- fixed

People

(Reporter: ahal, Assigned: ahal)

References

Details

Attachments

(3 files, 1 obsolete file)

We should consolidate all our vcs code into a single module. This means merging the vcs related functionality in tools/tryselect/vcs.py into python/mozversioncontrol.
Most HG commands use subprocesses, even if a context manager (and therefore an
hglib client) has been created. There are only two commands that make use of
the client, but they *only* work inside a context manager. I don't think
there are any technical reason these two commands *need* to use the context
manager.

This patch merges the HgRepository._run_in_client function with
HgRepository._run(). If a client exists, that will be used, otherwise a
subprocess will be used.
Most HG commands use subprocesses, even if a context manager (and therefore an
hglib client) has been created. There are only two commands that make use of
the client, but they *only* work inside a context manager. I don't think
there are any technical reason these two commands *need* to use the context
manager.

This patch merges the HgRepository._run_in_client function with
HgRepository._run(). If a client exists, that will be used, otherwise a
subprocess will be used.
Comment on attachment 8987597 [details]
Bug 1413922 - [mozversioncontrol] Always use hglib.client if available and fall back to subprocesses if not, r?gps

Gregory Szorc [:gps] has approved the revision.

https://phabricator.services.mozilla.com/D1809
Attachment #8987597 - Flags: review+
This moves all version control logic out of tools/tryselect and into
python/mozversioncontrol. The 'push_to_try' function is a bit different as we
want it's output to be streamed to stdout rather than being captured. For this
reason it uses 'subprocess.check_call' directly instead of calling 'self._run'.

Depends on D1816.
Attachment #8987952 - Attachment is obsolete: true
Assignee: nobody → ahal
Status: NEW → ASSIGNED
Attachment #8987606 - Attachment is obsolete: true
Attachment #8987952 - Attachment filename: phabricator-D1839-url.txt → phabricator-D1808-url.txt
Sorry, this was my first attempt at phabricator and I definitely bungled it. Somehow the second attachment got lost in the bug here, but I've fixed your issues at:
https://phabricator.services.mozilla.com/D1808

Not sure if it's in your bugzilla queue or not, so needinfo'ing just in case.
Flags: needinfo?(gps)
Attachment #8987952 - Attachment description: Bug 1413922 - [tryselect] Merge vcs.py into mozversioncontrol, r?gps → Bug 1413922 - [tryselect] Merge vcs.py into mozversioncontrol
Attachment #8987952 - Attachment is obsolete: false
Attachment #8987952 - Attachment is obsolete: true
And it's back. I have no idea how I managed to do all this :p. I'll leave the needinfo just in case.
Blocks: 1471990
Attachment #8987952 - Attachment is obsolete: false
Attachment #8987952 - Attachment is obsolete: true
Comment on attachment 8987952 [details]
Bug 1413922 - [tryselect] Merge vcs.py into mozversioncontrol

Gregory Szorc [:gps] has approved the revision.

https://phabricator.services.mozilla.com/D1808
Attachment #8987952 - Attachment is obsolete: false
Attachment #8987952 - Flags: review+
Attachment #8987961 - Flags: review+
Comment on attachment 8987961 [details]
Bug 1413922 - [tryselect] Merge vcs.py into mozversioncontrol

Gregory Szorc [:gps] has approved the revision.

https://phabricator.services.mozilla.com/D1808
I think my review addressed the needinfo.
Flags: needinfo?(gps)
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b3bead1f5729
[mozversioncontrol] Always use hglib.client if available and fall back to subprocesses if not, r=gps
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e7a1d749ff9a
[tryselect] Merge vcs.py into mozversioncontrol r=gps
https://hg.mozilla.org/mozilla-central/rev/b3bead1f5729
https://hg.mozilla.org/mozilla-central/rev/e7a1d749ff9a
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Depends on: 1474469
Looks like we just need to s/_run_in_client/_run/g in langpack_manifest.py. Since all instances happen inside the context manager, the _run function will automatically use the client to handle the command. Though ideally we should either make _run a public interface or not use it directly from external consumers.
Attachment #8987606 - Attachment is obsolete: false
Attachment #8987952 - Attachment is obsolete: true
Attachment #8987606 - Attachment is obsolete: true
Attachment #8987952 - Attachment is obsolete: false
Attachment #8987952 - Attachment is obsolete: true
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0facbb3ab290
[mozversioncontrol] Always use hglib.client if available and fall back to subprocesses if not, r=gps
Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/992f33d04e60
[tryselect] Merge vcs.py into mozversioncontrol r=gps
Attachment #8987952 - Attachment is obsolete: false
https://hg.mozilla.org/mozilla-central/rev/0facbb3ab290
https://hg.mozilla.org/mozilla-central/rev/992f33d04e60
Status: REOPENED → RESOLVED
Closed: Last yearLast year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Depends on: 1475649
You need to log in before you can comment on or make changes to this bug.