diff --git a/scm.py b/scm.py index 88016dccd..8708c19b0 100644 --- a/scm.py +++ b/scm.py @@ -8,6 +8,7 @@ import cStringIO import glob import logging import os +import platform import re import sys import tempfile @@ -258,6 +259,9 @@ class GIT(object): def GetOldContents(cwd, filename, branch=None): if not branch: branch = GIT.GetUpstreamBranch(cwd) + if platform.system() == 'Windows': + # git show : wants a posix path. + filename = filename.replace('\\', '/') command = ['show', '%s:%s' % (branch, filename)] try: return GIT.Capture(command, cwd=cwd, strip_out=False) diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py index 400ca18c1..8ee3d811a 100755 --- a/tests/scm_unittest.py +++ b/tests/scm_unittest.py @@ -58,6 +58,7 @@ class RootTestCase(BaseSCMTestCase): 'logging', 'only_int', 'os', + 'platform', 're', 'subprocess2', 'sys',