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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
35d88f3c
Commit
35d88f3c
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
Command move use new style
parent
d412a16a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/is
+22
-17
22 additions, 17 deletions
bin/is
with
22 additions
and
17 deletions
bin/is
+
22
−
17
View file @
35d88f3c
...
...
@@ -253,19 +253,24 @@ def c_move(parser, args):
'''
# load repositories
repoman
=
load_repositories
(
args
)
srcrepo
=
repoman
[
args
.
repo_src
]
dstrepo
=
repoman
[
args
.
repo_dst
]
# load source image
srcimg
=
srcrepo
.
get
(
args
.
image
,
args
.
image_version
)
# Advertise
arrow
(
"
Copying %s v%s from %s to %s
"
%
(
srcimg
.
name
,
srcimg
.
version
,
srcrepo
.
config
.
name
,
dstrepo
.
config
.
name
))
arrowlevel
(
1
)
dstrepo
.
add
(
srcimg
)
srcrepo
.
delete
(
srcimg
.
name
,
srcimg
.
version
)
arrowlevel
(
-
1
)
dstrepo
=
repoman
[
args
.
repository
]
for
image
in
args
.
image
:
srcimg
,
srcrepo
=
select_image
(
image
,
repoman
)
if
not
args
.
force
:
out
(
"
You will move %s v%s from %s to %s
"
%
(
srcimg
.
name
,
srcimg
.
version
,
srcrepo
.
config
.
name
,
dstrepo
.
config
.
name
))
if
raw_input
(
"
Are you sure (yes)
"
)
!=
"
yes
"
:
raise
Exception
(
"
Abort
"
)
arrow
(
"
Moving %s v%s from %s to %s
"
%
(
srcimg
.
name
,
srcimg
.
version
,
srcrepo
.
config
.
name
,
dstrepo
.
config
.
name
))
arrowlevel
(
1
)
dstrepo
.
add
(
srcimg
)
srcrepo
.
delete
(
srcimg
.
name
,
srcimg
.
version
)
arrowlevel
(
-
1
)
def
c_new
(
parser
,
args
):
'''
...
...
@@ -395,10 +400,10 @@ p_list.set_defaults(func=c_list, subparser=p_list)
# move command parser
p_move
=
subparsers
.
add_parser
(
"
move
"
,
help
=
c_move
.
__doc__
.
lower
())
p_move
.
add_argument
(
"
repo_src
"
,
help
=
"
name of source repository
"
)
p_move
.
add_argument
(
"
repo_dst
"
,
help
=
"
name of destination repository
"
)
p_move
.
add_argument
(
"
image
"
,
help
=
"
image name
"
)
p_move
.
add_argument
(
"
image
_version
"
,
nargs
=
"
?
"
,
help
=
"
image
version
"
)
p_move
.
add_argument
(
"
-f
"
,
"
--force
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
move image without confirmation
"
)
p_move
.
add_argument
(
"
repository
"
,
help
=
"
name of destination repository
"
)
p_move
.
add_argument
(
"
image
"
,
nargs
=
"
+
"
,
help
=
"
image
to move
"
)
p_move
.
set_defaults
(
func
=
c_move
)
# new command parser
...
...
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
register
or
sign in
to comment