Commit Graph

13 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
8ae5e732ec convert: detect removal of ".gitmodules" at git source revisions correctly
Before this patch, all operations applied on ".gitmodules" at git
source revisions are treated as modification, even if they are
actually removal of it.

If removal of ".gitmodules" is treated as modification unexpectedly,
"hg convert" is aborted by the exception raised in
"retrievegitmodules()" for ".gitmodules" at the git source revision
removing it, because that revision doesn't have any information of
".gitmodules".

This patch detects removal of ".gitmodules" at git source revisions
correctly.

If ".gitmodules" is removed at the git source revision, this patch
records "hex(nullid)" as the contents hash value for ".hgsub" and
".hgsubstate" at the destination revision.

This patch makes "getfile()" raise IOError also for ".hgstatus" and
".hgsubstate" if the contents hash value is "hex(nullid)", and this
tells removal of ".hgstatus" and ".hgsubstate" at the destination
revision to "localrepository.commitctx()" correctly.

For files other than ".hgstatus" and ".hgsubstate", checking the
contents hash value in "getfile()" may be redundant, because
"catfile()" for them also does so.

But this patch chooses writing it only once at the beginning of
"getfile()", to avoid writing same code twice both for ".hgsub" and
".hgsubstate" separately.
2014-07-14 23:33:59 +09:00
Martin Geisler
7316194bdf tests: don't load unnecessary graphlog extension
Since graphlog is in core, we can use 'hg log -G' instead.
2013-11-22 19:14:17 +01:00
Ben Goswami
d334de37cd splicemap: improve error handling when source is git (issue2084)
Implemented similar error handling that is done for hg in an earlier revision.
These are:
   a. add checking for splicemap file format
   b. add checking for each revision string formats
2013-04-25 16:02:58 -07:00
Ross Lagerwall
9d98fbde66 test-convert-git: stabilize corruption of test git repo
This error would show up only intermittently since the
test depended on the order of the directories returned by os.walk.

The damage repository test would delete the first object file it came
across. However, the order of the directory listing is arbitrary (it
seems to depend on the filesystem). This meant that sometimes a commit
object was deleted, sometimes a blob object and sometimes a tree
object.

So, fix by hardcoding which object to delete. Delete a commit object,
a blob object and a tree object in three separate tests.
2013-02-08 07:57:32 -06:00
Mads Kiilerich
8d4726b241 tests: use pwd instead of ${PWD} in test-convert-git.t - because of Solaris 2013-01-31 02:39:55 +01:00
YaNan Xu
69a8b90589 convert: add support for converting git submodule (issue3528)
Previously, convert aborted upon encountering a git submodule. This patch
changes it so that it now succeeds. It modifies convert_git to manually generate
'.hgsub' and '.hgsubstate' files for each git revision, so as to convert git sub
modules to non-mercurial subrepositories.
2012-10-29 17:40:13 -07:00
Eduard-Cristian Stefan
112aea1890 test-convert: disable autocrlf for git 2012-06-08 05:31:28 +03:00
Eduard-Cristian Stefan
cf08ec9f79 test-convert-git: remove the read-only attribute of repository files
Git object files are stored read-only in the filesystem. Trying to remove a
read-only file on windows will fail with access denied, so we have to make them
writeable before they can be removed.
2012-06-08 05:37:06 +03:00
Eduard-Cristian Stefan
14ce40c59d test-convert: disable autocrlf for git
Git might have autocrlf=true as a global or default setting, especially on
windows. That is not expected in the tests and can cause
+  warning: LF will be replaced by CRLF in d/b.
+  The file will have its original line endings in your working directory.

Explicitly setting it false will make the test pass in some setups - but still
not out of the box.
2012-06-08 05:31:28 +03:00
Mads Kiilerich
6260903881 tests: cleanup of echo statements left over from test conversion 2011-10-13 04:27:49 +02:00
Edouard Gomez
4060d3d548 convert: add bookmarks reading support to git backend 2011-03-25 01:38:43 +01:00
Adrian Buehlmann
758fc721d8 check-code: add 'no tab indent' check for unified tests
and fix the offending tests accordingly
2010-10-16 18:09:01 +02:00
Matt Mackall
75c074ba2e tests: unify test-convert-git 2010-09-26 17:16:46 -05:00