Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 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 | 001e8a745834 |
children | 02b127749dc0 |
comparison
equal
deleted
inserted
replaced
4947:3e25a6eb5c9a | 4948:c8d1aa1822d5 |
---|---|
1301 dirname = os.path.dirname(linkname) | 1301 dirname = os.path.dirname(linkname) |
1302 if not os.path.exists(dirname): | 1302 if not os.path.exists(dirname): |
1303 os.makedirs(dirname) | 1303 os.makedirs(dirname) |
1304 | 1304 |
1305 if self._can_symlink: | 1305 if self._can_symlink: |
1306 os.symlink(src, linkname) | 1306 try: |
1307 os.symlink(src, linkname) | |
1308 except OSError, err: | |
1309 raise OSError(err.errno, _('could not symlink to %r: %s') % | |
1310 (src, err.strerror), linkname) | |
1307 else: | 1311 else: |
1308 f = self(self, dst, "w") | 1312 f = self(self, dst, "w") |
1309 f.write(src) | 1313 f.write(src) |
1310 f.close() | 1314 f.close() |
1311 | 1315 |