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
bc14ced4
Commit
bc14ced4
authored
Dec 13, 2013
by
Baptiste Lafontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding 'export' option to subversion module (to export instead of checkout)
parent
5c504210
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
library/source_control/subversion
+16
-1
No files found.
library/source_control/subversion
View file @
bc14ced4
...
@@ -70,6 +70,12 @@ options:
...
@@ -70,6 +70,12 @@ options:
description:
description:
- Path to svn executable to use. If not supplied,
- Path to svn executable to use. If not supplied,
the normal mechanism for resolving binary paths will be used.
the normal mechanism for resolving binary paths will be used.
export:
required: false
default: False
version_added: "1.5"
description:
- If True, do export instead of checkout/update.
'''
'''
EXAMPLES
=
'''
EXAMPLES
=
'''
...
@@ -110,6 +116,10 @@ class Subversion(object):
...
@@ -110,6 +116,10 @@ class Subversion(object):
def
checkout
(
self
):
def
checkout
(
self
):
'''Creates new svn working directory if it does not already exist.'''
'''Creates new svn working directory if it does not already exist.'''
self
.
_exec
(
"checkout -r
%
s '
%
s' '
%
s'"
%
(
self
.
revision
,
self
.
repo
,
self
.
dest
))
self
.
_exec
(
"checkout -r
%
s '
%
s' '
%
s'"
%
(
self
.
revision
,
self
.
repo
,
self
.
dest
))
def
export
(
self
,
force
=
False
):
'''Export svn repo to directory'''
self
.
_exec
(
"export -r
%
s '
%
s' '
%
s'"
%
(
self
.
revision
,
self
.
repo
,
self
.
dest
))
def
switch
(
self
):
def
switch
(
self
):
'''Change working directory's repo.'''
'''Change working directory's repo.'''
...
@@ -163,6 +173,7 @@ def main():
...
@@ -163,6 +173,7 @@ def main():
username
=
dict
(
required
=
False
),
username
=
dict
(
required
=
False
),
password
=
dict
(
required
=
False
),
password
=
dict
(
required
=
False
),
executable
=
dict
(
default
=
None
),
executable
=
dict
(
default
=
None
),
export
=
dict
(
default
=
False
,
required
=
False
),
),
),
supports_check_mode
=
True
supports_check_mode
=
True
)
)
...
@@ -174,6 +185,7 @@ def main():
...
@@ -174,6 +185,7 @@ def main():
username
=
module
.
params
[
'username'
]
username
=
module
.
params
[
'username'
]
password
=
module
.
params
[
'password'
]
password
=
module
.
params
[
'password'
]
svn_path
=
module
.
params
[
'executable'
]
or
module
.
get_bin_path
(
'svn'
,
True
)
svn_path
=
module
.
params
[
'executable'
]
or
module
.
get_bin_path
(
'svn'
,
True
)
export
=
module
.
params
[
'export'
]
svn
=
Subversion
(
module
,
dest
,
repo
,
revision
,
username
,
password
,
svn_path
)
svn
=
Subversion
(
module
,
dest
,
repo
,
revision
,
username
,
password
,
svn_path
)
...
@@ -182,7 +194,10 @@ def main():
...
@@ -182,7 +194,10 @@ def main():
local_mods
=
False
local_mods
=
False
if
module
.
check_mode
:
if
module
.
check_mode
:
module
.
exit_json
(
changed
=
True
)
module
.
exit_json
(
changed
=
True
)
svn
.
checkout
()
if
not
export
:
svn
.
checkout
()
else
:
svn
.
export
()
elif
os
.
path
.
exists
(
"
%
s/.svn"
%
(
dest
,
)):
elif
os
.
path
.
exists
(
"
%
s/.svn"
%
(
dest
,
)):
# Order matters. Need to get local mods before switch to avoid false
# Order matters. Need to get local mods before switch to avoid false
# positives. Need to switch before revert to ensure we are reverting to
# positives. Need to switch before revert to ensure we are reverting to
...
...
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