Allow version info to run from any directory

RESOLVED FIXED in mozilla34

Status

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: armenzg, Assigned: armenzg)

Tracking

unspecified
mozilla34
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Created attachment 8467858 [details] [diff] [review]
changelog.diff

If I'm inside of mozdevice, then it tries to run hg log mozdevice/setup.py ... which is a non-existent file from my current working directory.

This patch does the trick.
Attachment #8467858 - Flags: review?(ahalberstadt)
Comment on attachment 8467858 [details] [diff] [review]
changelog.diff

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

Looks good, just a couple of optional comments. Thanks!

::: testing/mozbase/versioninfo.py
@@ +94,5 @@
>  
>  
>  def main(args=sys.argv[1:]):
> +    abspath = os.path.abspath(__file__)
> +    dname = os.path.dirname(abspath)

This is fine, but just fyi a common convention we use throughout many of our automation files is to put:

here = os.path.abspath(os.path.dirname(__file__))

at the top of the file.

@@ +95,5 @@
>  
>  def main(args=sys.argv[1:]):
> +    abspath = os.path.abspath(__file__)
> +    dname = os.path.dirname(abspath)
> +    os.chdir(dname)

Instead of os.chdir, I would probably pass it in to the subprocess.check_output call via the 'cwd' parameter.
Attachment #8467858 - Flags: review?(ahalberstadt) → review+
(Assignee)

Comment 2

4 years ago
Addressed comments and landed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9fc1fd2a2818

Thanks ahal.
(Assignee)

Updated

4 years ago
Assignee: nobody → armenzg
https://hg.mozilla.org/mozilla-central/rev/9fc1fd2a2818
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.