mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 17:16:23 +01:00
- fixed patch header
This commit is contained in:
parent
3ac330f7cd
commit
7802dfa9ad
@ -1372,10 +1372,10 @@ class Package:
|
|||||||
diff.append('Binary file \'%s\' %s.\n' % (origname, what))
|
diff.append('Binary file \'%s\' %s.\n' % (origname, what))
|
||||||
return diff
|
return diff
|
||||||
tmpl = '+%s'
|
tmpl = '+%s'
|
||||||
ltmpl = '@@ -0,0 +1,%d @@\n'
|
ltmpl = '@@ -0,0 +1,%d @@\n'
|
||||||
if not add:
|
if not add:
|
||||||
tmpl = '-%s'
|
tmpl = '-%s'
|
||||||
ltmpl = '@@ -1,%d +0,0 @@\n'
|
ltmpl = '@@ -1,%d +0,0 @@\n'
|
||||||
lines = [tmpl % i for i in open(fname, 'r').readlines()]
|
lines = [tmpl % i for i in open(fname, 'r').readlines()]
|
||||||
if len(lines):
|
if len(lines):
|
||||||
diff.append(ltmpl % len(lines))
|
diff.append(ltmpl % len(lines))
|
||||||
|
@ -30,7 +30,7 @@ class TestDiffFiles(OscTestCase):
|
|||||||
exp = """%s
|
exp = """%s
|
||||||
--- toadd1\t(revision 0)
|
--- toadd1\t(revision 0)
|
||||||
+++ toadd1\t(revision 0)
|
+++ toadd1\t(revision 0)
|
||||||
@@ -0,0 +1,1 @@
|
@@ -0,0 +1,1 @@
|
||||||
+toadd1
|
+toadd1
|
||||||
""" % (TestDiffFiles.diff_hdr % 'toadd1')
|
""" % (TestDiffFiles.diff_hdr % 'toadd1')
|
||||||
self.__check_diff(p, exp, None)
|
self.__check_diff(p, exp, None)
|
||||||
@ -43,7 +43,7 @@ class TestDiffFiles(OscTestCase):
|
|||||||
exp = """%s
|
exp = """%s
|
||||||
--- somefile\t(revision 2)
|
--- somefile\t(revision 2)
|
||||||
+++ somefile\t(working copy)
|
+++ somefile\t(working copy)
|
||||||
@@ -1,1 +0,0 @@
|
@@ -1,1 +0,0 @@
|
||||||
-some content
|
-some content
|
||||||
""" % (TestDiffFiles.diff_hdr % 'somefile')
|
""" % (TestDiffFiles.diff_hdr % 'somefile')
|
||||||
self.__check_diff(p, exp, None)
|
self.__check_diff(p, exp, None)
|
||||||
@ -130,7 +130,7 @@ class TestDiffFiles(OscTestCase):
|
|||||||
%s
|
%s
|
||||||
--- somefile\t(revision 2)
|
--- somefile\t(revision 2)
|
||||||
+++ somefile\t(working copy)
|
+++ somefile\t(working copy)
|
||||||
@@ -1,1 +0,0 @@
|
@@ -1,1 +0,0 @@
|
||||||
-some content
|
-some content
|
||||||
""" % (TestDiffFiles.diff_hdr % 'nochange', TestDiffFiles.diff_hdr % 'somefile')
|
""" % (TestDiffFiles.diff_hdr % 'nochange', TestDiffFiles.diff_hdr % 'somefile')
|
||||||
self.__check_diff(p, exp, None)
|
self.__check_diff(p, exp, None)
|
||||||
@ -190,7 +190,7 @@ Binary file 'binary' has changed.
|
|||||||
%s
|
%s
|
||||||
--- toadd1\t(revision 0)
|
--- toadd1\t(revision 0)
|
||||||
+++ toadd1\t(revision 0)
|
+++ toadd1\t(revision 0)
|
||||||
@@ -0,0 +1,1 @@
|
@@ -0,0 +1,1 @@
|
||||||
+toadd1
|
+toadd1
|
||||||
""" % (TestDiffFiles.diff_hdr % 'merge', TestDiffFiles.diff_hdr % 'toadd1')
|
""" % (TestDiffFiles.diff_hdr % 'merge', TestDiffFiles.diff_hdr % 'toadd1')
|
||||||
self.__check_diff(p, exp, 3)
|
self.__check_diff(p, exp, 3)
|
||||||
@ -206,7 +206,7 @@ Binary file 'binary' has changed.
|
|||||||
exp = """%s
|
exp = """%s
|
||||||
--- toadd1\t(revision 0)
|
--- toadd1\t(revision 0)
|
||||||
+++ toadd1\t(revision 0)
|
+++ toadd1\t(revision 0)
|
||||||
@@ -0,0 +1,1 @@
|
@@ -0,0 +1,1 @@
|
||||||
+toadd1
|
+toadd1
|
||||||
""" % (TestDiffFiles.diff_hdr % 'toadd1')
|
""" % (TestDiffFiles.diff_hdr % 'toadd1')
|
||||||
self.__check_diff(p, exp, 3)
|
self.__check_diff(p, exp, 3)
|
||||||
@ -224,7 +224,7 @@ Binary file 'binary' has changed.
|
|||||||
exp = """%s
|
exp = """%s
|
||||||
--- foobar\t(revision 3)
|
--- foobar\t(revision 3)
|
||||||
+++ foobar\t(working copy)
|
+++ foobar\t(working copy)
|
||||||
@@ -1,2 +0,0 @@
|
@@ -1,2 +0,0 @@
|
||||||
-foobar
|
-foobar
|
||||||
-barfoo
|
-barfoo
|
||||||
%s
|
%s
|
||||||
@ -259,7 +259,7 @@ Binary file 'binary' has changed.
|
|||||||
exp = """%s
|
exp = """%s
|
||||||
--- foo\t(revision 0)
|
--- foo\t(revision 0)
|
||||||
+++ foo\t(working copy)
|
+++ foo\t(working copy)
|
||||||
@@ -0,0 +1,1 @@
|
@@ -0,0 +1,1 @@
|
||||||
+This is a simple test.
|
+This is a simple test.
|
||||||
""" % (TestDiffFiles.diff_hdr % 'foo')
|
""" % (TestDiffFiles.diff_hdr % 'foo')
|
||||||
self.__check_diff(p, exp, 3)
|
self.__check_diff(p, exp, 3)
|
||||||
|
Loading…
Reference in New Issue
Block a user