2765: post-review does not use ~/.hgrc (post-review won't post)

waynej******@gmai***** (Google Code) (Is this you? Claim this profile.)
Aug. 14, 2013
1708
This issue (http://code.google.com/p/reviewboard/issues/detail?id=1708) has the same root cause.

I haven't been able to nail down why post-review doesn't use the users' hgrc, but I have figured out an interim solution. In utils/process.py, starting in line 68 you can modify it to:


    if split_lines:
        data = p.stdout.readlines()
        if ignore_errors:
            data = filter(lambda x: not x.startswith('Not trusting file'),
                          data)
    else:
        data = p.stdout.read()
        if ignore_errors:
            data = '\n'.join(filter(lambda x: not x.startswith('Not trusting file'),
                             data.split('\n')))


And that will fix issues with 'Not trusting file' breaking commands that aren't looking for it. In my case it was breaking the very act of trying to post a review.
#1 waynej******@gmai***** (Google Code) (Is this you? Claim this profile.)
It looks like it has everything to do with setting the environment: 


(Pdb) subprocess.check_output(['hg', 'root'])
'/path/to/repo\n'
(Pdb) subprocess.check_output(['hg', 'root'], env=os.environ)
Not trusting file /path/to/repo/.hg/hgrc from untrusted user root, group vboxsf
Not trusting file /path/to/repo/.hg/hgrc from untrusted user root, group vboxsf
'/path/to/repo\n'
david
#2 david
  • +Component-RBTools
david
#3 david
Combining this with another, similar bug.