Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
5671281f
Commit
5671281f
authored
Feb 14, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various Python 3 fixes
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
fd6c84d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
weblate/trans/tests/test_remote.py
weblate/trans/tests/test_remote.py
+1
-0
weblate/trans/vcs.py
weblate/trans/vcs.py
+7
-5
No files found.
weblate/trans/tests/test_remote.py
View file @
5671281f
...
@@ -29,6 +29,7 @@ from django.utils import timezone
...
@@ -29,6 +29,7 @@ from django.utils import timezone
from
weblate.trans.models
import
SubProject
from
weblate.trans.models
import
SubProject
from
weblate.trans.tests.test_models
import
REPOWEB_URL
from
weblate.trans.tests.test_models
import
REPOWEB_URL
from
weblate.trans.tests.test_views
import
ViewTestCase
from
weblate.trans.tests.test_views
import
ViewTestCase
from
weblate.trans.vcs
import
HgRepository
EXTRA_PO
=
'''
EXTRA_PO
=
'''
#: accounts/models.py:319 trans/views/basic.py:104 weblate/html/index.html:21
#: accounts/models.py:319 trans/views/basic.py:104 weblate/html/index.html:21
...
...
weblate/trans/vcs.py
View file @
5671281f
...
@@ -33,6 +33,7 @@ import subprocess
...
@@ -33,6 +33,7 @@ import subprocess
from
dateutil
import
parser
from
dateutil
import
parser
import
six
from
six.moves.configparser
import
RawConfigParser
from
six.moves.configparser
import
RawConfigParser
from
weblate.trans.util
import
get_clean_env
,
add_configuration_error
from
weblate.trans.util
import
get_clean_env
,
add_configuration_error
...
@@ -325,7 +326,7 @@ class Repository(object):
...
@@ -325,7 +326,7 @@ class Repository(object):
with
open
(
real_path
,
'rb'
)
as
handle
:
with
open
(
real_path
,
'rb'
)
as
handle
:
data
=
handle
.
read
()
data
=
handle
.
read
()
objhash
.
update
(
'blob {0}
\
0
'
.
format
(
len
(
data
)))
objhash
.
update
(
'blob {0}
\
0
'
.
format
(
len
(
data
))
.
encode
(
'ascii'
)
)
objhash
.
update
(
data
)
objhash
.
update
(
data
)
return
objhash
.
hexdigest
()
return
objhash
.
hexdigest
()
...
@@ -773,9 +774,10 @@ class HgRepository(Repository):
...
@@ -773,9 +774,10 @@ class HgRepository(Repository):
"""
"""
section, option = path.split('
.
', 1)
section, option = path.split('
.
', 1)
filename = os.path.join(self.path, '
.
hg
', '
hgrc
')
filename = os.path.join(self.path, '
.
hg
', '
hgrc
')
value = value.encode('
utf
-
8
')
if six.PY2:
section = section.encode('
utf
-
8
')
value = value.encode('
utf
-
8
')
option = option.encode('
utf
-
8
')
section = section.encode('
utf
-
8
')
option = option.encode('
utf
-
8
')
config = RawConfigParser()
config = RawConfigParser()
config.read(filename)
config.read(filename)
if not config.has_section(section):
if not config.has_section(section):
...
@@ -784,7 +786,7 @@ class HgRepository(Repository):
...
@@ -784,7 +786,7 @@ class HgRepository(Repository):
config.get(section, option) == value):
config.get(section, option) == value):
return
return
config.set(section, option, value)
config.set(section, option, value)
with open(filename, '
w
b
') as handle:
with open(filename, '
w
') as handle:
config.write(handle)
config.write(handle)
def set_committer(self, name, mail):
def set_committer(self, name, mail):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment