Only get the expensive branch mapping from the p4 server when not
syncing with the help of an origin remote (which we instead then use
to get new branches from).
Don't attempt to set the initialParent on multi-branch imports (useless).
At some point the code paths should be unified, but for now I need a working
git-p4 :)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Fix common path "calculation" from logs of multiple branches.
Need to use min instead of max for prev/cur to avoid out-of-bounds
string access. Also treat "i" as index of the last match instead of
a length because in case of a complete match of the two strings
i was off by one.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Added support for importing multiple branches into refs/heads instead of just refs/remotes
using --import-local. Needs some further microfix but seems to work otherwise.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Specifying --detect-branches is now only needed for the initial clone/sync.
Afterwards it's turned on implicitly if more p4 branches than remotes/p4/master
are found.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Use git format-patch and git apply --apply when extracting patches from git and
applying them to a Perforce checkout. This should make it possible to apply git
commits with binary files that cannot be handled by path.