Jump to content

get changeset number for a file


hypotheticalEric

Recommended Posts

I'm wondering if there is any way to get the changeset number for a file that is part of a partial workspace (all operations done through Gluon).  If I do "cm status" it always says I'm on changeset -1.  I'm guessing this is because changesets for a workspace don't really make sense for a partial workspace, correct?

If so, is it possible to get the changeset number for a specific file?  

I have an automated system as part of our pipeline that adds a text overlay on images with the changeset to make it easier to track back to the exact changeset that image version belongs to and now that we're mostly using Gluon it always says -1.

Link to comment
Share on other sites

Hello,

You are right,  the Gluon workspaces are different from the regular Plastic workspaces. If you run "cm status" in a Gluon workspace, you will see it's not actually pointing to a specific branch or changeset.

From the Gluon GUI, "Explore workspace" view, if you select any loaded file, you can see the changeset information (also last editor, revision creation date...). You just need to click on the "Details" panel.

From the command line, you can run the "cm fileinfo" command to check the revision changeset.

Regards,

Carlos.

 

 

 

Link to comment
Share on other sites

As a related question, is it possible to reserve a changeset number for a file?  For example, when I checkout a file currently on revision 27, it would reserve 28 for that file when it gets checked back in.  If someone else checks in the same file (which shouldn't really happen with binary files anyways since we typically have exclusive checkout setup) they would just get #29.  That way in a revision history for the file you could also see a message like "Changeset 28 - checked out by Jim" in the file history.

As it currently is, the "cm fileinfo" command prints out the latest version checked in.  So when I tag my images with the changeset, it's usually one changeset behind.  Not the biggest problem, but not necessarily intuitive and could lead to some confusion here and there.

Link to comment
Share on other sites

Hi,

The changeset numbers are automatically increased when you perform a checkin. Actually, this is just a local value (the universal indetificator is the changeset guid).

I don't understand at all why why you want sequential values for changes in the same file. Could you explain? Maybe don't you need to tag your your file changes with the previous changeset id but with the changeset id of the commit that you are actually performing. What do you think?

 

Best regards,

Carlos.

 

Link to comment
Share on other sites

You are right, they don't need to be sequential.  But how do I get the changeset ID of the commit I will be performing in the future?  Here's my workflow:

  1. Artist checks out a Photoshop file that will be worked on, let's say at this point it is changeset 27.
  2. In that Photoshop file is a text layer that shows the changeset on the image.  Because the changeset in the image is always out of date, it could be anything below 27.  
  3. The artist makes some changes and prepares to send it to the client.
  4. Part of the prep is to run a script that updates the changeset number of that text layer from step 2.
  5. Right now this returns 27, but I want it to return the next changeset.  It doesn't matter if it's 28 or 200, just that it is the changeset that will be assigned when the checkin is done.
  6. After saving out a copy of the file (let's say to their desktop, out of version control to keep it simple) they send it to the client.
  7. Then the artist checks in all the changes they've made.  As far as I can tell, this is when the changeset is updated.

So I want to be able to "see the future" and get that changeset number before the checkin begins.  That's where my idea of reserving a changeset number came in.

Maybe I'm doing something strange that could be done better?  Should this be done in a checkin trigger? (that would be tricky for this case but might be possible)

 

thanks!

Link to comment
Share on other sites

Hi,

I think the best solution is create a before-checkin trigger. This way you can get the changeset id linked to the new revisions you are creating:

https://www.plasticscm.com/documentation/triggers/plastic-scm-version-control-triggers-guide.shtml#Checkin

There is no way to reserve a specific changeset id value before running the checkin operation.

Regards,

Carlos.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...