summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-06 15:26:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-12-06 15:26:29 (GMT)
commit90e0653b1824f27559cbc5c9d1f2a00fdb9400ba (patch)
tree43d8d466b417eb819c30f019051a919b88bafd86
parentcec99d8cef12d18c71b277a4cd6963d37b13e901 (diff)
downloadgit-90e0653b1824f27559cbc5c9d1f2a00fdb9400ba.zip
git-90e0653b1824f27559cbc5c9d1f2a00fdb9400ba.tar.gz
git-90e0653b1824f27559cbc5c9d1f2a00fdb9400ba.tar.bz2
hg-to-git: handle an empty dir in hg.
Mark Drago had a subversion repository which was then converted to hg and now is moving in to git. The first commit in the svn repo was just the creation of the empty directory. This made its way in to the hg repository fine, but converting from hg to git would cause an error. The problem was that hg-to-git.py tries to commit the change, git-commit fails, and then hg-to-git.py tries to checkout the new revision and that fails (because it was not created). This may have only caused an error because it was the first commit in the repository. If an empty directory was added in the middle of the repo somewhere things might have worked out fine. This patch will use the new --allow-empty option to git-commit to record such an "empty" commit, to reproduce the history recorded in hg more faithfully. Tested-by: Mark Drago <markdrago@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xcontrib/hg-to-git/hg-to-git.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
index 7a1c3e4..9befb92 100755
--- a/contrib/hg-to-git/hg-to-git.py
+++ b/contrib/hg-to-git/hg-to-git.py
@@ -211,7 +211,7 @@ for cset in range(int(tip) + 1):
os.system('git-ls-files -x .hg --deleted | git-update-index --remove --stdin')
# commit
- os.system(getgitenv(user, date) + 'git-commit -a -F %s' % filecomment)
+ os.system(getgitenv(user, date) + 'git commit --allow-empty -a -F %s' % filecomment)
os.unlink(filecomment)
# tag