Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/localrepo.py @ 4007:20da40cc1c73
symlinks: minimal support for symlinks in merge/update
This will get angry, confused, and sad if you try to merge a symlink
with a regular file.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 29 Dec 2006 20:04:31 -0600 |
parents | 67982d3ee76c |
children | dfe87137ed14 c3864dfb7812 |
comparison
equal
deleted
inserted
replaced
4006:67982d3ee76c | 4007:20da40cc1c73 |
---|---|
506 return self._filter("encode", filename, data) | 506 return self._filter("encode", filename, data) |
507 | 507 |
508 def wwrite(self, filename, data, flags): | 508 def wwrite(self, filename, data, flags): |
509 data = self._filter("decode", filename, data) | 509 data = self._filter("decode", filename, data) |
510 if "l" in flags: | 510 if "l" in flags: |
511 os.unlink(self.wjoin(filename)) | 511 try: |
512 os.unlink(self.wjoin(filename)) | |
513 except OSError: | |
514 pass | |
512 os.symlink(data, self.wjoin(filename)) | 515 os.symlink(data, self.wjoin(filename)) |
513 else: | 516 else: |
514 try: | 517 try: |
515 if self._link(filename): | 518 if self._link(filename): |
516 os.unlink(self.wjoin(filename)) | 519 os.unlink(self.wjoin(filename)) |