Пример #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())
Пример #2
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())
Пример #3
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())
Пример #4
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())
Пример #5
0
	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())
Пример #6
0
	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())
Пример #7
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())
Пример #8
0
    def test_hasPendingChanges_whenPendingRemove(self):
        self.addFile('remoteRemove')
        self.removeFile('remoteRemove')
        self.rewind(1)

        s = GitSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
Пример #9
0
	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())
Пример #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())
Пример #11
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())
Пример #12
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())
Пример #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())
Пример #14
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())
Пример #15
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())
Пример #16
0
	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())
Пример #17
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())
Пример #18
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())
Пример #19
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()))
Пример #20
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()))
Пример #21
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.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()))
Пример #22
0
	def _test_hasPendingChanges_whenMissingFile(self) :
		self.addFile('nonsvnRemove')
		self.x('rm %(sandbox)s/nonsvnRemove')

		s = GitSandbox(self.defs['sandbox'])
		self.assertTrue(s.hasPendingChanges())
Пример #23
0
    def test_hasPendingChanges_whenMissingFile(self):
        self.addFile('nonsvnRemove')
        self.x('rm %(sandbox)s/nonsvnRemove')

        s = GitSandbox(self.defs['sandbox'])
        self.assertTrue(s.hasPendingChanges())
Пример #24
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())