Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build.saved
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.recipe.build.saved
Commits
269cd931
Commit
269cd931
authored
Oct 07, 2014
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitclone: revision has priority over branch
Both are compatible.
parent
759e932a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
4 deletions
+43
-4
README.rst
README.rst
+32
-1
slapos/recipe/gitclone.py
slapos/recipe/gitclone.py
+11
-3
No files found.
README.rst
View file @
269cd931
...
...
@@ -148,7 +148,7 @@ Specific revision
-----------------
You can specify a specific commit hash or tag using `revision` option.
This option
is not compatible with
"branch" option::
This option
has priority over the
"branch" option::
>>> cd(sample_buildout)
>>> write(sample_buildout, 'buildout.cfg',
...
...
@@ -222,6 +222,37 @@ extend an existing section specifying a branch)::
>>> print system('git branch')
* master
Revision/branch priority
------------------------
If both revision and branch parameters are set, revision parameters is used
and branch parameter is ignored::
>>> cd(sample_buildout)
>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = git-clone
...
... [git-clone]
... recipe = slapos.recipe.build:gitclone
... repository = http://git.erp5.org/repos/slapos.recipe.build.git
... branch = mybranch
... revision = 2566127
... """)
>>> print system(buildout)
Uninstalling git-clone.
Running uninstall recipe.
Installing git-clone.
Warning: "branch" parameter with value "mybranch" is ignored. Checking out to revision 2566127...
Cloning into '/sample-buildout/parts/git-clone'...
HEAD is now at 2566127 ...
>>> cd(sample_buildout, 'parts', 'git-clone')
>>> print system('git branch')
* master
Specific git binary
-------------------
...
...
slapos/recipe/gitclone.py
View file @
269cd931
...
...
@@ -28,6 +28,7 @@
import
hashlib
import
os
import
shutil
import
sys
import
time
import
traceback
...
...
@@ -146,9 +147,9 @@ class Recipe(object):
if
not
self
.
repository
:
raise
UserError
(
'repository parameter is mandatory.'
)
if
self
.
revision
and
self
.
branch
:
# revision
and branch options are incompatible
raise
UserError
(
'revision and branch (other than master) parameters '
'are set but are incompatible. Please specify only one of them.'
)
# revision
option has priority over branch option
self
.
branch_overrided
=
self
.
branch
self
.
branch
=
None
# Check existence of directory
if
not
os
.
path
.
exists
(
self
.
location
):
...
...
@@ -180,6 +181,13 @@ class Recipe(object):
# If develop is set, assume that this is a valid working copy
return
[
self
.
location
]
if
getattr
(
self
,
'branch_overrided'
,
None
):
print
(
'Warning: "branch" parameter with value "%s" is ignored. '
'Checking out to revision %s.'
%
(
self
.
branch_overrided
,
self
.
revision
)
)
sys
.
stdout
.
flush
()
git_clone_command
=
[
self
.
git_command
,
'clone'
,
self
.
repository
,
self
.
location
]
...
...
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