Commit Graph

826 Commits

Author SHA1 Message Date
Mads Kiilerich
b0ab086db9 convert: readability and test of rpairs function 2013-11-17 11:18:39 -05:00
Mads Kiilerich
749d4329a5 convert: update source shamap when using filemap, just as when not using filemap
The reverse mapping was introduced in 51f9f23e6ccc to make roundtrip
conversions possible ... but it did not work when using filemap.

Roundtrips with filemaps will of course only work flawlessly if inverse
mappings are used.

Especially, if a lossy convert mapping is used in one direction, then only
linear lines of development can be converted in the other direction. With this
constraint convert will do the right thing by assuming that excluded files
haven't been changed.)

A test case with general coverage of hg-hg roundtrips with filemap is added.

(There a cases where adding records of converted revisions to the shamap in the
source repository doesn't work - especially when converting the same repo to
several other repos and back. It would arguably be better if convert only
updated the shamaps in the target repo but read shamaps from both the source
and and target repo ... but that is a different story. Making the stuff we have
work consistently is step forward no matter what.)
2013-10-03 18:01:21 +02:00
Mads Kiilerich
1692899d8d convert: introduce hg.revs to replace hg.startrev and --rev with a revset
The existing knobs for controlling which revisions to convert were often
insufficient. Revsets is a shiny hammer that provides a better solution.

Revsets has been introduced in --rev handling in a lot of other places while
being more or less backwards compatible. Doing the same here would be a much
more elegant ... but that would unfortunately not work in this case.  "--rev 7"
used to mean revision 0 to 7 - it would be an unacceptable change if it
suddenly just meant revision 7.

Instead we introduce a new configuration setting. It will only work for
Mercurial repositories so adding a new commandline option for it would not be a
nice solution.

There is no way to use the fancy deprecation markup for configuration settings
so we just remove the documentation of hg.startrev.
2013-07-20 00:43:08 +02:00
Mads Kiilerich
b4c87902d8 convert: refactor head calculation for hg sources 2013-10-03 18:01:21 +02:00
Mads Kiilerich
8157f844e6 convert: remove unused and incorrect default handling for revmapfile
destc is not a string and can thus not be os.path.join'ed. Convert would crash
if we ended up there ... but we wouldn't because both the sinks (hg and
subversion) sinks implement .revmapfile and "never" throws exceptions.
2013-07-19 14:20:11 +02:00
Mads Kiilerich
29b14aad65 convert: fix description of 'convert --rev' 2013-07-19 02:32:36 +02:00
Mads Kiilerich
15460985a6 convert: fix crash when existing converted revision didn't come from source
This case can happen when converting from multiple repositories with filemap.
2013-10-02 19:46:48 +02:00
Mads Kiilerich
329d4ea1f9 convert: fix crash when filemap filtering is changed 2013-10-02 19:46:47 +02:00
Augie Fackler
aeb89622cb convert: move import of xml.minidom.dom to its own line for check-code 2013-09-20 10:15:23 -04:00
Frank Kingswood
cded2790ad convert: handle changeset sorting errors without traceback (issue3961) 2013-07-26 14:44:13 +01:00
Matt Mackall
a65a9a8446 convert: catch empty origpaths in svn gettags (issue3941) 2013-07-19 16:45:44 -05:00
Mads Kiilerich
e49b0f2e4b convert: fix bad conversion of copies when hg.startrev is specified
The 'copynode' was looked up in self.keep as if it was a changeset node. It is
however a filelog node, and self.keep would thus fail if it actually looked at
its parameter ... which it only did if a startrev was specified.

Instead we now don't check the copy node - we don't have to. It must have been
copied from one of the parents, and we already check whether one of the parents
have the copy source.

We could perhaps use linkrev to see if the corresponding changeset was
converted ... but that would sometimes be wrong.

The existing test of this was wrong - now it is better, but it seems like it
exposes a 'log' issue.
2013-07-19 01:40:57 +02:00
Szymon Wroblewski
f07e68437b splicemap: support paths with spaces in splicemap (issue3844)
Shlex module was used to split line as suggested. Split operates in POSIX mode.
2013-05-08 20:55:56 +02:00
Matt Mackall
0f25695305 merge with stable 2013-05-05 18:51:34 -05:00
Blesso hrvoje1212@gmail.com
36f0d7039a convert: fix bug of wrong CVS path parsing without port number (issue3678)
The cvsps.py:getrepopath suffers from a string parsing bug (it returns
"user@server/path/to/repository" if the CVSROOT is given like this:
":pserver:user@server/path/to/repository" ), which gives returnes the wrong
value becouse cvsps.py fails to strip the prefix from filenames.
With this patch for the same input we get the correct repo path that is:
"/path/to/repository"
2013-05-03 19:34:59 +02:00
Ben Goswami
bf2e9422e6 splicemap: improve error handling when source is subversion (issue2084)
Implemented error handling on splicemap file when source is
subversion (This checks are similar to when source is hg or git).

The revision string is expected to be of svn:<uuid><path>@<number>
format.

the test case has been enhanced to check this format.
2013-04-25 18:01:00 -07: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
Ben Goswami
8afeeb7248 splicemap: improve error handling when source is hg (issue2084)
1. Introduced 2 levels of error handling for splicemap files
   a. Check the splicemap file for rules which are same across different
      types of source repos.  This is done through enhancing parsesplicemap
      function
   b. Check revision string formats.  Each repo may have their own format.
      This is done usign checkrevformat function
   c. Implemented the above two for hg
