Beispiel #1
0
    def test_hasPendingChanges_whenPendingRemove(self):
        self.addFile('remoteRemove')
        self.removeFile('remoteRemove')
        self.rewind(1)

        s = SvnSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
	def test_hasPendingChanges_whenPendingModification(self) :
		self.addFile('remoteChange')
		self.addRevisions('remoteChange',1)
		self.rewind(1)

		s = SvnSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
Beispiel #3
0
    def test_hasPendingChanges_whenPendingModification(self):
        self.addFile('remoteChange')
        self.addRevisions('remoteChange', 1)
        self.rewind(1)

        s = SvnSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
	def test_hasPendingChanges_whenPendingRemove(self) :
		self.addFile('remoteRemove')
		self.removeFile('remoteRemove')
		self.rewind(1)

		s = SvnSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
	def test_update(self) :
		self.addFile('file')
		self.addRevisions('file',3)
		s = SvnSandbox(self.defs['sandbox'])
		self.rewind(3)
		s.update()
		self.assertEquals(self.revisions[4], s.state())
Beispiel #6
0
 def test_remoteState(self):
     self.addFile('file')
     self.addRevisions('file', 3)
     s = SvnSandbox(self.defs['sandbox'])
     self.assertEquals(self.revisions[4], s.remoteState())
     self.rewind(3)
     self.assertEquals(self.revisions[4], s.remoteState())
	def test_pendingCommits(self) :
		self.addFile('file')
		self.addRevisions('file',3)
		self.rewind(3)
		s = SvnSandbox(self.defs['sandbox'])
		self.assertEquals(
			self.revisions[-3:], s.pendingUpdates())
Beispiel #8
0
 def test_guilty(self):
     self.addFile('file')
     self.addRevisions('file', 3)
     self.rewind(3)
     s = SvnSandbox(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_update_withConflictPostpones(self) :
		self.addFile('file')
		self.addRevisions('file',3)
		s = SvnSandbox(self.defs['sandbox'])
		self.rewind(2)
		self.addRevisions('file',1, False) # local conflicting change
		s.update()
		self.assertEquals(self.revisions[4], s.state())
Beispiel #10
0
 def test_update_withConflictPostpones(self):
     self.addFile('file')
     self.addRevisions('file', 3)
     s = SvnSandbox(self.defs['sandbox'])
     self.rewind(2)
     self.addRevisions('file', 1, False)  # local conflicting change
     s.update()
     self.assertEquals(self.revisions[4], s.state())
Beispiel #11
0
    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 = SvnSandbox(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 = SvnSandbox(self.defs['sandbox'])
		self.assertFalse(s.hasPendingChanges())
	def test_guilty(self) :
		self.addFile('file')
		self.addRevisions('file',3)
		self.rewind(3)
		s = SvnSandbox(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_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 = SvnSandbox(self.defs['sandbox'])
		self.maxDiff = None
		self.assertFalse(s.hasPendingChanges())
Beispiel #15
0
    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 = SvnSandbox(self.defs['sandbox'])
        self.maxDiff = None
        self.assertFalse(s.hasPendingChanges())
Beispiel #16
0
    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 = SvnSandbox(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_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 = SvnSandbox(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()))
Beispiel #18
0
    def test_hasPendingChanges_whenMissingFile(self):
        self.addFile('nonsvnRemove')
        self.x('rm %(sandbox)s/nonsvnRemove')

        s = SvnSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
	def test_hasPendingChanges_whenMissingFile(self) :
		self.addFile('nonsvnRemove')
		self.x('rm %(sandbox)s/nonsvnRemove')

		s = SvnSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
Beispiel #20
0
 def test_pendingCommits(self):
     self.addFile('file')
     self.addRevisions('file', 3)
     self.rewind(3)
     s = SvnSandbox(self.defs['sandbox'])
     self.assertEquals(self.revisions[-3:], s.pendingUpdates())