summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorRenaud Paquay <rpaquay@google.com>2016-11-01 11:24:03 -0700
committerDavid Pursehouse <dpursehouse@collab.net>2017-05-29 19:30:34 +0900
commitd5cec5e752821ca2710101b626b3a3ca07fdb7f8 (patch)
tree4ecee491de2d3d57b4d03f526701c8c06a133b17 /manifest_xml.py
parent2e7029116204cf2d6f516e4514091f0b492bc689 (diff)
downloadgit-repo-d5cec5e752821ca2710101b626b3a3ca07fdb7f8.tar.gz
Add support for creating symbolic links on Windows
Replace all calls to os.symlink with platform_utils.symlink. The Windows implementation calls into the CreateSymbolicLinkW Win32 API, as os.symlink is not supported. Separate the Win32 API definitions into a separate module platform_utils_win32 for clarity. Change-Id: I0714c598664c2df93383734e609d948692c17ec5
Diffstat (limited to 'manifest_xml.py')
-rw-r--r--manifest_xml.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 55d25a79..05651c6c 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -32,6 +32,7 @@ else:
32import gitc_utils 32import gitc_utils
33from git_config import GitConfig 33from git_config import GitConfig
34from git_refs import R_HEADS, HEAD 34from git_refs import R_HEADS, HEAD
35import platform_utils
35from project import RemoteSpec, Project, MetaProject 36from project import RemoteSpec, Project, MetaProject
36from error import ManifestParseError, ManifestInvalidRevisionError 37from error import ManifestParseError, ManifestInvalidRevisionError
37 38
@@ -166,7 +167,7 @@ class XmlManifest(object):
166 try: 167 try:
167 if os.path.lexists(self.manifestFile): 168 if os.path.lexists(self.manifestFile):
168 os.remove(self.manifestFile) 169 os.remove(self.manifestFile)
169 os.symlink(os.path.join('manifests', name), self.manifestFile) 170 platform_utils.symlink(os.path.join('manifests', name), self.manifestFile)
170 except OSError as e: 171 except OSError as e:
171 raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e))) 172 raise ManifestParseError('cannot link manifest %s: %s' % (name, str(e)))
172 173