# HG changeset patch # User Sean Farley # Date 1395678051 18000 # Node ID e74fad41077b50459be29d718d73a050f25259e9 # Parent c791efb7082a01ec9596d65cae47b9fdd499eb6a svnmeta: copy util.getmessage to here so we can refactor This doesn't do anything currently but will be used in upcoming patches to refactor the call to ui.config. diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -366,6 +366,20 @@ class SVNMeta(object): def taglocations(self): return self.layoutobj.taglocations(self.metapath) + def getmessage(self, rev): + msg = rev.message + + if msg: + try: + msg.decode('utf-8') + return msg + + except UnicodeDecodeError: + # ancient svn failed to enforce utf8 encoding + return msg.decode('iso-8859-1').encode('utf-8') + else: + return self.ui.config('hgsubversion', 'defaultmessage', '') + def get_path_tag(self, path): """If path could represent the path to a tag, returns the potential (non-empty) tag name. Otherwise, returns None