Mercurial > hg
comparison mercurial/localrepo.py @ 4868:192cd95c2ba8
merge with crew-stable
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Wed, 11 Jul 2007 20:15:03 -0300 |
parents | 1f3742217a76 0403b80352c9 |
children | d69b1fb111b9 |
comparison
equal
deleted
inserted
replaced
4867:8be7ba425621 | 4868:192cd95c2ba8 |
---|---|
458 return self._filter("encode", filename, data) | 458 return self._filter("encode", filename, data) |
459 | 459 |
460 def wwrite(self, filename, data, flags): | 460 def wwrite(self, filename, data, flags): |
461 data = self._filter("decode", filename, data) | 461 data = self._filter("decode", filename, data) |
462 if "l" in flags: | 462 if "l" in flags: |
463 f = self.wjoin(filename) | 463 self.wopener.symlink(data, filename) |
464 try: | |
465 os.unlink(f) | |
466 except OSError: | |
467 pass | |
468 d = os.path.dirname(f) | |
469 if not os.path.exists(d): | |
470 os.makedirs(d) | |
471 os.symlink(data, f) | |
472 else: | 464 else: |
473 try: | 465 try: |
474 if self._link(filename): | 466 if self._link(filename): |
475 os.unlink(self.wjoin(filename)) | 467 os.unlink(self.wjoin(filename)) |
476 except OSError: | 468 except OSError: |