My question involves a child custody case from the State of: California
Background: While stationed on active duty in the lower 48 my wife decided to move to CA with our infant. She filed for legal separation but we both ran out of money with our lawyers and never came to terms for custody arangements. We are still legally married with no written parenting plan and have come to mutual consent for custody, visitation, and child support during the past three years. Precedent during this time for visitation has consisted of me flying to see him on average every five weeks for 4-5 days, the maximum use of my leave balance, except for one deployment upon the completion of which I used all of my accumulated leave to have a two week stay with him. All visitations are overnight with me at my parent's house who leave nearbye.
My service commitment ends this year and I intend to move to the town they live in to be with my son. We intend to complete our divorce and establish an official parenting plan that meets all of our needs once I arrive and establishes the circumstances of my life (job hours, income, etc). I desire joint physical custody and she has expressed that she wants sole custody with visitation for me. There is no history or documention of any illegal action from either parent. Child is 4, will be near 5 by time of mediation.
Questions: Basically what are my chances of gaining joint physical custody? What are reasons I would be denied? What actions can I take to posture myself for reconsideration as the child ages if I don't recieve joint physical custody? Are the circumstances surrounding the precedent visitation arrangement of any relevance (ie, i the federal government prohibited me from spending more time with my son) in evaluating a new arrangement under different circumstances (I'm free now and live near my child)?

