encoding.encoding = 'utf-8'
-
+def clearpath(path):
+ return unicode(path).encode("utf-8")
class Repository(object):
"""Abstrakcja repozytorium Mercurial. DziaĆa z Mercurial w wersji 1.3.1."""
return self.in_branch(lambda: self._get_file(path), branch)
def _get_file(self, path):
+ path = clearpath(path)
+
if not self._file_exists(path):
raise RepositoryException("File not availble in this branch.")
return self.in_branch(lambda: self._file_exists(path), branch)
def _file_exists(self, path):
+ path = clearpath(path)
return self.repo.dirstate[path] != "?"
def write_file(self, path, value, branch):
return self.in_branch(lambda: self._write_file(path, value), branch)
- def _write_file(self, path, value):
+ def _write_file(self, path, value):
+ path = clearpath(path)
return self.repo.wwrite(path, value, [])
def add_file(self, path, value, branch):
return self.in_branch(lambda: self._add_file(path, value), branch)
def _add_file(self, path, value):
+ path = clearpath(path)
self._write_file(path, value)
return self.repo.add( [path] )