mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-27 20:52:14 +01:00
- fix update in directory with unmodified files: don't try to merge if upstream
file wasn't changed at all - use given project name in new_project_templ
This commit is contained in:
parent
bc68a2d277
commit
1f764554a0
@ -338,6 +338,7 @@ usage: up
|
|||||||
for i in p.filenamelist:
|
for i in p.filenamelist:
|
||||||
if p.status(i) == 'M':
|
if p.status(i) == 'M':
|
||||||
saved_modifiedfiles.append(i)
|
saved_modifiedfiles.append(i)
|
||||||
|
oldp = p
|
||||||
p.update_filesmeta()
|
p.update_filesmeta()
|
||||||
p = Package(p.dir)
|
p = Package(p.dir)
|
||||||
|
|
||||||
@ -357,7 +358,10 @@ usage: up
|
|||||||
for filename in p.filenamelist:
|
for filename in p.filenamelist:
|
||||||
|
|
||||||
state = p.status(filename)
|
state = p.status(filename)
|
||||||
if state == 'M' and filename in saved_modifiedfiles:
|
if p.findfilebyname(filename).md5 == oldp.findfilebyname(filename).md5:
|
||||||
|
# no merge necessary... local file is changed, but upstream isn't
|
||||||
|
pass
|
||||||
|
elif state == 'M' and filename in saved_modifiedfiles:
|
||||||
status_after_merge = p.mergefile(filename)
|
status_after_merge = p.mergefile(filename)
|
||||||
print statfrmt(status_after_merge, filename)
|
print statfrmt(status_after_merge, filename)
|
||||||
elif state == 'M':
|
elif state == 'M':
|
||||||
|
@ -27,7 +27,7 @@ exclude_stuff = [store, '.svn', 'CVS']
|
|||||||
|
|
||||||
|
|
||||||
new_project_templ = """\
|
new_project_templ = """\
|
||||||
<project name="NewProjectName">
|
<project name="%s">
|
||||||
<title>Short title of NewProject</title>
|
<title>Short title of NewProject</title>
|
||||||
<description>This project aims at providing some foo and bar.
|
<description>This project aims at providing some foo and bar.
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ def edit_meta(prj, pac):
|
|||||||
m = show_project_meta(prj)
|
m = show_project_meta(prj)
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code == 404:
|
if e.code == 404:
|
||||||
m = new_project_templ % username
|
m = new_project_templ % (prj, username)
|
||||||
|
|
||||||
f = open(filename, 'w')
|
f = open(filename, 'w')
|
||||||
f.write(''.join(m))
|
f.write(''.join(m))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user