summaryrefslogtreecommitdiff
path: root/tests/test-convert.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2011-10-01 20:49:36 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-09-27 13:27:51 +0000
commit921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch)
tree3c4a89176ea67fe4c7bf7b375488361a823c95fa /tests/test-convert.t
parent9039c805b0a7e36220101323f82735f08a104b37 (diff)
downloadmercurial-tarball-921ced43c48c1d170452a7b251b94cc96ec8dd44.tar.gz
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'tests/test-convert.t')
-rw-r--r--tests/test-convert.t189
1 files changed, 67 insertions, 122 deletions
diff --git a/tests/test-convert.t b/tests/test-convert.t
index 26a7441..ae767aa 100644
--- a/tests/test-convert.t
+++ b/tests/test-convert.t
@@ -1,3 +1,4 @@
+
$ cat >> $HGRCPATH <<EOF
> [extensions]
> convert=
@@ -120,25 +121,24 @@
to a named branch.
Mercurial Source
- ################
+ ''''''''''''''''
The Mercurial source recognizes the following configuration options, which
you can set on the command line with "--config":
convert.hg.ignoreerrors
- ignore integrity errors when reading. Use it to fix
- Mercurial repositories with missing revlogs, by converting
- from and to Mercurial. Default is False.
+ ignore integrity errors when reading. Use it to fix Mercurial
+ repositories with missing revlogs, by converting from and to
+ Mercurial. Default is False.
convert.hg.saverev
- store original revision ID in changeset (forces target IDs
- to change). It takes a boolean argument and defaults to
- False.
+ store original revision ID in changeset (forces target IDs to
+ change). It takes and boolean argument and defaults to False.
convert.hg.startrev
- convert start revision and its descendants. It takes a hg
- revision identifier and defaults to 0.
+ convert start revision and its descendants. It takes a hg
+ revision identifier and defaults to 0.
CVS Source
- ##########
+ ''''''''''
CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
indicate the starting point of what will be converted. Direct access to
@@ -152,35 +152,36 @@
The following options can be used with "--config":
convert.cvsps.cache
- Set to False to disable remote log caching, for testing and
- debugging purposes. Default is True.
+ Set to False to disable remote log caching, for testing and
+ debugging purposes. Default is True.
convert.cvsps.fuzz
- Specify the maximum time (in seconds) that is allowed
- between commits with identical user and log message in a
- single changeset. When very large files were checked in as
- part of a changeset then the default may not be long enough.
- The default is 60.
+ Specify the maximum time (in seconds) that is allowed between
+ commits with identical user and log message in a single
+ changeset. When very large files were checked in as part of a
+ changeset then the default may not be long enough. The default
+ is 60.
convert.cvsps.mergeto
- Specify a regular expression to which commit log messages
- are matched. If a match occurs, then the conversion process
- will insert a dummy revision merging the branch on which
- this log message occurs to the branch indicated in the
- regex. Default is "{{mergetobranch ([-\w]+)}}"
+ Specify a regular expression to which commit log messages are
+ matched. If a match occurs, then the conversion process will
+ insert a dummy revision merging the branch on which this log
+ message occurs to the branch indicated in the regex. Default
+ is "{{mergetobranch ([-\w]+)}}"
convert.cvsps.mergefrom
- Specify a regular expression to which commit log messages
- are matched. If a match occurs, then the conversion process
- will add the most recent revision on the branch indicated in
- the regex as the second parent of the changeset. Default is
- "{{mergefrombranch ([-\w]+)}}"
- hook.cvslog Specify a Python function to be called at the end of
- gathering the CVS log. The function is passed a list with
- the log entries, and can modify the entries in-place, or add
- or delete them.
+ Specify a regular expression to which commit log messages are
+ matched. If a match occurs, then the conversion process will
+ add the most recent revision on the branch indicated in the
+ regex as the second parent of the changeset. Default is
+ "{{mergefrombranch ([-\w]+)}}"
+ hook.cvslog
+ Specify a Python function to be called at the end of gathering
+ the CVS log. The function is passed a list with the log
+ entries, and can modify the entries in-place, or add or delete
+ them.
hook.cvschangesets
- Specify a Python function to be called after the changesets
- are calculated from the CVS log. The function is passed a
- list with the changeset entries, and can modify the
- changesets in-place, or add or delete them.
+ Specify a Python function to be called after the changesets
+ are calculated from the the CVS log. The function is passed a
+ list with the changeset entries, and can modify the changesets
+ in-place, or add or delete them.
An additional "debugcvsps" Mercurial command allows the builtin changeset
merging code to be run without doing a conversion. Its parameters and
@@ -188,7 +189,7 @@
more details.
Subversion Source
- #################
+ '''''''''''''''''
Subversion source detects classical trunk/branches/tags layouts. By
default, the supplied "svn://repo/path/" source URL is converted as a
@@ -203,24 +204,22 @@
The following options can be set with "--config":
convert.svn.branches
- specify the directory containing branches. The default is
- "branches".
+ specify the directory containing branches. The default is
+ "branches".
convert.svn.tags
- specify the directory containing tags. The default is
- "tags".
+ specify the directory containing tags. The default is "tags".
convert.svn.trunk
- specify the name of the trunk branch. The default is
- "trunk".
+ specify the name of the trunk branch. The default is "trunk".
Source history can be retrieved starting at a specific revision, instead
of being integrally converted. Only single branch conversions are
supported.
convert.svn.startrev
- specify start Subversion revision number. The default is 0.
+ specify start Subversion revision number. The default is 0.
Perforce Source
- ###############
+ '''''''''''''''
The Perforce (P4) importer can be given a p4 depot path or a client
specification as source. It will convert all files in the source to a flat
@@ -232,36 +231,36 @@
specifying an initial Perforce revision:
convert.p4.startrev
- specify initial Perforce revision (a Perforce changelist
- number).
+ specify initial Perforce revision (a Perforce changelist
+ number).
Mercurial Destination
- #####################
+ '''''''''''''''''''''
The following options are supported:
convert.hg.clonebranches
- dispatch source branches in separate clones. The default is
- False.
+ dispatch source branches in separate clones. The default is
+ False.
convert.hg.tagsbranch
- branch name for tag revisions, defaults to "default".
+ branch name for tag revisions, defaults to "default".
convert.hg.usebranchnames
- preserve branch names. The default is True.
+ preserve branch names. The default is True.
options:
- -s --source-type TYPE source repository type
- -d --dest-type TYPE destination repository type
- -r --rev REV import up to target revision REV
- -A --authormap FILE remap usernames using this file
- --filemap FILE remap file names using contents of file
- --splicemap FILE splice synthesized history into place
- --branchmap FILE change branch names while converting
- --branchsort try to sort changesets by branches
- --datesort try to sort changesets by date
- --sourcesort preserve source changesets order
-
- use "hg -v help convert" to show more info
+ -s --source-type TYPE source repository type
+ -d --dest-type TYPE destination repository type
+ -r --rev REV import up to target revision REV
+ -A --authormap FILE remap usernames using this file
+ --filemap FILE remap file names using contents of file
+ --splicemap FILE splice synthesized history into place
+ --branchmap FILE change branch names while converting
+ --branchsort try to sort changesets by branches
+ --datesort try to sort changesets by date
+ --sourcesort preserve source changesets order
+
+ use "hg -v help convert" to show global options
$ hg init a
$ cd a
$ echo a > a
@@ -291,27 +290,24 @@
pulling from ../a
searching for changes
no changes found
+ $ touch bogusfile
-conversion to existing file should fail
+should fail
- $ touch bogusfile
$ hg convert a bogusfile
initializing destination bogusfile repository
abort: cannot create new bundle repository
[255]
-
-#if unix-permissions
-
-conversion to dir without permissions should fail
-
$ mkdir bogusdir
$ chmod 000 bogusdir
+should fail
+
$ hg convert a bogusdir
abort: Permission denied: bogusdir
[255]
-user permissions should succeed
+should succeed
$ chmod 700 bogusdir
$ hg convert a bogusdir
@@ -325,8 +321,6 @@ user permissions should succeed
1 d
0 e
-#endif
-
test pre and post conversion actions
$ echo 'include b' > filemap
@@ -396,52 +390,3 @@ test bogus URL
$ hg convert -q bzr+ssh://foobar@selenic.com/baz baz
abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
[255]
-
-test revset converted() lookup
-
- $ hg --config convert.hg.saverev=True convert a c
- initializing destination c repository
- scanning source...
- sorting...
- converting...
- 4 a
- 3 b
- 2 c
- 1 d
- 0 e
- $ echo f > c/f
- $ hg -R c ci -d'0 0' -Amf
- adding f
- created new head
- $ hg -R c log -r "converted(09d945a62ce6)"
- changeset: 1:98c3dd46a874
- user: test
- date: Thu Jan 01 00:00:01 1970 +0000
- summary: b
-
- $ hg -R c log -r "converted()"
- changeset: 0:31ed57b2037c
- user: test
- date: Thu Jan 01 00:00:00 1970 +0000
- summary: a
-
- changeset: 1:98c3dd46a874
- user: test
- date: Thu Jan 01 00:00:01 1970 +0000
- summary: b
-
- changeset: 2:3b9ca06ef716
- user: test
- date: Thu Jan 01 00:00:02 1970 +0000
- summary: c
-
- changeset: 3:4e0debd37cf2
- user: test
- date: Thu Jan 01 00:00:03 1970 +0000
- summary: d
-
- changeset: 4:9de3bc9349c5
- user: test
- date: Thu Jan 01 00:00:04 1970 +0000
- summary: e
-