Closed Bug 1048967 Opened 12 years ago Closed 12 years ago

Allow version info to run from any directory

Categories

(Testing :: Mozbase, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: armenzg, Assigned: armenzg)

Details

Attachments

(1 file)

Attached patch changelog.diffSplinter Review
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: nobody → armenzg
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: