changeset 4948:c8d1aa1822d5

Print meaningful error message if os.symlink fails
author Bryan O'Sullivan <bos@serpentine.com>
date Thu, 19 Jul 2007 15:29:33 -0700
parents 3e25a6eb5c9a
children 2f0f9528e77b
files mercurial/util.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Thu Jul 19 15:13:48 2007 -0700
+++ b/mercurial/util.py	Thu Jul 19 15:29:33 2007 -0700
@@ -1303,7 +1303,11 @@
             os.makedirs(dirname)
 
         if self._can_symlink:
-            os.symlink(src, linkname)
+            try:
+                os.symlink(src, linkname)
+            except OSError, err:
+                raise OSError(err.errno, _('could not symlink to %r: %s') %
+                              (src, err.strerror), linkname)
         else:
             f = self(self, dst, "w")
             f.write(src)