| 
						
						
						
					 | 
					 | 
					@ -1,10 +1,13 @@
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					#!/usr/bin/env python
 | 
					 | 
					 | 
					 | 
					#!/usr/bin/env vpython3
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Copyright 2014 The Chromium Authors. All rights reserved.
 | 
					 | 
					 | 
					 | 
					# Copyright 2014 The Chromium Authors. All rights reserved.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# Use of this source code is governed by a BSD-style license that can be
 | 
					 | 
					 | 
					 | 
					# Use of this source code is governed by a BSD-style license that can be
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					# found in the LICENSE file.
 | 
					 | 
					 | 
					 | 
					# found in the LICENSE file.
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					"""Unit tests for git_rebase_update.py"""
 | 
					 | 
					 | 
					 | 
					"""Unit tests for git_rebase_update.py"""
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					from __future__ import print_function
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					from __future__ import unicode_literals
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import os
 | 
					 | 
					 | 
					 | 
					import os
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import sys
 | 
					 | 
					 | 
					 | 
					import sys
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -24,7 +27,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  @classmethod
 | 
					 | 
					 | 
					 | 
					  @classmethod
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  def getRepoContent(cls, commit):
 | 
					 | 
					 | 
					 | 
					  def getRepoContent(cls, commit):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    # Every commit X gets a file X with the content X
 | 
					 | 
					 | 
					 | 
					    # Every commit X gets a file X with the content X
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    return {commit: {'data': commit}}
 | 
					 | 
					 | 
					 | 
					    return {commit: {'data': commit.encode('utf-8')}}
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  @classmethod
 | 
					 | 
					 | 
					 | 
					  @classmethod
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  def setUpClass(cls):
 | 
					 | 
					 | 
					 | 
					  def setUpClass(cls):
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -119,7 +122,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.assertEqual(self.repo['E'], self.origin['E'])
 | 
					 | 
					 | 
					 | 
					    self.assertEqual(self.repo['E'], self.origin['E'])
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    with self.repo.open('bob', 'wb') as f:
 | 
					 | 
					 | 
					 | 
					    with self.repo.open('bob', 'wb') as f:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      f.write('testing auto-freeze/thaw')
 | 
					 | 
					 | 
					 | 
					      f.write(b'testing auto-freeze/thaw')
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    output, _ = self.repo.capture_stdio(self.reup.main)
 | 
					 | 
					 | 
					 | 
					    output, _ = self.repo.capture_stdio(self.reup.main)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.assertIn('Cannot rebase-update', output)
 | 
					 | 
					 | 
					 | 
					    self.assertIn('Cannot rebase-update', output)
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -158,7 +161,7 @@ class GitRebaseUpdateTest(git_test_utils.GitRepoReadWriteTestBase):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.assertIn('sub_K up-to-date', output)
 | 
					 | 
					 | 
					 | 
					    self.assertIn('sub_K up-to-date', output)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    with self.repo.open('bob') as f:
 | 
					 | 
					 | 
					 | 
					    with self.repo.open('bob') as f:
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      self.assertEqual('testing auto-freeze/thaw', f.read())
 | 
					 | 
					 | 
					 | 
					      self.assertEqual(b'testing auto-freeze/thaw', f.read())
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    self.assertEqual(self.repo.git('status', '--porcelain').stdout, '?? bob\n')
 | 
					 | 
					 | 
					 | 
					    self.assertEqual(self.repo.git('status', '--porcelain').stdout, '?? bob\n')
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |