projects
/
hvutilities.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix bug with multiple subpaths entries
[hvutilities.git]
/
scripts
/
git-hg-sub-import
diff --git
a/scripts/git-hg-sub-import
b/scripts/git-hg-sub-import
index
41617d1
..
cf2b44f
100755
(executable)
--- a/
scripts/git-hg-sub-import
+++ b/
scripts/git-hg-sub-import
@@
-5,7
+5,7
@@
set -o errexit
# http://felipec.wordpress.com/2012/11/13/git-remote-hg-bzr-2/
# Uncomment to have verbose debug output
# http://felipec.wordpress.com/2012/11/13/git-remote-hg-bzr-2/
# Uncomment to have verbose debug output
-
#
debug=1
+debug=1
print_usage()
{
print_usage()
{
@@
-16,7
+16,9
@@
print_usage()
# git-remote-hg doesn't work with Mercurial subpaths extension,
# so use it manually
hg_subpaths_config() {
# git-remote-hg doesn't work with Mercurial subpaths extension,
# so use it manually
hg_subpaths_config() {
- subpaths=$(hg showconfig | grep "subpaths")
+ subpaths=$(hg showconfig | grep "subpaths" | grep "HG_REPO")
+
+ echo "subpaths = ${subpaths}"
if [ -n ${subpaths} ]; then
sp_src=${subpaths//subpaths./}
if [ -n ${subpaths} ]; then
sp_src=${subpaths//subpaths./}
@@
-118,11
+120,22
@@
while read sub; do
# "BRANCH___-___NAME"
branch="${branch// /___}"
# "BRANCH___-___NAME"
branch="${branch// /___}"
+ if [ -n "${debug}" ]; then
+ echo "branch: ${branch}"
+ fi
+
git clone "hg::${src}" "${dest}"
git clone "hg::${src}" "${dest}"
+ cd "${dest}"
+
+ if [ -x ${HOME}/scripts/git-set-local-author.sh ]; then
+ # Make sure commits have correct author for LSI
+ ${HOME}/scripts/git-set-local-author.sh
+ fi
+
if [ "x${branch}" != "xdefault" ]; then
if [ "x${branch}" != "xdefault" ]; then
- cd "${dest}"
- git checkout "branches/${branch}"
+ # Make tracking branch
+ git checkout
-f
"branches/${branch}"
# Adjusting git tree to specific commit specified in
# .hgsubstate:
# Adjusting git tree to specific commit specified in
# .hgsubstate:
@@
-131,10
+144,10
@@
while read sub; do
# to a hash in git using the ${num} variable:
git_rev=$(git log --oneline | sed -n "${num}p" | awk '{print $1}')
git reset --hard ${git_rev}
# to a hash in git using the ${num} variable:
git_rev=$(git log --oneline | sed -n "${num}p" | awk '{print $1}')
git reset --hard ${git_rev}
-
- cd ..
fi
fi
+ cd ..
+
if ! grep -q "${dest}" .gitignore ; then
# Ignore subrepo in top-level git repository
echo "${dest}" >> .gitignore
if ! grep -q "${dest}" .gitignore ; then
# Ignore subrepo in top-level git repository
echo "${dest}" >> .gitignore