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
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.recipe.build
Commits
1f9e5e48
Commit
1f9e5e48
authored
Jan 22, 2025
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitclone: Always keep develop repository intact
parent
59c1361b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
27 deletions
+1
-27
README.rst
README.rst
+0
-1
slapos/recipe/gitclone.py
slapos/recipe/gitclone.py
+1
-26
No files found.
README.rst
View file @
1f9e5e48
...
...
@@ -846,7 +846,6 @@ In case of uninstall, buildout will keep the repository directory::
>>> print(system(buildout))
Uninstalling git-clone.
Running uninstall recipe.
You have uncommitted changes in /sample-buildout/parts/git-clone. This folder will be left as is.
Installing git-clone.
destination directory already exists.
...
...
...
slapos/recipe/gitclone.py
View file @
1f9e5e48
...
...
@@ -306,36 +306,11 @@ class Recipe(object):
'--recursive'
],
cwd
=
self
.
location
)
def
uninstall
(
name
,
options
):
"""Keep the working copy
, unless develop is set to
false.
"""Keep the working copy
when develop is
false.
"""
if
not
os
.
path
.
exists
(
options
[
'location'
]):
return
force_keep
=
False
if
options
.
get
(
'develop'
,
'yes'
).
lower
()
in
TRUE_VALUES
:
git_path
=
options
.
get
(
'git-executable'
,
'git'
)
if
not
os
.
path
.
isabs
(
git_path
)
or
os
.
path
.
exists
(
git_path
):
p
=
subprocess
.
Popen
([
git_path
,
'status'
,
'--short'
],
cwd
=
options
[
'location'
],
stdout
=
subprocess
.
PIPE
)
if
p
.
communicate
()[
0
].
strip
():
print
(
"You have uncommitted changes in %s."
" This folder will be left as is."
%
options
[
'location'
])
force_keep
=
True
p
=
subprocess
.
Popen
([
git_path
,
'log'
,
'--branches'
,
'--not'
,
'--remotes'
],
cwd
=
options
[
'location'
],
stdout
=
subprocess
.
PIPE
)
if
p
.
communicate
()[
0
].
strip
():
print
(
"You have commits not pushed upstream in %s."
" This folder will be left as is."
%
options
[
'location'
])
force_keep
=
True
else
:
print
(
"Cannot check if there are unpushed/uncommitted changes in %s."
" This folder will be left as is."
%
options
[
'location'
])
force_keep
=
True
if
force_keep
:
# Eventhough this behaviour is not documented, buildout won't uninstall
# anything if we unset __buildout_installed__
options
[
'__buildout_installed__'
]
=
''
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