mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-25 22:36:13 +01:00
Deprecate store_read_scmurl()
This commit is contained in:
parent
fd52727394
commit
e7912ceec0
24
osc/core.py
24
osc/core.py
@ -712,7 +712,7 @@ class Project:
|
|||||||
self.progress_obj = progress_obj
|
self.progress_obj = progress_obj
|
||||||
|
|
||||||
self.name = store_read_project(self.dir)
|
self.name = store_read_project(self.dir)
|
||||||
self.scm_url = store_read_scmurl(self.dir)
|
self.scm_url = self.store.scmurl
|
||||||
self.apiurl = self.store.apiurl
|
self.apiurl = self.store.apiurl
|
||||||
|
|
||||||
dirty_files = []
|
dirty_files = []
|
||||||
@ -1215,7 +1215,7 @@ class Package:
|
|||||||
self.storedir = os.path.join(self.absdir, store)
|
self.storedir = os.path.join(self.absdir, store)
|
||||||
self.progress_obj = progress_obj
|
self.progress_obj = progress_obj
|
||||||
self.size_limit = size_limit
|
self.size_limit = size_limit
|
||||||
self.scm_url = store_read_scmurl(self.dir)
|
self.scm_url = self.store.scmurl
|
||||||
if size_limit and size_limit == 0:
|
if size_limit and size_limit == 0:
|
||||||
self.size_limit = None
|
self.size_limit = None
|
||||||
|
|
||||||
@ -6744,19 +6744,13 @@ def store_read_package(dir):
|
|||||||
|
|
||||||
|
|
||||||
def store_read_scmurl(dir):
|
def store_read_scmurl(dir):
|
||||||
global store
|
import warnings
|
||||||
|
warnings.warn(
|
||||||
url_file = os.path.join(dir, store, '_scm')
|
"osc.core.store_read_scmurl() is deprecated. "
|
||||||
if not os.path.exists(url_file):
|
"You should be using high-level classes such as Store, Project or Package instead.",
|
||||||
return
|
DeprecationWarning
|
||||||
try:
|
)
|
||||||
p = open(url_file).readlines()[0].strip()
|
return _private.Store(dir).scmurl
|
||||||
except OSError:
|
|
||||||
msg = 'Error: \'%s\' is not an osc package working copy' % os.path.abspath(dir)
|
|
||||||
if os.path.exists(os.path.join(dir, '.svn')):
|
|
||||||
msg += '\nTry svn instead of osc.'
|
|
||||||
raise oscerr.NoWorkingCopy(msg)
|
|
||||||
return p
|
|
||||||
|
|
||||||
|
|
||||||
def store_read_apiurl(dir, defaulturl=True):
|
def store_read_apiurl(dir, defaulturl=True):
|
||||||
|
Loading…
Reference in New Issue
Block a user