mercurial/localrepo.py
changeset 4829 0403b80352c9
parent 4648 8e503fa54d2d
child 4868 192cd95c2ba8
child 4928 2a7d30c97f89
equal deleted inserted replaced
4828:41ad4105dde9 4829:0403b80352c9
   453         return self._filter("encode", filename, data)
   453         return self._filter("encode", filename, data)
   454 
   454 
   455     def wwrite(self, filename, data, flags):
   455     def wwrite(self, filename, data, flags):
   456         data = self._filter("decode", filename, data)
   456         data = self._filter("decode", filename, data)
   457         if "l" in flags:
   457         if "l" in flags:
   458             f = self.wjoin(filename)
   458             self.wopener.symlink(data, filename)
   459             try:
       
   460                 os.unlink(f)
       
   461             except OSError:
       
   462                 pass
       
   463             d = os.path.dirname(f)
       
   464             if not os.path.exists(d):
       
   465                 os.makedirs(d)
       
   466             os.symlink(data, f)
       
   467         else:
   459         else:
   468             try:
   460             try:
   469                 if self._link(filename):
   461                 if self._link(filename):
   470                     os.unlink(self.wjoin(filename))
   462                     os.unlink(self.wjoin(filename))
   471             except OSError:
   463             except OSError: