Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3962 by phil...@gmail.com: Mercurial repositories not usable on Windows Reviewboard install when hg is installed with 'pip'
https://code.google.com/p/reviewboard/issues/detail?id=3962

What version are you running?
  2.0.19

What's the URL of the page containing the problem?
  /reviewboard/r/new/

What steps will reproduce the problem?
1. Install Reviewboard on a Windows server
2. Add a Mercurial repository to Reviewboard
3. Note that the Mercurial repository does not appear in the "New Review Request" screen.

What is the expected output? What do you see instead?
I expect that it be possible to create review requests against the repository, but the repository does not appear in the request list.

Additionally, I get this error in my Apache log:

[Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] ERROR:root:Error loading SCMTool for repository "Test Repository" (ID 2) [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] Traceback (most recent call last): [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] File "c:\\reviewboard\\env\\Lib\\site-packages\\reviewboard-2.0.19-py2.7.egg\\reviewboard\\reviews\\views.py", line 249, in new_review_request [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] scmtool = repo.get_scmtool() [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] File "c:\\reviewboard\\env\\Lib\\site-packages\\reviewboard-2.0.19-py2.7.egg\\reviewboard\\scmtools\\models.py", line 231, in get_scmtool [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] return cls(self) [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] File "c:\\reviewboard\\env\\Lib\\site-packages\\reviewboard-2.0.19-py2.7.egg\\reviewboard\\scmtools\\hg.py", line 28, in __init__ [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] raise ImportError [Wed Sep 09 15:01:14.473213 2015] [wsgi:error] [pid 1752:tid 952] ImportError


What operating system are you using? What browser?
  Windows Server 2008 RC2 server, Windows 7 client, latest Google Chrome

Please provide any additional information below.

On my server system, Mercurial was installed in the virtualenv which hosts Reviewboard. Line 25 of scmtools/hg.py attempts to check whether Mercurial is installed:

        if not is_exe_in_path('hg'):
            # This is technically not the right kind of error, but it's the
            # pattern we use with all the other tools.
            raise ImportError

And djblets.util.filesystem.py : is_exe_in_path(name) implements this thus:

    if sys.platform == 'win32' and not name.endswith('.exe'):
        name += ".exe"

    for dir in os.environ['PATH'].split(os.pathsep):
        if os.path.exists(os.path.join(dir, name)):
            return True

    return False

Clearly this will only work on Windows if the Mercurial executable is a true Windows executable and not a batch file or similar.

The problem is that in my virtualenv (where Mercurial was installed with "pip install mercurial"), the Mercurial binary *is* a batch file (in C:\ReviewBoard\Scripts\hg.bat).

This is not an issue if a Windows Mercurial distribution e.g. TortoiseHg is installed, as this includes a compiled executable to invoke Mercurial.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard-issues+unsubscr...@googlegroups.com.
To post to this group, send email to reviewboard-issues@googlegroups.com.
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to