diff --git a/scm.py b/scm.py index f2e631106..36bb69d15 100644 --- a/scm.py +++ b/scm.py @@ -229,15 +229,6 @@ class GIT(object): key = 'branch.%s.%s' % (branch, key) GIT.SetConfig(cwd, key, value) - @staticmethod - def IsWorkTreeDirty(cwd): - return GIT.Capture(['status', '-s'], cwd=cwd) != '' - - @staticmethod - def GetEmail(cwd): - """Retrieves the user email address if known.""" - return GIT.GetConfig(cwd, 'user.email', '') - @staticmethod def ShortBranchName(branch): """Converts a name like 'refs/heads/foo' to just 'foo'.""" @@ -428,17 +419,6 @@ class GIT(object): diff[i] = '--- %s' % diff[i + 1][4:] return ''.join(diff) - @staticmethod - def GetDifferentFiles(cwd, branch=None, branch_head='HEAD'): - """Returns the list of modified files between two branches.""" - if not branch: - branch = GIT.GetUpstreamBranch(cwd) - command = [ - '-c', 'core.quotePath=false', 'diff', '--name-only', - branch + "..." + branch_head - ] - return GIT.Capture(command, cwd=cwd).splitlines(False) - @staticmethod def GetAllFiles(cwd): """Returns the list of all files under revision control.""" @@ -462,12 +442,6 @@ class GIT(object): commit_hashes[record[3]] = record[1] return commit_hashes - @staticmethod - def GetPatchName(cwd): - """Constructs a name for this patch.""" - short_sha = GIT.Capture(['rev-parse', '--short=4', 'HEAD'], cwd=cwd) - return "%s#%s" % (GIT.GetBranch(cwd), short_sha) - @staticmethod def GetCheckoutRoot(cwd): """Returns the top level directory of a git checkout as an absolute path. @@ -475,10 +449,6 @@ class GIT(object): root = GIT.Capture(['rev-parse', '--show-cdup'], cwd=cwd) return os.path.abspath(os.path.join(cwd, root)) - @staticmethod - def GetGitDir(cwd): - return os.path.abspath(GIT.Capture(['rev-parse', '--git-dir'], cwd=cwd)) - @staticmethod def IsInsideWorkTree(cwd): try: diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py index 792752243..b9f93a580 100755 --- a/tests/scm_unittest.py +++ b/tests/scm_unittest.py @@ -28,14 +28,6 @@ class GitWrapperTestCase(unittest.TestCase): super(GitWrapperTestCase, self).setUp() self.root_dir = '/foo/bar' - @mock.patch('scm.GIT.Capture') - def testGetEmail(self, mockCapture): - mockCapture.return_value = 'user.email\nmini@me.com\x00' - self.assertEqual(scm.GIT.GetEmail(self.root_dir), 'mini@me.com') - mockCapture.assert_called_with(['config', '--list', '-z'], - cwd=self.root_dir, - strip_out=False) - def testRefToRemoteRef(self): remote = 'origin' refs = {