subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1833403 - /subversion/trunk/subversion/tests/cmdline/shelf_tests.py
Date Tue, 12 Jun 2018 14:00:03 GMT
Author: julianfoad
Date: Tue Jun 12 14:00:03 2018
New Revision: 1833403

URL: http://svn.apache.org/viewvc?rev=1833403&view=rev
Log:
Shelving: add tests for a binary file conflict.

* subversion/tests/cmdline/shelf_tests.py
  (unshelve_undeclared_binary_mod_conflict,
   unshelve_binary_mod_conflict): New tests.
  (test_list): Run them.

Modified:
    subversion/trunk/subversion/tests/cmdline/shelf_tests.py

Modified: subversion/trunk/subversion/tests/cmdline/shelf_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/shelf_tests.py?rev=1833403&r1=1833402&r2=1833403&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/shelf_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/shelf_tests.py Tue Jun 12 14:00:03 2018
@@ -748,6 +748,65 @@ def unshelve_text_mod_conflict(sbox):
 
 #----------------------------------------------------------------------
 
+def unshelve_undeclared_binary_mod_conflict(sbox):
+  "unshelve undeclared binary mod conflict"
+
+  orig_contents='\1\2\3\4\5'
+  mod1_contents='\1\6\3\4\5'
+  mod2_contents='\1\7\3\4\5'
+  merged_contents = '<<<<<<< .working\n' + mod2_contents + '|||||||
.merge-left\n' + orig_contents + '=======\n' + mod1_contents + '>>>>>>>
.merge-right\n'
+
+  def setup(sbox):
+    sbox.simple_append('A/mu', orig_contents, truncate=True)
+
+  def modifier1(sbox):
+    sbox.simple_append('A/mu', mod1_contents, truncate=True)
+
+  def modifier2(sbox):
+    sbox.simple_append('A/mu', mod2_contents, truncate=True)
+
+  def tweak_expected_state(modified_state):
+    modified_state[0].tweak('A/mu', status='C ')
+    modified_state[1].tweak('A/mu', contents=merged_contents)
+    modified_state[1].add({
+      'A/mu.merge-left':  Item(contents=orig_contents),
+      'A/mu.merge-right': Item(contents=mod1_contents),
+      'A/mu.working':     Item(contents=mod2_contents),
+      })
+
+  unshelve_with_merge(sbox, setup, modifier1, modifier2, tweak_expected_state)
+
+#----------------------------------------------------------------------
+
+def unshelve_binary_mod_conflict(sbox):
+  "unshelve binary mod conflict"
+
+  orig_contents='\1\2\3\4\5'
+  mod1_contents='\1\6\3\4\5'
+  mod2_contents='\1\7\3\4\5'
+
+  def setup(sbox):
+    sbox.simple_append('A/mu', orig_contents, truncate=True)
+    sbox.simple_propset('svn:mime-type', 'application/octet-stream', 'A/mu')
+
+  def modifier1(sbox):
+    sbox.simple_append('A/mu', mod1_contents, truncate=True)
+
+  def modifier2(sbox):
+    sbox.simple_append('A/mu', mod2_contents, truncate=True)
+
+  def tweak_expected_state(modified_state):
+    modified_state[0].tweak('A/mu', status='C ')
+    modified_state[1].tweak('A/mu', contents=mod2_contents)
+    modified_state[1].add({
+      'A/mu.merge-left':  Item(contents=orig_contents),
+      'A/mu.merge-right': Item(contents=mod1_contents),
+      })
+
+  unshelve_with_merge(sbox, setup, modifier1, modifier2, tweak_expected_state)
+
+#----------------------------------------------------------------------
+
 def unshelve_text_prop_merge(sbox):
   "unshelve text prop merge"
 
@@ -834,6 +893,8 @@ test_list = [ None,
               refuse_to_shelve_conflict,
               unshelve_text_mod_merge,
               unshelve_text_mod_conflict,
+              unshelve_undeclared_binary_mod_conflict,
+              unshelve_binary_mod_conflict,
               unshelve_text_prop_merge,
               unshelve_text_prop_conflict,
              ]



Mime
View raw message