[svn r48347] make status on working copy objects deal with replaced files
--HG-- branch : trunk
This commit is contained in:
		
							parent
							
								
									b97ff86b0f
								
							
						
					
					
						commit
						de0879d46d
					
				| 
						 | 
					@ -33,6 +33,7 @@ class TestWCSvnCommandPath(CommonSvnTests):
 | 
				
			||||||
            assert not s.prop_modified
 | 
					            assert not s.prop_modified
 | 
				
			||||||
            assert not s.added
 | 
					            assert not s.added
 | 
				
			||||||
            assert not s.deleted
 | 
					            assert not s.deleted
 | 
				
			||||||
 | 
					            assert not s.replaced
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        dpath = self.root.join('sampledir')
 | 
					        dpath = self.root.join('sampledir')
 | 
				
			||||||
        assert_nochange(self.root.join('sampledir'))
 | 
					        assert_nochange(self.root.join('sampledir'))
 | 
				
			||||||
| 
						 | 
					@ -47,6 +48,7 @@ class TestWCSvnCommandPath(CommonSvnTests):
 | 
				
			||||||
            assert s.added
 | 
					            assert s.added
 | 
				
			||||||
            assert not s.modified
 | 
					            assert not s.modified
 | 
				
			||||||
            assert not s.prop_modified
 | 
					            assert not s.prop_modified
 | 
				
			||||||
 | 
					            assert not s.replaced
 | 
				
			||||||
        finally:
 | 
					        finally:
 | 
				
			||||||
            nf.revert()
 | 
					            nf.revert()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,6 +60,7 @@ class TestWCSvnCommandPath(CommonSvnTests):
 | 
				
			||||||
            assert not s.added
 | 
					            assert not s.added
 | 
				
			||||||
            assert s.modified
 | 
					            assert s.modified
 | 
				
			||||||
            assert not s.prop_modified
 | 
					            assert not s.prop_modified
 | 
				
			||||||
 | 
					            assert not s.replaced
 | 
				
			||||||
        finally:
 | 
					        finally:
 | 
				
			||||||
            nf.revert()
 | 
					            nf.revert()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -113,6 +116,17 @@ class TestWCSvnCommandPath(CommonSvnTests):
 | 
				
			||||||
        finally:
 | 
					        finally:
 | 
				
			||||||
            r.update()
 | 
					            r.update()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_status_replaced(self):
 | 
				
			||||||
 | 
					        p = self.root.join("samplefile")
 | 
				
			||||||
 | 
					        p.remove()
 | 
				
			||||||
 | 
					        p.ensure(dir=0)
 | 
				
			||||||
 | 
					        p.add()
 | 
				
			||||||
 | 
					        try:
 | 
				
			||||||
 | 
					            s = self.root.status()
 | 
				
			||||||
 | 
					            assert p.basename in [item.basename for item in s.replaced]
 | 
				
			||||||
 | 
					        finally:
 | 
				
			||||||
 | 
					            self.root.revert(rec=1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_diff(self):
 | 
					    def test_diff(self):
 | 
				
			||||||
        p = self.root / 'anotherfile'
 | 
					        p = self.root / 'anotherfile'
 | 
				
			||||||
        out = p.diff(rev=2)
 | 
					        out = p.diff(rev=2)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -306,6 +306,8 @@ class SvnWCCommandPath(common.FSPathBase):
 | 
				
			||||||
                rootstatus.kindmismatch.append(wcpath)
 | 
					                rootstatus.kindmismatch.append(wcpath)
 | 
				
			||||||
            elif c0 == '!':
 | 
					            elif c0 == '!':
 | 
				
			||||||
                rootstatus.incomplete.append(wcpath)
 | 
					                rootstatus.incomplete.append(wcpath)
 | 
				
			||||||
 | 
					            elif c0 == 'R':
 | 
				
			||||||
 | 
					                rootstatus.replaced.append(wcpath)
 | 
				
			||||||
            elif not c0.strip():
 | 
					            elif not c0.strip():
 | 
				
			||||||
                rootstatus.unchanged.append(wcpath)
 | 
					                rootstatus.unchanged.append(wcpath)
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
| 
						 | 
					@ -566,7 +568,7 @@ if verbose is True, then the LogEntry instances also know which files changed.
 | 
				
			||||||
class WCStatus:
 | 
					class WCStatus:
 | 
				
			||||||
    attrnames = ('modified','added', 'conflict', 'unchanged', 'external',
 | 
					    attrnames = ('modified','added', 'conflict', 'unchanged', 'external',
 | 
				
			||||||
                'deleted', 'prop_modified', 'unknown', 'update_available',
 | 
					                'deleted', 'prop_modified', 'unknown', 'update_available',
 | 
				
			||||||
                'incomplete', 'kindmismatch', 'ignored', 'locked'
 | 
					                'incomplete', 'kindmismatch', 'ignored', 'locked', 'replaced'
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, wcpath, rev=None, modrev=None, author=None):
 | 
					    def __init__(self, wcpath, rev=None, modrev=None, author=None):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue