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
8c416436
Commit
8c416436
authored
Nov 13, 2014
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement config editing for mercurial
Issue #511 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
6bbb522c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
weblate/trans/tests/test_vcs.py
weblate/trans/tests/test_vcs.py
+4
-1
weblate/trans/vcs.py
weblate/trans/vcs.py
+9
-3
No files found.
weblate/trans/tests/test_vcs.py
View file @
8c416436
...
...
@@ -259,7 +259,10 @@ class VCSHgTest(VCSGitTest):
return
def
test_set_committer
(
self
):
return
self
.
repo
.
set_committer
(
'Foo Bar'
,
'foo@example.net'
)
self
.
assertEqual
(
self
.
repo
.
get_config
(
'ui'
,
'username'
),
'Foo Bar <foo@example.net>'
)
def
test_revision
(
self
):
return
...
...
weblate/trans/vcs.py
View file @
8c416436
...
...
@@ -24,6 +24,7 @@ import subprocess
import
os.path
import
email.utils
import
re
import
ConfigParser
from
dateutil
import
parser
from
weblate.trans.util
import
get_clean_env
...
...
@@ -550,10 +551,15 @@ class HgRepository(Repository):
def set_config(self, section, key, value):
"""
Set entry in local configuration.
TODO: Need to edit INI file
"""
self.execute(['
config
', section, key, value])
filename = os.path.join(self.path, '
.
hg
', '
hgrc
')
config = ConfigParser.RawConfigParser()
config.read(filename)
if not config.has_section(section):
config.add_section(section)
config.set(section, key, value)
with open(filename, '
w
') as handle:
config.write(handle)
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