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
740a33bc
Commit
740a33bc
authored
Oct 10, 2013
by
Mads Weitling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 'hg module fails with: AttributeError: 'AnsibleModule' object has no attribute 'parames''
parent
c2572b03
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
library/source_control/hg
+8
-8
No files found.
library/source_control/hg
View file @
740a33bc
...
@@ -47,7 +47,7 @@ options:
...
@@ -47,7 +47,7 @@ options:
revision:
revision:
description:
description:
- Equivalent C(-r) option in hg command which could be the changeset, revision number,
- 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
required: false
default: "default"
default: "default"
aliases: [ version ]
aliases: [ version ]
...
@@ -97,7 +97,7 @@ def _set_hgrc(hgrc, vals):
...
@@ -97,7 +97,7 @@ def _set_hgrc(hgrc, vals):
if
not
parser
.
has_section
(
section
):
if
not
parser
.
has_section
(
section
):
parser
.
add_section
(
section
)
parser
.
add_section
(
section
)
parser
.
set
(
section
,
option
,
value
)
parser
.
set
(
section
,
option
,
value
)
f
=
open
(
hgrc
,
'w'
)
f
=
open
(
hgrc
,
'w'
)
parser
.
write
(
f
)
parser
.
write
(
f
)
f
.
close
()
f
.
close
()
...
@@ -106,7 +106,7 @@ def _set_hgrc(hgrc, vals):
...
@@ -106,7 +106,7 @@ def _set_hgrc(hgrc, vals):
def
_undo_hgrc
(
hgrc
,
vals
):
def
_undo_hgrc
(
hgrc
,
vals
):
parser
=
ConfigParser
.
SafeConfigParser
()
parser
=
ConfigParser
.
SafeConfigParser
()
parser
.
read
(
hgrc
)
parser
.
read
(
hgrc
)
for
each
in
vals
:
for
each
in
vals
:
(
section
,
option
,
value
)
=
each
(
section
,
option
,
value
)
=
each
if
parser
.
has_section
(
section
):
if
parser
.
has_section
(
section
):
...
@@ -168,17 +168,17 @@ class Hg(object):
...
@@ -168,17 +168,17 @@ class Hg(object):
after
=
self
.
has_local_mods
()
after
=
self
.
has_local_mods
()
if
before
!=
after
and
not
after
:
# no more local modification
if
before
!=
after
and
not
after
:
# no more local modification
return
True
return
True
def
purge
(
self
):
def
purge
(
self
):
hgrc
=
os
.
path
.
join
(
self
.
dest
,
'.hg/hgrc'
)
hgrc
=
os
.
path
.
join
(
self
.
dest
,
'.hg/hgrc'
)
purge_option
=
[(
'extensions'
,
'purge'
,
''
)]
purge_option
=
[(
'extensions'
,
'purge'
,
''
)]
_set_hgrc
(
hgrc
,
purge_option
)
# enable purge extension
_set_hgrc
(
hgrc
,
purge_option
)
# enable purge extension
# before purge, find out if there are any untracked files
# before purge, find out if there are any untracked files
(
rc1
,
out1
,
err1
)
=
self
.
_list_untracked
()
(
rc1
,
out1
,
err1
)
=
self
.
_list_untracked
()
if
rc1
!=
0
:
if
rc1
!=
0
:
self
.
module
.
fail_json
(
msg
=
err1
)
self
.
module
.
fail_json
(
msg
=
err1
)
# there are some untrackd files
# there are some untrackd files
if
out1
!=
''
:
if
out1
!=
''
:
(
rc2
,
out2
,
err2
)
=
self
.
_command
([
'purge'
,
'-R'
,
self
.
dest
])
(
rc2
,
out2
,
err2
)
=
self
.
_command
([
'purge'
,
'-R'
,
self
.
dest
])
...
@@ -234,9 +234,9 @@ def main():
...
@@ -234,9 +234,9 @@ def main():
revision
=
module
.
params
[
'revision'
]
revision
=
module
.
params
[
'revision'
]
force
=
module
.
params
[
'force'
]
force
=
module
.
params
[
'force'
]
purge
=
module
.
params
[
'purge'
]
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'
)
hgrc
=
os
.
path
.
join
(
dest
,
'.hg/hgrc'
)
# initial states
# initial states
before
=
''
before
=
''
changed
=
False
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