Simon Hausmann
77083daac7
Set git fast-import marks for every imported change for future use.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:56:46 +01:00
Simon Hausmann
53b03239aa
After marking a p4 branch as merged don't ever merge it in git again.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:44:02 +01:00
Simon Hausmann
dcacf8b447
More fixes in heuristic p4 branch detection based on common path components.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:41:45 +01:00
Simon Hausmann
766887e110
Started work on p4 branch detection (experimental!).
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:04:59 +01:00
Simon Hausmann
44b3add651
Code cleanups.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 20:28:58 +01:00
Michael Loeffler
d63ea11594
import-tars: brown paper bag fix for file mode.
...
There is a bug with this $git_mode variable which should be 0644
or 0755, but nothing else I think.
Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12 12:19:45 -05:00
Simon Hausmann
12d04ca7da
Cleanups, remove unused variable.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-11 21:35:34 +01:00
Simon Hausmann
fc21f8a1da
Create lightweight git tags (using the "reset" trick) for the incremental import instead of full-blown ones. Also fix parsing the output of git name-rev for figuring out the last imported p4 change number.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-11 18:04:39 +01:00
Simon Hausmann
f7d63b0c99
Added a little helper script to remove unused tags from the perforce import.
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-02-10 10:26:03 +01:00
Simon Hausmann
fe2193183a
Changed the default git import branch from "p4" to "master".
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-10 10:05:51 +01:00
Simon Hausmann
8718f3ec9a
Avoid the excessive use of git tags for every perforce change and instead just create one git tag for the last imported change.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-10 10:05:29 +01:00
Simon Hausmann
b41507a427
Minor code cleanups.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-10 09:25:22 +01:00
Simon Hausmann
20c7bc76b9
Added a little helper script to debug the output of the p4 python interface.
...
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-08 23:00:19 +01:00
Shawn O. Pearce
590dd4bfd2
tar archive frontend for fast-import.
...
This is an example fast-import frontend, in less than 100 lines
of Perl. It accepts one or more tar archives on the command line,
passes them through gzcat/bzcat/zcat if necessary, parses out the
individual file headers and feeds all contained data to fast-import.
No temporary files are involved.
Each tar is treated as one commit, with the commit timestamp coming
from the oldest file modification date found within the tar.
Each tar is also tagged with an annotated tag, using the basename
of the tar file as the name of the tag.
Currently symbolic links and hard links are not handled by the
importer. The file checksums are also not verified.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-08 15:37:53 -05:00
Simon Hausmann
c9c527d7b6
Made the name of the git branch used for the perforce import configurable through a new --branch=<name> commandline option.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-08 15:53:11 +01:00
Simon Hausmann
7315866824
Catch io exceptions from git fast-import again and print the error message.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-08 15:45:16 +01:00
Simon Hausmann
1e30c07dfc
Fix calculation of the newest imported revision for #head imports.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:51:51 +01:00
Simon Hausmann
23efd2545b
Make specifying the revision ranges more convenient.
...
Added support for @all as revision range specifier to import all changes to a given depot path.
Also default to an import of #head if no revrange is specified.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:37:54 +01:00
Simon Hausmann
1cd573866a
Make incremental imports easier to use by storing the p4 depot path after an import in .git/config and re-using it when we're invoked again later.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:25:56 +01:00
Simon Hausmann
e3d37cf098
Fixed incremental imports by using the correct "from" command instead of "merge" with git fast-import.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:09:49 +01:00
Simon Hausmann
c4cf2d4f87
Minor cleanups and print an error message of git fast-import if it fails.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 22:57:01 +01:00
Simon Hausmann
6d48d12f5d
Initial support for importing a directory from Perforce at a specified revision.
...
Use p4 files //depot/path/...@revision to determine the state of the project and create a "fake" git commit from it.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 18:19:55 +01:00
Simon Hausmann
68f1336fe3
Code cleanups, move the code to create a commit with fast-import into a separate function out of the main loop.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 17:42:23 +01:00
Simon Hausmann
f16255f559
Simplify the incremental import by elimination the need for a temporary import branch.
...
It turns out that git fast-import can "resume" from an existing branch just fine.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 08:23:39 +01:00
Simon Hausmann
61b3cf7c47
Started working on incremental imports from Perforce.
...
Try to find the last imported p4 change number from the git tags and try to pass the right parent for commits to git fast-import.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 00:08:51 +01:00
Simon Hausmann
79799d52b2
Fix file permissions of p4-fast-export.py to be executable.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 23:09:24 +01:00
Simon Hausmann
71f7c0d0bb
Create a git tag for every changeset imported from perforce.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 23:03:01 +01:00
Simon Hausmann
214bed8239
Fixed displaying import progress by calling flush on stdout.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:47:53 +01:00
Simon Hausmann
f26037dce3
Permit calling p4-fast-export with a depot path that has the typical ... wildcard at the end.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:41:08 +01:00
Simon Hausmann
2385536282
Avoid calling fstat for every imported file (slow!) and instead read the file data first into the python process and use the length of the bytes read for the size field of git fast-import.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:38:07 +01:00
Simon Hausmann
0dd0b9d011
Ported the remaining functions that parsed p4 shell output over to the p4 python interface.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:31:28 +01:00
Simon Hausmann
a39811b46e
Instead of parsing the output of "p4 users" use the python objects of "p4 -G users".
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:19:18 +01:00
Simon Hausmann
f6148d9129
Minor code cleanups and ported some p4 interfacing code over to the p4 python mode.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:13:17 +01:00
Simon Hausmann
701ce87633
Changed the import mechanism to write to git fast-import through a pipe instead of having p4-fast-export write to stdout and let the caller connect it to git fast-import.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 21:54:56 +01:00
Simon Hausmann
3f2ddd47c7
Removed unused p4cat function and added helper function for the perforce python interface (p4Cmd).
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 20:48:39 +01:00
Simon Hausmann
9466d479e2
Speed up the import of individual files from Perforce into git by passing the output of "p4 print" directly to git fast-import. Also try to set the mode of the file in git correctly based on file type heuristics.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 20:16:26 +01:00
Simon Hausmann
d93ed31ac4
Some fixes to the timezone conversion between the date of a perforce change and the git commit.
...
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 19:43:16 +01:00
Simon Hausmann
72b2f0ada3
Implemented basic support for converting the date of the perforce change to the git format. The timezone isn't correctly set up yet though.
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 16:39:46 +01:00
Simon Hausmann
06bb04454f
Slightly improved help usage output and made specifying the trailing slash for the depot path optional.
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 09:49:41 +01:00
Simon Hausmann
da96cd9e24
Added basic support for specifying the depot path to import from as well as the range of perforce changes.
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 09:39:20 +01:00
Simon Hausmann
16d6b8ab6f
Initial import of a python script to import changesets from Perforce into git.
...
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 00:16:59 +01:00