lm1 / git-p4s Goto Github PK
View Code? Open in Web Editor NEWImport Perforce stream history into a git repository.
Import Perforce stream history into a git repository.
Hi,
I am trying to initialise a repo with a number of streams from our p4 depot.
git-p4s.py sync //spfw/Main //spfw/sp16 //spfw/sp16_rtos //spfw/ppth //spfw/sp17 //spfw/neos_test //spfw/logos-test //spfw/ATBaha
The process gets to about 20% and then it dies with the following error:
Traceback (most recent call last):
File "/Users/joseph/etc/bin/git-p4s.py", line 1459, in <module>
main()
File "/Users/joseph/etc/bin/git-p4s.py", line 1455, in main
if not cmd.run():
File "/Users/joseph/etc/bin/git-p4s.py", line 1414, in run
self.importChanges(allChanges)
File "/Users/joseph/etc/bin/git-p4s.py", line 1299, in importChanges
self.importChange(stream, details)
File "/Users/joseph/etc/bin/git-p4s.py", line 1274, in importChange
merges = self.detectMerges(depotpath, change, files, integrates)
File "/Users/joseph/etc/bin/git-p4s.py", line 1229, in detectMerges
if self.isMergeFrom(stream, change, srcStream, srcChange):
File "/Users/joseph/etc/bin/git-p4s.py", line 1194, in isMergeFrom
if diff[0]["code"] == "error":
IndexError: list index out of range
In debugging I find that the p4 command raises an EOFError without adding any results (not surprising given the -q flag). When running the p4 command manually I see that every result entry gives "identical".
Consequently, I have worked around the issue (I hope) by adding a condition that returns true if diff is empty:
if not diff:
return True
Is this correct?
I'm trying to use your tool (thank you BTW, very important to my current radar).
I'm trying to bring in the following stream format
mainline (//streamsdepot/main_ProjectA)
|-->release 1.0 (//streamsdepot/rel_ProjectA_1_0)
I do this by going into a blank local git repo folder on my desktop and type the following command
python ..\git-p4s\git-p4s.py sync //streamsdepot/main_ProjectA //streamsdepot/rel_ProjectA_1_0
The import is "successful", however I see the following when I run git branch
`
This means that both code "branches" are under the "master" branch. I thought it should find the branch point in perforce, create the branch, fork the code, and then continue on with merges to both branches and not just put code into simple folders in git.
Am I doing something incorrectly here?
Thanks!
Stephen
Tasks streams differ from other stream types in that they are "sparse". They only contain files that were changed in the stream.
This is also how they appear in git, which is not correct - they should have all the files that existed in the parent at the branch point as well.
If you can give me a summary of the changes that would be required I can implement them. Its not immediately obvious to me how to go about this. It looks like P4Sync.importChange should call filelog on the parent stream with the changelist number of the branch point, but I am not certain.
What would be required to achieve this?
Is it possible to get a partial solution by adding the metadata that git-p4 uses so that if you sync using p4s you can subsequently submit to a single stream using git-p4? (NB I saw the readme comment about compatibility, but I'm curious if there is any way to get partial compatibility in order to use their submit functionality)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.