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

        s = GitSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
Example #2
0
	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())
Example #3
0
    def test_hasPendingChanges_whenPendingModification(self):
        self.addFile('remoteChange')
        self.addRevisions('remoteChange', 1)
        self.rewind(1)

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

		s = GitSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
Example #5
0
	def test_hasPendingChanges_whenPendingRemove(self) :
		self.addFile('remoteRemove')
		self.removeFile('remoteRemove')
		self.rewind(1)

		s = GitSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
Example #6
0
 def test_remoteState(self):
     self.addFile('file')
     self.addRevisions('file', 3)
     s = GitSandbox(self.defs['sandbox'])
     self.assertEquals(self.revisions[4], s.remoteState())
     self.rewind(3)
     self.assertEquals(self.revisions[4], s.remoteState())
Example #7
0
	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())
Example #8
0
 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())
Example #9
0
	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())
Example #10
0
 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())
Example #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 = GitSandbox(self.defs['sandbox'])
        self.assertFalse(s.hasPendingChanges())
Example #12
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 = GitSandbox(self.defs['sandbox'])
		self.assertFalse(s.hasPendingChanges())
Example #13
0
	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())
Example #14
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 = GitSandbox(self.defs['sandbox'])
		self.maxDiff = None
		self.assertFalse(s.hasPendingChanges())
Example #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 = GitSandbox(self.defs['sandbox'])
        self.maxDiff = None
        self.assertFalse(s.hasPendingChanges())
Example #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 = 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()))
Example #17
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 = 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()))
Example #18
0
	def test_hasPendingChanges_whenMissingFile(self) :
		self.addFile('nonsvnRemove')
		self.x('rm %(sandbox)s/nonsvnRemove')

		s = GitSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
Example #19
0
    def test_hasPendingChanges_whenMissingFile(self):
        self.addFile('nonsvnRemove')
        self.x('rm %(sandbox)s/nonsvnRemove')

        s = GitSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
Example #20
0
 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())