{"thread":{"id":"42838","subject":"Issue with git p4 clone when using multiple depots and multiple branches","startedAt":"2016-07-13T19:06:48Z","lastAt":"2016-07-13T19:06:48Z","messageCount":1,"participants":["Nikos Andrikos"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"291382","messageId":"CANn5kOsr9K35oVErEeZetwphQpNLZbKRDraMoDzVq2rdVZ-XPg@mail.gmail.com","threadId":"42838","inReplyTo":null,"subject":"Issue with git p4 clone when using multiple depots and multiple branches","fromName":"Nikos Andrikos","fromEmail":"nick.andrik@gmail.com","sentAt":"2016-07-13T19:06:36Z","receivedAt":"2016-07-13T19:06:48Z","isPatch":false,"sender":{"key":"nick.andrik@gmail.com","avatar":null},"body":"Hi,\n\nWe have a perforce structure at work that looks like this:\n\n//depot/basic/{main,branch1,branch2}/component{1,2}\n//depot/extra/{main,branch1,branch2}/extra{1,2}\n\nI'm trying to create 3 branches, i.e. main/branch1/branch2, with all\nsub-components together, i.e. component1/component2/extra1/extra2.\n\nFor this reason I have created a p4 client, with all 12 paths used like this:\n//depot/basic/main/component1/... //client.name/main/component1/...\n//depot/basic/main/component2/... //client.name/main/component2/...\n//depot/basic/extra/extra1/... //client.name/main/extra1/...\n//depot/basic/extra/extra2/... //client.name/main/extra2/...\n... similar also for branch1 and branch2.\n\nI have setup my git using these:\ngit config git-p4.clientclient.name\ngit config git-p4.branchList main/extra1\ngit config --add main/extra2make\n\nThe problem is that all //depot/extra paths are ignored when I'm\nrunning the following command\n> git p4 clone --use-client-spec --detect-branches //depot/basic@all //depot/extra@all --destination project\n\nI think the issue is in git-p4 and especially in importNewBranch.\nInstead of using:\n\"\"\"\nbranchPrefix = self.depotPaths[0] + branch + \"/\"\nself.branchPrefixes = [ branchPrefix ]\n\"\"\"\nWe should be using\n\"\"\"\nself.branchPrefixes = [x + branch + \"/\" for x in  self.depotPaths]\n\"\"\"\nSame also for \"p4ChangesForPaths([branchPrefix], ...\"\n\nWhat do you think?\n\nThanks,\nNikos\n\n--\n=Do-\nN.AND\n"}]}