2013-04-25 11:50:26 -07:00
Ben Goswami
e47f0885b5 splicemap: move parsesplicemap to convcmd.py (issue2084)
parsesplicemap is only referenced from convcmd.py
This move is necessary to enable other changes related to
this issue
2013-04-24 18:26:37 -07:00
Constantine Linnick
4d22c22a01 convert: add closesort algorithm to mercurial sources
If you actively work with branches, sometimes you need to close old branches
which last commited hundreds revisions ago. After close you will see long
lines in graph visually spoiling history. This sort only moves closed
revisions as close as possible to parents and does not increase storage size
as datesort do.
2013-03-24 00:06:52 +07:00
Matt Mackall
ce5cc60bf7 convert: stabilize cvsps commitid sort order 2013-02-22 16:40:27 -06:00
Augie Fackler
5c8acaf5b4 git convert: some versions of git use fatal: instead of error:
I saw this behavior with git 1.7.12 on my Mac.
2013-02-08 07:09:48 -06:00
Ross Lagerwall
cb8603510f convert/git: catch errors from modern git-ls-remote (issue3428)
Since git v1.7.8.2-327-g926f1dd (the change was first released in git
1.7.10), git does not return non-zero when "git ls-remote --tags ..."
is run and the repository is damaged. This causes the "damaged
repository with missing commit" test in test-convert-git.t to
unexpectedly succeed.

Fix by aborting if git outputs any lines beginning with "error:",
which required adding some subprocess use in convert/git.py.
2013-02-08 08:02:57 -06:00
Mads Kiilerich
65e8a6dd50 convert: make toposort order stable when multiple orderings are possible
The output of some tests are changed. Not necessarily to the better, just other
valid permutations.
2012-12-13 23:15:51 +01:00
Mads Kiilerich
41b6d5130f convert: report cvsps branchpoints sorted 2013-01-15 02:59:14 +01:00
Mads Kiilerich
0e2ceeaa5d convert: process subversion branch in a sorted order 2013-01-15 02:59:14 +01:00
Mads Kiilerich
527f4a6941 convert: process missing branches in sorted order 2013-01-15 02:59:14 +01:00
Mads Kiilerich
52b725744f convert: process splicemap in sorted order 2013-01-15 02:59:14 +01:00
Kevin Bullock
bd7b56e105 merge with stable 2013-01-14 10:17:06 -06:00
FUJIWARA Katsunori
9fd6562bca convert: correct 'hooks' section name in online help
The section name for hooks is not 'hook', but 'hooks'.
2013-01-14 23:14:45 +09:00
Idan Kamara
547e15c84f cvsps: fix indentation 2013-01-09 21:11:00 +02:00
Bryan O'Sullivan
7b68f267c0 convert: fix most test-check-code-hg violations in cvsps code 2013-01-08 16:26:52 -08:00
Frank Kingswood
41de1ef081 cvsps: use commitids (when present) to detect changesets
Simplify core logic by no longer attempting to work around missing
class attributes. Instead always generate the attributes and ignore
the cache if the attributes are missing
2013-01-08 20:11:20 +00:00
Julian Cowley
15e470ce7f convert: add config option to use the local time zone
The default for the time zone offset in a converted changeset has
always been 0 (UTC).  With this patch, the converted changeset is
modified so that the local offset from UTC is specified as the time
zone offset.

The option is specified as the boolean convert.localtimezone (default
False).  Example usage:

    hg convert -s cvs --config convert.localtimezone=True example-cvs example-hg

IMPORTANT: the patch only applies to conversions from cvs or svn.
The documentation for the option only appears in those two sections
in the convert help text.
2012-11-18 12:26:50 -10:00
Matt Mackall
fd58e8703f i18n: wrap false positives for translation detection 2012-11-25 13:53:47 -06:00
Bryan O'Sullivan
8f2116535a convert: fix a too-long line nag 2012-11-13 13:09:42 -08: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
Augie Fackler
9766845689 bookmarks: introduce a bmstore to manage bookmark persistence
Bookmarks persistence still showed a fair amount of its legacy as a
monkeypatching extension. This encapsulates all bookmarks
serialization and parsing in a single class, and offers a single
location where other bookmarks storage engines can be substituted
in. As a result, many files no longer import the bookmarks module,
which strikes me as an encapsulation win.

This doesn't do anything to the current bookmark state yet, but I'm
hoping put that in the bmstore class as well.
2012-11-07 16:21:39 -06:00
Huayang
2cbf7a996c convert: normalize paths in filemaps (issue3612)
convert doesn't normalise double slashes in paths. Path normalization
is applied when a path is loaded into filemap and when a file lookup
request is issued to filemap.
2012-10-05 16:27:34 -07:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
timeless@mozdev.org
f659dfb743 spelling: precede 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
5cab7e44e1 spelling: further 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
0dc2f07fe8 spelling: dependent 2012-08-17 13:58:18 -07:00
timeless@mozdev.org
2a09dc2301 spelling: Explicitly 2012-08-17 13:58:18 -07:00
Bryan O'Sullivan
68bb78ae36 Merge with crew-stable 2012-09-04 13:50:50 -07:00
Mads Kiilerich
520076e707 delete some dead comments and docstrings 2012-08-21 02:41:20 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Ross Lagerwall
661779d660 util: replace util.nulldev with os.devnull
Python since 2.4 has supported os.devnull so having util.nulldev
is unnecessary.
2012-08-04 07:14:40 +02:00
Patrick Mezard
e64291c725 convert: use subprocess for all commandline calls
Avoid mixing popen and subprocess calls, it simplifies the command line
generation and quoting issues with redirections.

In practice, it fixes the subversion sink on Windows and probably helps
with monotone and darcs sources.
2012-08-03 21:37:33 +02:00
Patrick Mezard
2a34f7fc18 convert: make commandline.limit_arglist private, simplify 2012-08-03 21:05:01 +02:00