mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 18:06:13 +01:00
Revert "new "osc revert" command"
This reverts commit b198845b2c
.
Conflicts:
osc/commandline.py
This commit is contained in:
parent
727c66c2cf
commit
2b419453bb
1
NEWS
1
NEWS
@ -6,7 +6,6 @@
|
|||||||
version. use 'osc pull' to repair the broken link.
|
version. use 'osc pull' to repair the broken link.
|
||||||
- osc my request is showing now also requests from other people target to
|
- osc my request is showing now also requests from other people target to
|
||||||
myself
|
myself
|
||||||
- new "osc revert" command to make a server side revert of code
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Features which require OBS 1.7
|
# Features which require OBS 1.7
|
||||||
|
@ -3333,64 +3333,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-r', '--revision', metavar='rev',
|
|
||||||
help='show log of the specified revision')
|
|
||||||
@cmdln.option('-m', '--message', metavar='TEXT',
|
|
||||||
help='specify message TEXT')
|
|
||||||
def do_revert(self, subcmd, opts, *args):
|
|
||||||
"""${cmd_name}: Revert package sources to a former state
|
|
||||||
|
|
||||||
The command revert to a former state. It goes back just one
|
|
||||||
revision when no other is specified.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
osc revert (inside working copy)
|
|
||||||
osc revert remote_project remote_package
|
|
||||||
|
|
||||||
${cmd_option_list}
|
|
||||||
"""
|
|
||||||
|
|
||||||
args = slash_split(args)
|
|
||||||
if len(args) == 0:
|
|
||||||
wd = os.curdir
|
|
||||||
project = store_read_project(wd)
|
|
||||||
package = store_read_package(wd)
|
|
||||||
apiurl = store_read_apiurl(wd)
|
|
||||||
update_local_dir = 1
|
|
||||||
elif len(args) < 2:
|
|
||||||
raise oscerr.WrongArgs('Too few arguments (required none or two)')
|
|
||||||
elif len(args) > 2:
|
|
||||||
raise oscerr.WrongArgs('Too many arguments (required none or two)')
|
|
||||||
else:
|
|
||||||
apiurl = conf.config['apiurl']
|
|
||||||
project = args[0]
|
|
||||||
package = args[1]
|
|
||||||
update_local_dir = 0
|
|
||||||
|
|
||||||
rev, dummy = parseRevisionOption(opts.revision)
|
|
||||||
if not rev:
|
|
||||||
rev = int(show_upstream_rev(apiurl, project, package)) - 1
|
|
||||||
if not rev or int(rev) <= 0:
|
|
||||||
print >>sys.stderr, 'Can not revert for %s %s' % (project, package)
|
|
||||||
sys.exit(1)
|
|
||||||
elif not checkRevision(project, package, rev, apiurl):
|
|
||||||
print >>sys.stderr, 'Revision \'%s\' does not exist' % rev
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if opts.message:
|
|
||||||
message=opts.message
|
|
||||||
else:
|
|
||||||
message="Revert to revsion %s" % rev
|
|
||||||
|
|
||||||
r = copy_pac(apiurl, project, package,
|
|
||||||
apiurl, project, package,
|
|
||||||
revision=rev, comment=message)
|
|
||||||
print r
|
|
||||||
if update_local_dir == 1:
|
|
||||||
pac = findpacs(wd)[0]
|
|
||||||
pac.update()
|
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-r', '--revision', metavar='rev',
|
@cmdln.option('-r', '--revision', metavar='rev',
|
||||||
help='show log of the specified revision')
|
help='show log of the specified revision')
|
||||||
@cmdln.option('', '--csv', action='store_true',
|
@cmdln.option('', '--csv', action='store_true',
|
||||||
|
Loading…
Reference in New Issue
Block a user