Mercurial > hg
comparison hgext/convert/cvs.py @ 11987:3145951e50fe stable
convert: use encoding.encoding instead of locale.getpreferredencoding()
The latter may not return useful results in certain OS X environments.
author | Brodie Rao <brodie@bitheap.org> |
---|---|
date | Wed, 18 Aug 2010 10:53:52 -0400 |
parents | 33010ff1fd6f |
children | 516b000fbb7e |
comparison
equal
deleted
inserted
replaced
11986:d2796a3cb816 | 11987:3145951e50fe |
---|---|
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others | 3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others |
4 # | 4 # |
5 # This software may be used and distributed according to the terms of the | 5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. | 6 # GNU General Public License version 2 or any later version. |
7 | 7 |
8 import os, locale, re, socket, errno | 8 import os, re, socket, errno |
9 from cStringIO import StringIO | 9 from cStringIO import StringIO |
10 from mercurial import util | 10 from mercurial import encoding, util |
11 from mercurial.i18n import _ | 11 from mercurial.i18n import _ |
12 | 12 |
13 from common import NoRepo, commit, converter_source, checktool | 13 from common import NoRepo, commit, converter_source, checktool |
14 import cvsps | 14 import cvsps |
15 | 15 |
28 self.tags = {} | 28 self.tags = {} |
29 self.lastbranch = {} | 29 self.lastbranch = {} |
30 self.socket = None | 30 self.socket = None |
31 self.cvsroot = open(os.path.join(cvs, "Root")).read()[:-1] | 31 self.cvsroot = open(os.path.join(cvs, "Root")).read()[:-1] |
32 self.cvsrepo = open(os.path.join(cvs, "Repository")).read()[:-1] | 32 self.cvsrepo = open(os.path.join(cvs, "Repository")).read()[:-1] |
33 self.encoding = locale.getpreferredencoding() | 33 self.encoding = encoding.encoding |
34 | 34 |
35 self._connect() | 35 self._connect() |
36 | 36 |
37 def _parse(self): | 37 def _parse(self): |
38 if self.changeset is not None: | 38 if self.changeset is not None: |