X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/115d9ab4d4ca222139e5b0db87e59248bfb6410e..4251322e9eb5dfbe3ab182fecaafd4c7a5a85b83:/lib/hg.py diff --git a/lib/hg.py b/lib/hg.py index a2702f6c..e785b375 100644 --- a/lib/hg.py +++ b/lib/hg.py @@ -3,10 +3,8 @@ import os import codecs from mercurial import localrepo, ui, error, match, node, encoding - encoding.encoding = 'utf-8' - class RepositoryDoesNotExist(Exception): pass @@ -75,7 +73,7 @@ class Repository(object): # will commit all keys pending_files = self._pending_files else: - if key not in self._pending_files: + if keys not in self._pending_files: # key isn't changed return None else: @@ -97,6 +95,9 @@ class Repository(object): self.repo.forget(files_to_remove) # ---- hg commit if files_to_commit: + for i, f in enumerate(files_to_commit): + if isinstance(f, unicode): + files_to_commit[i] = f.encode('utf-8') matcher = match.match(self.repo.root, self.repo.root, files_to_commit, default='path') rev = self.repo.commit(message, user=user, match=matcher) commited = True @@ -107,4 +108,4 @@ class Repository(object): # reread keys # self._keys = self.get_persisted_objects_keys() # return node.hex(rev) - \ No newline at end of file +