u2468 Posted April 22, 2015 Report Share Posted April 22, 2015 This works: cm find changeset where branch='main/branch1' --format="{changesetid}>{parent}" --nototal6>37>68>79>8 However if the branch name contains spaces using single quotes around branch name: cm find changeset where branch='main/bad branch name' --format="{changesetid}>{parent}" --nototal (No output) If I change to double quotes around branch name: cm find changeset where branch="main/bad branch name" --format="{changesetid}>{parent}" --nototalError: unexpected char: '/' If I go back to single quotes and then put double quotes around just the branch name with spaces: Its hard to see below so here it is with extra spaces so you can see it: ' main / " bad branch name " ' cm find changeset where branch='main/"bad branch name"' --format="{changesetid}>{parent}" --nototal10>211>1012>1113>12 That seems like excessive manipulation needed by users for branch names with spaces. If the cm tool internally gets the string 'main/bad branch name/another name' and it knows / is the delimiter, can't you use a regular expression inside your cm tool to figure out that everything between / and (/ or EOL) is a name with spaces without the user having to put more quotes around it? Just a suggestion. Link to comment Share on other sites More sharing options...
manu Posted April 27, 2015 Report Share Posted April 27, 2015 Hi! you just need to surround the query body with quotes: cm find "changeset where branch='main/yi ha'" --format="{changesetid}>{parent}" --nototal This works for windows and windows and saves you to think if the branch names contains blanks, slash symbols etc. Link to comment Share on other sites More sharing options...
gweronimo Posted April 20, 2016 Report Share Posted April 20, 2016 Hi! This is interesting and good to know! It should be noted though, that the following does not work: cm find "branch where name = 'main/trac6009' " It returns 0 branches, even though that branch exists. If I remove the "parent namespace" of the branch name, leaving only 'trac6009' it works. There is a related uservoice: https://plasticscm.uservoice.com/forums/15467-general/suggestions/13071435-add-support-for-namespace-in-find-branch-command Link to comment Share on other sites More sharing options...
psantosl Posted April 21, 2016 Report Share Posted April 21, 2016 Yep, you're correct. This is how the cm find works. What it does is it translates the "find query" into SQL. Some fields are translated to "object ids" client-side, while others travel to the server. The name travels to the server, so when you say name="whatever", there's a query on the server doing branch.sname="whatever". And branches store their name, not the full name including parents. That's why. We'll certainly have to improve it one day... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.