def test_hasPendingChanges_whenPendingRemove(self) : self.addFile('remoteRemove') self.removeFile('remoteRemove') self.rewind(1) s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_hasPendingChanges_whenPendingModification(self) : self.addFile('remoteChange') self.addRevisions('remoteChange',1) self.rewind(1) s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_pendingCommits(self) : self.addFile('file') self.addRevisions('file',3) self.rewind(3) s = GitSandbox(self.defs['sandbox']) self.assertEquals( self.revisions[-3:], s.pendingUpdates())
def test_update(self): self.addFile('file') self.addRevisions('file', 3) s = GitSandbox(self.defs['sandbox']) self.rewind(3) s.update() self.assertEquals(self.revisions[4], s.state())
def _test_hasPendingChanges_whenPendingRemove(self) : self.addFile('remoteRemove') self.removeFile('remoteRemove') self.x('svn up -r1 %(sandbox)s') # going back s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def _test_hasPendingChanges_whenPendingModification(self) : self.addFile('remoteChange') self.addRevisions('remoteChange',1) self.x('svn up -r1 %(sandbox)s') # going back s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_hasPendingChanges_whenPendingModification(self): self.addFile('remoteChange') self.addRevisions('remoteChange', 1) self.rewind(1) s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_hasPendingChanges_whenPendingRemove(self): self.addFile('remoteRemove') self.removeFile('remoteRemove') self.rewind(1) s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_state(self) : self.addFile('file') self.addRevisions('file',3) s = GitSandbox(self.defs['sandbox']) self.assertEquals(self.revisions[4], s.state()) self.rewind(3) self.assertEquals(self.revisions[1], s.state())
def test_update_withConflictPostpones(self): self.addFile('file') self.addRevisions('file', 3) s = GitSandbox(self.defs['sandbox']) self.rewind(2) self.addRevisions('file', 1, False) # local conflicting change s.update() self.assertEquals(self.revisions[4], s.state())
def test_update_withConflictPostpones(self) : self.addFile('file') self.addRevisions('file',3) s = GitSandbox(self.defs['sandbox']) self.rewind(2) self.addRevisions('file',1, False) # local conflicting change s.update() self.assertEquals(self.revisions[4], s.state())
def test_guilty(self): self.addFile('file') self.addRevisions('file', 3) self.rewind(3) s = GitSandbox(self.defs['sandbox']) self.assertEquals( [(rev, self.defs['username'], "change %i of file" % i) for i, rev in enumerate(self.revisions[-3:])], s.guilty())
def test_guilty(self) : self.addFile('file') self.addRevisions('file',3) self.rewind(3) s = GitSandbox(self.defs['sandbox']) self.assertEquals( [ (rev, self.defs['username'], "change %i of file"%i) for i, rev in enumerate(self.revisions[-3:]) ], s.guilty())
def _test_hasPendingChanges_whenNoPendingChanges(self) : self.addFile('remoteChange', False) self.addFile('remoteRemove', False) self.addFile('localRemove', False) self.addFile('localChange', False) self.addFile('nonsvnRemove', False) self.commitAll("State were we want to go back") s = GitSandbox(self.defs['sandbox']) self.assertFalse(s.hasPendingChanges())
def test_hasPendingChanges_whenNoPendingChanges(self): self.addFile('remoteChange', False) self.addFile('remoteRemove', False) self.addFile('localRemove', False) self.addFile('localChange', False) self.addFile('nonsvnRemove', False) self.commitAll("State were we want to go back") s = GitSandbox(self.defs['sandbox']) self.assertFalse(s.hasPendingChanges())
def _test_guilty(self) : self.addFile('file') self.addRevisions('file',3) self.x('svn up -r1 %(sandbox)s') # go to r1 s = GitSandbox(self.defs['sandbox']) self.assertEquals( [ ('2','myuser',"change 0 of file"), ('3','myuser',"change 1 of file"), ('4','myuser',"change 2 of file"), ], s.guilty())
def test_hasPendingChanges_whenLocalChanges(self): self.addFile('localRemove', False) self.addFile('localChange', False) self.commitAll("State were we want to go back") # any local modifications (but non-svn deletion) self.addRevisions('localChange', 1, False) self.removeFile('localRemove', False) self.addFile('localAdd', False) self.x('echo nonsvnAdd > %(sandbox)s/nonsvnAdd') s = GitSandbox(self.defs['sandbox']) self.maxDiff = None self.assertFalse(s.hasPendingChanges())
def _test_hasPendingChanges_whenLocalChanges(self) : self.addFile('localRemove', False) self.addFile('localChange', False) self.commitAll("State were we want to go back") # any local modifications (but non-svn deletion) self.addRevisions('localChange', 1, False) self.removeFile('localRemove', False) self.addFile('localAdd', False) self.x('echo nonsvnAdd > %(sandbox)s/nonsvnAdd') s = GitSandbox(self.defs['sandbox']) self.maxDiff = None self.assertFalse(s.hasPendingChanges())
def test_pendingChanges(self): self.addFile('remoteChange', False) self.addFile('remoteRemove', False) self.addFile('localRemove', False) self.addFile('localChange', False) self.addFile('nonsvnRemove', False) self.commitAll("State were we want to go back") self.addRevisions('remoteChange', 1, False) self.addFile('remoteAdd', False) self.removeFile('remoteRemove', False) self.commitAll("State we want to update to") self.rewind(1) # local modifications self.addRevisions('localChange', 1, False) self.removeFile('localRemove', False) self.addFile('localAdd', False) self.x('echo nonsvnAdd > %(sandbox)s/nonsvnAdd') self.x('rm %(sandbox)s/nonsvnRemove') s = GitSandbox(self.defs['sandbox']) self.maxDiff = None self.assertEquals( [ # The directory is not marked changed on git, it was on svn # (self.defs['sandbox'], ('normal', 'none', 'modified', 'none')), (self.inSandbox('localAdd'), ('added', 'none', 'none', 'none')), (self.inSandbox('localChange'), ('modified', 'none', 'none', 'none')), (self.inSandbox('localRemove'), ('deleted', 'none', 'none', 'none')), # Untracked files are not part of this report, it was on svn # (self.inSandbox('nonsvnAdd'), ('unversioned', 'none', 'none', 'none')), (self.inSandbox('nonsvnRemove'), ('missing', 'none', 'none', 'none')), (self.inSandbox('remoteAdd'), ('none', 'none', 'added', 'none')), (self.inSandbox('remoteChange'), ('normal', 'none', 'modified', 'none')), (self.inSandbox('remoteRemove'), ('normal', 'none', 'deleted', 'none')), ], sorted(s._pendingChanges()))
def test_pendingChanges(self) : self.addFile('remoteChange', False) self.addFile('remoteRemove', False) self.addFile('localRemove', False) self.addFile('localChange', False) self.addFile('nonsvnRemove', False) self.commitAll("State were we want to go back") self.addRevisions('remoteChange',1, False) self.addFile('remoteAdd', False) self.removeFile('remoteRemove', False) self.commitAll("State we want to update to") self.rewind(1) # local modifications self.addRevisions('localChange', 1, False) self.removeFile('localRemove', False) self.addFile('localAdd', False) self.x('echo nonsvnAdd > %(sandbox)s/nonsvnAdd') self.x('rm %(sandbox)s/nonsvnRemove') s = GitSandbox(self.defs['sandbox']) self.maxDiff = None self.assertEquals( [ # The directory is not marked changed on git, it was on svn # (self.defs['sandbox'], ('normal', 'none', 'modified', 'none')), (self.inSandbox('localAdd'), ('added', 'none', 'none', 'none')), (self.inSandbox('localChange'), ('modified', 'none', 'none', 'none')), (self.inSandbox('localRemove'), ('deleted', 'none', 'none', 'none')), # Untracked files are not part of this report, it was on svn # (self.inSandbox('nonsvnAdd'), ('unversioned', 'none', 'none', 'none')), (self.inSandbox('nonsvnRemove'), ('missing', 'none', 'none', 'none')), (self.inSandbox('remoteAdd'), ('none', 'none', 'added', 'none')), (self.inSandbox('remoteChange'), ('normal', 'none', 'modified', 'none')), (self.inSandbox('remoteRemove'), ('normal', 'none', 'deleted', 'none')), ], sorted(s._pendingChanges()))
def _test_pendingChanges(self) : self.addFile('remoteChange', False) self.addFile('remoteRemove', False) self.addFile('localRemove', False) self.addFile('localChange', False) self.addFile('nonsvnRemove', False) self.commitAll("State were we want to go back") self.addRevisions('remoteChange',1, False) self.addFile('remoteAdd', False) self.removeFile('remoteRemove', False) self.commitAll("State we want to update to") self.x('svn up -r1 %(sandbox)s') # going back # local modifications self.addRevisions('localChange', 1, False) self.removeFile('localRemove', False) self.addFile('localAdd', False) self.x('echo nonsvnAdd > %(sandbox)s/nonsvnAdd') self.x('rm %(sandbox)s/nonsvnRemove') s = GitSandbox(self.defs['sandbox']) self.maxDiff = None self.assertEquals( [ (self.defs['sandbox'], ('normal', 'none', 'modified', 'none')), (self.inSandbox('localAdd'), ('added', 'none', 'none', 'none')), (self.inSandbox('localChange'), ('modified', 'none', 'none', 'none')), (self.inSandbox('localRemove'), ('deleted', 'none', 'none', 'none')), (self.inSandbox('nonsvnAdd'), ('unversioned', 'none', 'none', 'none')), (self.inSandbox('nonsvnRemove'), ('missing', 'none', 'none', 'none')), (self.inSandbox('remoteAdd'), ('none', 'none', 'added', 'none')), (self.inSandbox('remoteChange'), ('normal', 'none', 'modified', 'none')), (self.inSandbox('remoteRemove'), ('normal', 'none', 'deleted', 'none')), ], sorted(s._pendingChanges()))
def _test_hasPendingChanges_whenMissingFile(self) : self.addFile('nonsvnRemove') self.x('rm %(sandbox)s/nonsvnRemove') s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_hasPendingChanges_whenMissingFile(self): self.addFile('nonsvnRemove') self.x('rm %(sandbox)s/nonsvnRemove') s = GitSandbox(self.defs['sandbox']) self.assertTrue(s.hasPendingChanges())
def test_pendingCommits(self): self.addFile('file') self.addRevisions('file', 3) self.rewind(3) s = GitSandbox(self.defs['sandbox']) self.assertEquals(self.revisions[-3:], s.pendingUpdates())