2225: post-review does not with git work in windows

tston*****@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 30, 2014
What version are you running?
RBTools 0.3.2
and
post-review.py 0.7

What's the URL of the page containing the problem?
http://reviewboard.googlecode.com/svn/trunk/wxpostreview/postreview.py

What steps will reproduce the problem?
1.On a windows system, install RBTools 0.3.2
2.Make sure git.exe is in the path (and git --help works)
3.Make sure python os.system("git --help") works
3.In an existing git repository, run post-review

What is the expected output? What do you see instead?
Expected: "Unable to find a Review Board server for this source code tree"
Actual: "The current directory does not contain a checkout from a
supported source code repository."

What operating system are you using? What browser?
Windows 7 32 bit and Windows 7 64 bit

Please provide any additional information below.
in python, os.system("git --help") uses the path environment variable, so the command works.  subprocess.Popen, however, does not (by default).  On line 1020 of post-review.py, if you add shell=True, that will use the path and find git.  other than that, you would need a full git path.  Attached is a modified post-review.py that seems to work.  It is based on the file found at http://reviewboard.googlecode.com/svn/trunk/wxpostreview/postreview.py (Aug 9 2011 @ 9 PM PST)
#!/usr/bin/env python
import cookielib
import mimetools
import os
import getpass
import re
import simplejson
import socket
import subprocess
import sys
import urllib2
from optparse import OptionParser
from tempfile import mkstemp
from urlparse import urljoin, urlparse
###
# Default configuration -- user-settable variables follow.
###
# The following settings usually aren't needed, but if your Review
# Board crew has specific preferences and doesn't want to express
# them with command line switches, set them here and you're done.
# In particular, setting the REVIEWBOARD_URL variable will allow
# you to make it easy for people to submit reviews regardless of
# their SCM setup.
# Reviewboard URL.
#
# Set this if you wish to hard-code a default server to always use.
# It's generally recommended to set this on your SCM repository instead
# for those that support it (currently only SVN and Git).
#
# For example, on SVN:
#   $ svn propset reviewboard:ur
david
#1 david
  • +Component-RBTools
david
#2 david
  • +EasyFix
david
#3 david
This is quite old. We now properly test for git.cmd.
  • +Fixed