Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
16947041
Commit
16947041
authored
Oct 10, 2013
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4432 from madsweitling/devel
Fix typo and broken "Hg.__init__" in 'hg' module
parents
c2572b03
ce799b9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
library/source_control/hg
+9
-9
No files found.
library/source_control/hg
View file @
16947041
...
...
@@ -47,7 +47,7 @@ options:
revision:
description:
- Equivalent C(-r) option in hg command which could be the changeset, revision number,
branch name or even tag.
branch name or even tag.
required: false
default: "default"
aliases: [ version ]
...
...
@@ -97,7 +97,7 @@ def _set_hgrc(hgrc, vals):
if
not
parser
.
has_section
(
section
):
parser
.
add_section
(
section
)
parser
.
set
(
section
,
option
,
value
)
f
=
open
(
hgrc
,
'w'
)
parser
.
write
(
f
)
f
.
close
()
...
...
@@ -106,7 +106,7 @@ def _set_hgrc(hgrc, vals):
def
_undo_hgrc
(
hgrc
,
vals
):
parser
=
ConfigParser
.
SafeConfigParser
()
parser
.
read
(
hgrc
)
for
each
in
vals
:
(
section
,
option
,
value
)
=
each
if
parser
.
has_section
(
section
):
...
...
@@ -124,7 +124,7 @@ class Hg(object):
self
.
dest
=
dest
self
.
repo
=
repo
self
.
revision
=
revision
self
.
hg_path
=
self
.
hg_path
self
.
hg_path
=
hg_path
def
_command
(
self
,
args_list
):
(
rc
,
out
,
err
)
=
self
.
module
.
run_command
([
self
.
hg_path
]
+
args_list
)
...
...
@@ -168,17 +168,17 @@ class Hg(object):
after
=
self
.
has_local_mods
()
if
before
!=
after
and
not
after
:
# no more local modification
return
True
def
purge
(
self
):
hgrc
=
os
.
path
.
join
(
self
.
dest
,
'.hg/hgrc'
)
purge_option
=
[(
'extensions'
,
'purge'
,
''
)]
_set_hgrc
(
hgrc
,
purge_option
)
# enable purge extension
# before purge, find out if there are any untracked files
(
rc1
,
out1
,
err1
)
=
self
.
_list_untracked
()
if
rc1
!=
0
:
self
.
module
.
fail_json
(
msg
=
err1
)
# there are some untrackd files
if
out1
!=
''
:
(
rc2
,
out2
,
err2
)
=
self
.
_command
([
'purge'
,
'-R'
,
self
.
dest
])
...
...
@@ -234,9 +234,9 @@ def main():
revision
=
module
.
params
[
'revision'
]
force
=
module
.
params
[
'force'
]
purge
=
module
.
params
[
'purge'
]
hg_path
=
module
.
param
e
s
[
'executable'
]
or
module
.
get_bin_path
(
'hg'
,
True
)
hg_path
=
module
.
params
[
'executable'
]
or
module
.
get_bin_path
(
'hg'
,
True
)
hgrc
=
os
.
path
.
join
(
dest
,
'.hg/hgrc'
)
# initial states
before
=
''
changed
=
False
...
...
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