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

Unified Diff: git-lkgr

Issue 11886086: Add --closest option to git-lkgr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 7 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git-lkgr
diff --git a/git-lkgr b/git-lkgr
index a2680cb6134f5dbb31f35f7cd809efea0f8323a8..ee8c3ede68e05543dd11d433e1c1d683dd628860 100755
--- a/git-lkgr
+++ b/git-lkgr
@@ -16,6 +16,9 @@ while [ $# -gt 0 ]; do
checkout_branch=yes
create_branch=yes
;;
+ --closest)
+ use_closest=yes
+ ;;
--create)
create_branch=yes
;;
@@ -36,6 +39,9 @@ while [ $# -gt 0 ]; do
echo "Usage:"
echo " --checkout Create a branch and check it out."
echo " --create Create a branch."
+ echo " --closest Use closest git commit to the target svn revision."
+ echo " Otherwise --checkout may be required to create"
+ echo " a git commit for a specific svn revision."
echo " -n, --name <name> Specify the name of branch to create or reset."
echo " This will force the branch using 'git branch -f '."
echo " -q, --quiet Quiet."
@@ -95,6 +101,12 @@ else
EOF
exit 1
fi
+ closest_svn=`git svn find-rev ${closest_svn_commit}`
+fi
+
+if [ "${use_closest}" = "yes" ]; then
+ svn_lkgr="${closest_svn}"
+ git_lkgr="${closest_svn_commit}"
fi
# Determine lkgr_branch:
@@ -136,10 +148,11 @@ elif [ "${quiet}" = "yes" ]; then
exit 1
elif [ "${checkout_branch}" = "no" ]; then
echo "There is no master commit which corresponds exactly to svn revision ${svn_lkgr}."
+ echo "Call 'git lkgr --checkout' to create a branch with a commit to match ${svn_lkgr}."
if [ -n "$closest_commit" ]; then
- echo "The closest commit is ${closest_commit}."
+ echo "The closest commit is r${closest_svn}, ${closest_commit}."
+ echo "Use the --closest option to use the closest instead of the target revision."
fi
- echo "Call 'git lkgr --checkout' to create a branch with a commit to match ${svn_lkgr}."
exit 0
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698