1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +01:00

don't parse local meta file more than once for the filelist, thus fixing 'status' slowness; fix usage of 'up' command with more than one directory as argument

This commit is contained in:
Dr. Peter Poeml 2006-04-24 12:04:20 +00:00
parent 2dfbdf3bde
commit ab258100ca
3 changed files with 15 additions and 6 deletions

View File

@ -2,7 +2,6 @@ osc -- opensuse-commander with svn like handling
>>> BUG: at the moment, 'up' overwrites files with
local modifications.
>>> At the moment, 'status' is highly inefficient.
Please send patches to poeml@suse.de, or work directly on
@ -33,6 +32,7 @@ osc co Apache subversion foo # single file
# update working copy
osc up
osc up <directory>
# check in
osc ci # current dir

12
osc.py
View File

@ -108,8 +108,9 @@ def main():
os.chdir(wd)
filelist = localmeta_get_filelist()
for filename in filenames:
s = get_file_status(project, package, filename)
s = get_file_status(project, package, filename, filelist=filelist)
#if not s.startswith(' '):
# print s
print s
@ -144,8 +145,10 @@ def main():
filenames.insert(0, i)
filelist = localmeta_get_filelist()
for filename in filenames:
st = get_file_status(project, package, filename)
st = get_file_status(project, package, filename, filelist=filelist)
if st.startswith('?'):
localmeta_addfile(filename)
print 'A ', filename
@ -183,8 +186,9 @@ def main():
files_to_send = []
files_to_delete = []
filelist = localmeta_get_filelist()
for filename in filenames:
st = get_file_status(project, package, filename)
st = get_file_status(project, package, filename, filelist=filelist)
if st.startswith('A') or st.startswith('M'):
files_to_send.append(filename)
print 'Sending %s' % filename
@ -233,6 +237,7 @@ def main():
# if i not in filenames and i not in exclude_stuff:
# filenames.insert(0, i)
olddir = os.getcwd()
os.chdir(wd)
os.chdir(store)
@ -256,6 +261,7 @@ def main():
f.write(''.join(show_package_meta(project, package)))
f.close()
os.chdir(olddir)

View File

@ -210,7 +210,7 @@ def dgst(file):
return s.digest()
def get_file_status(prj, package, filename):
def get_file_status(prj, package, filename, filelist=None):
"""
status can be:
@ -231,7 +231,10 @@ def get_file_status(prj, package, filename):
exists = False
exists_in_store = False
if filename in localmeta_get_filelist():
if not filelist:
filelist = localmeta_get_filelist()
if filename in filelist:
known_by_meta = True
if os.path.exists(filename):