mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-07 21:58:41 +02:00
- get_diff: don't diff binary files
This commit is contained in:
1
tests/difffile_fixtures/osctest/binary/.osc/_apiurl
Normal file
1
tests/difffile_fixtures/osctest/binary/.osc/_apiurl
Normal file
@@ -0,0 +1 @@
|
||||
http://localhost
|
4
tests/difffile_fixtures/osctest/binary/.osc/_files
Normal file
4
tests/difffile_fixtures/osctest/binary/.osc/_files
Normal file
@@ -0,0 +1,4 @@
|
||||
<directory name="binary" rev="2" srcmd5="2df1eacfe03a3bec2112529e7f4dc39a" vrev="2">
|
||||
<entry md5="8f618462e00017108b4146a29e074bdf" mtime="1111111111" name="binary" size="18" />
|
||||
<entry md5="ee813c93cb5730dce38976695634482f" mtime="1111111111" name="binary_deleted" size="26" />
|
||||
</directory>
|
@@ -0,0 +1 @@
|
||||
1.0
|
1
tests/difffile_fixtures/osctest/binary/.osc/_package
Normal file
1
tests/difffile_fixtures/osctest/binary/.osc/_package
Normal file
@@ -0,0 +1 @@
|
||||
binary
|
1
tests/difffile_fixtures/osctest/binary/.osc/_project
Normal file
1
tests/difffile_fixtures/osctest/binary/.osc/_project
Normal file
@@ -0,0 +1 @@
|
||||
osctest
|
1
tests/difffile_fixtures/osctest/binary/.osc/_to_be_added
Normal file
1
tests/difffile_fixtures/osctest/binary/.osc/_to_be_added
Normal file
@@ -0,0 +1 @@
|
||||
binary_added
|
@@ -0,0 +1 @@
|
||||
binary_deleted
|
BIN
tests/difffile_fixtures/osctest/binary/.osc/binary
Normal file
BIN
tests/difffile_fixtures/osctest/binary/.osc/binary
Normal file
Binary file not shown.
BIN
tests/difffile_fixtures/osctest/binary/.osc/binary_deleted
Normal file
BIN
tests/difffile_fixtures/osctest/binary/.osc/binary_deleted
Normal file
Binary file not shown.
BIN
tests/difffile_fixtures/osctest/binary/binary
Normal file
BIN
tests/difffile_fixtures/osctest/binary/binary
Normal file
Binary file not shown.
BIN
tests/difffile_fixtures/osctest/binary/binary_added
Normal file
BIN
tests/difffile_fixtures/osctest/binary/binary_added
Normal file
Binary file not shown.
@@ -2,4 +2,5 @@
|
||||
<entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282047302" name="foo" size="23" />
|
||||
<entry md5="17b9e9e1a032ed44e7a584dc6303ffa8" mtime="1282047303" name="merge" size="48" />
|
||||
<entry md5="7efa70f68983fad1cf487f69dedf93e9" mtime="1282047303" name="nochange" size="25" />
|
||||
</directory>
|
||||
<entry md5="b1b642cdbacf9956104f8565e297ed00" mtime="1283246089" name="binary" size="27" />
|
||||
</directory>
|
||||
|
BIN
tests/difffile_fixtures/osctest/remote_localmodified/.osc/binary
Normal file
BIN
tests/difffile_fixtures/osctest/remote_localmodified/.osc/binary
Normal file
Binary file not shown.
BIN
tests/difffile_fixtures/osctest/remote_localmodified/binary
Normal file
BIN
tests/difffile_fixtures/osctest/remote_localmodified/binary
Normal file
Binary file not shown.
BIN
tests/difffile_fixtures/osctest/remote_simple/binary
Normal file
BIN
tests/difffile_fixtures/osctest/remote_simple/binary
Normal file
Binary file not shown.
Binary file not shown.
@@ -3,4 +3,5 @@
|
||||
<entry md5="17b9e9e1a032ed44e7a584dc6303ffa8" mtime="1282047303" name="merge" size="48" />
|
||||
<entry md5="7efa70f68983fad1cf487f69dedf93e9" mtime="1282047303" name="nochange" size="25" />
|
||||
<entry md5="136a96e1470ec7424bc8ae47612977db" mtime="1282914026" name="foobar" size="14" />
|
||||
<entry md5="9b55c93ffec5ef8850c84882de7ef6b5" mtime="1283242538" name="binary" size="7" />
|
||||
</directory>
|
||||
|
Binary file not shown.
@@ -2,4 +2,5 @@
|
||||
<entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282047302" name="foo" size="23" />
|
||||
<entry md5="17b9e9e1a032ed44e7a584dc6303ffa8" mtime="1282047303" name="merge" size="48" />
|
||||
<entry md5="7efa70f68983fad1cf487f69dedf93e9" mtime="1282047303" name="nochange" size="25" />
|
||||
<entry md5="b1b642cdbacf9956104f8565e297ed00" mtime="1283246089" name="binary" size="27" />
|
||||
</directory>
|
||||
|
@@ -133,6 +133,37 @@ class TestDiffFiles(OscTestCase):
|
||||
@@ -1,1 +0,0 @@
|
||||
-some content
|
||||
""" % (TestDiffFiles.diff_hdr % 'nochange', TestDiffFiles.diff_hdr % 'somefile')
|
||||
self.__check_diff(p, exp, None)
|
||||
|
||||
def testDiffBinaryAdded(self):
|
||||
"""diff an added binary file"""
|
||||
self._change_to_pkg('binary')
|
||||
p = osc.core.Package('.')
|
||||
p.todo = ['binary_added']
|
||||
exp = """%s
|
||||
Binary file 'binary_added' added.
|
||||
""" % (TestDiffFiles.diff_hdr % 'binary_added')
|
||||
self.__check_diff(p, exp, None)
|
||||
|
||||
def testDiffBinaryDeleted(self):
|
||||
"""diff a deleted binary file"""
|
||||
self._change_to_pkg('binary')
|
||||
p = osc.core.Package('.')
|
||||
p.todo = ['binary_deleted']
|
||||
exp = """%s
|
||||
Binary file 'binary_deleted' deleted.
|
||||
""" % (TestDiffFiles.diff_hdr % 'binary_deleted')
|
||||
self.__check_diff(p, exp, None)
|
||||
|
||||
def testDiffBinaryModified(self):
|
||||
"""diff a modified binary file"""
|
||||
self._change_to_pkg('binary')
|
||||
p = osc.core.Package('.')
|
||||
p.todo = ['binary']
|
||||
exp = """%s
|
||||
Binary file 'binary' has changed.
|
||||
""" % (TestDiffFiles.diff_hdr % 'binary')
|
||||
self.__check_diff(p, exp, None)
|
||||
|
||||
# diff with revision
|
||||
@GET('http://localhost/source/osctest/remote_simple_noadd?rev=3', file='testDiffRemoteNoChange_files')
|
||||
@@ -182,6 +213,7 @@ class TestDiffFiles(OscTestCase):
|
||||
|
||||
@GET('http://localhost/source/osctest/remote_simple_noadd?rev=3', file='testDiffRemoteExistingLocalNotExisting_files')
|
||||
@GET('http://localhost/source/osctest/remote_simple_noadd/foobar?rev=3', file='testDiffRemoteExistingLocalNotExisting_foobar')
|
||||
@GET('http://localhost/source/osctest/remote_simple_noadd/binary?rev=3', file='testDiffRemoteExistingLocalNotExisting_binary')
|
||||
def testDiffRemoteExistingLocalNotExisting(self):
|
||||
"""
|
||||
a file doesn't exist in the local wc but exists
|
||||
@@ -195,11 +227,14 @@ class TestDiffFiles(OscTestCase):
|
||||
@@ -1,2 +0,0 @@
|
||||
-foobar
|
||||
-barfoo
|
||||
""" % (TestDiffFiles.diff_hdr % 'foobar')
|
||||
%s
|
||||
Binary file 'binary' deleted.
|
||||
""" % (TestDiffFiles.diff_hdr % 'foobar', TestDiffFiles.diff_hdr % 'binary')
|
||||
self.__check_diff(p, exp, 3)
|
||||
|
||||
@GET('http://localhost/source/osctest/remote_localmodified?rev=3', file='testDiffRemoteUnchangedLocalModified_files')
|
||||
@GET('http://localhost/source/osctest/remote_localmodified/nochange?rev=3', file='testDiffRemoteUnchangedLocalModified_nochange')
|
||||
@GET('http://localhost/source/osctest/remote_localmodified/binary?rev=3', file='testDiffRemoteUnchangedLocalModified_binary')
|
||||
def testDiffRemoteUnchangedLocalModified(self):
|
||||
"""remote revision didn't change, local file is modified"""
|
||||
self._change_to_pkg('remote_localmodified')
|
||||
@@ -210,7 +245,9 @@ class TestDiffFiles(OscTestCase):
|
||||
@@ -1,1 +1,2 @@
|
||||
This file didn't change.
|
||||
+oh it does
|
||||
""" % (TestDiffFiles.diff_hdr % 'nochange')
|
||||
%s
|
||||
Binary file 'binary' has changed.
|
||||
""" % (TestDiffFiles.diff_hdr % 'nochange', TestDiffFiles.diff_hdr % 'binary')
|
||||
self.__check_diff(p, exp, 3)
|
||||
|
||||
@GET('http://localhost/source/osctest/remote_simple_noadd?rev=3', file='testDiffRemoteMissingLocalExisting_files')
|
||||
|
Reference in New Issue
Block a user