Closed
Bug 1049893
Opened 11 years ago
Closed 11 years ago
mach mercurial-setup fail if ~/.hgrc doesn't exist
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla34
People
(Reporter: NinjaTrappeur, Assigned: NinjaTrappeur)
References
Details
(Keywords: regression)
Attachments
(1 file)
1.65 KB,
patch
|
gps
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140722064054
Steps to reproduce:
./mach mercurial-setup without and existing ~/.hgrc
Actual results:
Error running mach:
['mercurial-setup']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
IOError: [Errno 2] No such file or directory: u'/home/***/.hgrc'
File "/home/***/mozilla-central/tools/mercurial/mach_commands.py", line 32, in mercurial_bootstrap
result = wizard.run(map(os.path.expanduser, config_paths))
File "/home/***/mozilla-central/tools/mercurial/hgsetup/wizard.py", line 192, in run
c = MercurialConfig(config_paths)
File "/home/***/mozilla-central/tools/mercurial/hgsetup/config.py", line 45, in __init__
with open(infile, 'r') as f:
Comment 1•11 years ago
|
||
Gah. This is a regression from bug 1047592. Should be a one-liner to check for os.path.exists() before opening the file.
Assignee | ||
Comment 2•11 years ago
|
||
Yes, I fixed it. Since it's the first time I use mercurial I experience some troubles making the patch. Coming soon :)
Comment 3•11 years ago
|
||
If you have any questions, ping me on irc.mozilla.org - I'm gps.
Assignee | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Comment on attachment 8468801 [details] [diff] [review]
Possible patch
Review of attachment 8468801 [details] [diff] [review]:
-----------------------------------------------------------------
Great first patch! I love when people come to the project and fix our tools :)
Note for next time: the commit message should conform to the standards documented at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Committing_Rules_and_Responsibilities. tl;dr "Bug 1049893 - Fix mach mercurial-setup when no ~/.hgrc file exists"
You also need to explicitly request review from someone by setting the "review" flag to ? and typing the name of a reviewer.
These processes are far from intuitive and most people get part of them wrong. So don't feel bad.
I'll land this in the next few minutes. You should see a URL added to the bug corresponding to the landing. You won't need to do anything else.
::: tools/mercurial/hgsetup/config.py
@@ +41,5 @@
>
> # Mercurial configuration files allow an %include directive to include
> # other files, this is not supported by ConfigObj, so throw a useful
> # error saying this.
> + if(os.path.isfile(infile)):
Nit: you don't need braces in Python.
Other than that, this diff is correct!
Attachment #8468801 -
Flags: review+
Comment 6•11 years ago
|
||
Comment 7•11 years ago
|
||
Assignee: nobody → baylac.felix
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Updated•10 years ago
|
QA Whiteboard: [qa-]
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•