Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
8418f52d
Commit
8418f52d
authored
Jan 30, 2012
by
Matthieu Gonnet
Committed by
Sebastien Luttringer
Jan 30, 2012
Browse files
Options
Downloads
Patches
Plain Diff
add --force option to clean command
execute clean command without asking confirmation
parent
fba78c61
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/is
+3
-1
3 additions, 1 deletion
bin/is
completion/bash/is
+1
-1
1 addition, 1 deletion
completion/bash/is
installsystems/repository.py
+2
-2
2 additions, 2 deletions
installsystems/repository.py
with
6 additions
and
4 deletions
bin/is
+
3
−
1
View file @
8418f52d
...
...
@@ -235,7 +235,7 @@ def c_clean(args):
'''
repoman
=
load_repositories
(
args
)
for
reponame
in
args
.
repository
:
repoman
[
reponame
].
clean
()
repoman
[
reponame
].
clean
(
args
.
force
)
def
c_copy
(
args
):
'''
...
...
@@ -542,6 +542,8 @@ def arg_parser_init():
p
.
set_defaults
(
func
=
c_chroot
)
# clean command parser
p
=
subparser
.
add_parser
(
"
clean
"
,
help
=
c_clean
.
__doc__
.
lower
())
p
.
add_argument
(
"
-f
"
,
"
--force
"
,
action
=
"
store_true
"
,
help
=
"
clean repository without confirmation
"
)
p
.
add_argument
(
"
repository
"
,
nargs
=
"
+
"
,
help
=
"
repositories to clean
"
)
p
.
set_defaults
(
func
=
c_clean
)
# copy command parser
...
...
This diff is collapsed.
Click to expand it.
completion/bash/is
+
1
−
1
View file @
8418f52d
...
...
@@ -91,7 +91,7 @@ _is() {
_filedir -d
;;
clean)
[[ "$cur" == -* ]] && _opt '-h --help' && return 0
[[ "$cur" == -* ]] && _opt '-h --help
-f --force
' && return 0
_local_repo
;;
copy)
...
...
This diff is collapsed.
Click to expand it.
installsystems/repository.py
+
2
−
2
View file @
8418f52d
...
...
@@ -275,7 +275,7 @@ class Repository(object):
if
fo
.
md5
!=
f
:
out
(
f
)
def
clean
(
self
):
def
clean
(
self
,
force
=
False
):
'''
Clean the repository
'
s content
'''
...
...
@@ -291,7 +291,7 @@ class Repository(object):
for
f
in
dirtyfiles
:
arrow
(
f
,
1
)
# ask confirmation
if
not
confirm
(
"
Remove dirty files? (yes)
"
):
if
not
force
and
not
confirm
(
"
Remove dirty files? (yes)
"
):
raise
Exception
(
"
Aborted!
"
)
# start cleaning
arrow
(
"
Cleaning
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment