Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Unified Diff: slave/skia_slave_scripts/utils/git_utils.py

Issue 344183004: Use new common utils where possible. (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « slave/skia_slave_scripts/utils/gclient_utils.py ('k') | slave/skia_slave_scripts/utils/gs_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: slave/skia_slave_scripts/utils/git_utils.py
diff --git a/slave/skia_slave_scripts/utils/git_utils.py b/slave/skia_slave_scripts/utils/git_utils.py
deleted file mode 100644
index da7f0976ef2dc07852fd506a11d5bc9c9d6085c7..0000000000000000000000000000000000000000
--- a/slave/skia_slave_scripts/utils/git_utils.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""This module contains functions for using git."""
-
-
-import os
-import shell_utils
-
-
-GIT = 'git.bat' if os.name == 'nt' else 'git'
-
-
-def Add(addition):
- """Run 'git add <addition>'"""
- shell_utils.run([GIT, 'add', addition])
-
-def AIsAncestorOfB(a, b):
- """Return true if a is an ancestor of b."""
- return shell_utils.run([GIT, 'merge-base', a, b]).rstrip() == FullHash(a)
-
-def FullHash(commit):
- """Return full hash of specified commit."""
- return shell_utils.run([GIT, 'rev-parse', '--verify', commit]).rstrip()
-
-def IsMerge(commit):
- """Return True if the commit is a merge, False otherwise."""
- rev_parse = shell_utils.run([GIT, 'rev-parse', commit, '--max-count=1',
- '--no-merges'])
- last_non_merge = rev_parse.split('\n')[0]
- # Get full hash since that is what was returned by rev-parse.
- return FullHash(commit) != last_non_merge
-
-def MergeAbort():
- """Abort in process merge."""
- shell_utils.run([GIT, 'merge', '--abort'])
-
-def ShortHash(commit):
- """Return short hash of the specified commit."""
- return shell_utils.run([GIT, 'show', commit, '--format=%h', '-s']).rstrip()
-
-def GetRemoteMasterHash(git_url):
- return shell_utils.run([GIT, 'ls-remote', git_url, '--verify',
- 'refs/heads/master'])
« no previous file with comments | « slave/skia_slave_scripts/utils/gclient_utils.py ('k') | slave/skia_slave_scripts/utils/gs_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698