Jump to content

Help me understand "Update"


sbaum

Recommended Posts

We will start using Plastic SCM soon after we start migrating our projects over.  We mainly work on our own projects but there are times when we work on a project together.  With our current scm tool we have exclusive checkouts, so there was no merging.  If I had some files checked out, and then another developer made changes to different files and committed, I could run a "Get Latest" command that would pull down his files to my local workspace.

 

When using Plastic, we will not use exclusive locks.  However, if a developer commits changes to files that I have not changed (on the same branch), I would expect that I could get his changes to my local workspace.  I found this guide on the Plastic site that describes exactly what I'm looking for: http://codicesoftware.blogspot.com/2012/02/working-on-single-branch-update-merge.html.  Scenario #1 is specifically what I'm trying to do (I am working on File A, another developer makes changes to File B and commits, then I want to get his File B changes).  I've run into a couple issues.

 

1. My branch explorer doesn't look like the one in that blog post.  In the blog post, when they have a pending change and are "behind the head", their branch explorer looks like this:

 

simplecase03-nowyourebehind.PNG

 

Mine looks like this:

 

post-27993-0-92042000-1398953075_thumb.jpg

 

Mine makes sense to me:  I have pending changes and therefore a dotted circle pointing back to the changeset where I started from.

 

 

2. I don't even have an "Update" option when I right click on my root folder in the "Items in Workspace" view.

 

post-27993-0-65572400-1398952827_thumb.jpg

 

No worries, I tried running "cm update <workspace>" and I also tried going into Visual Studio, right-clicking on the solution and selecting "Update to Latest Version".  Both of these actions resulted in the same message:  

The workspace c:\Workspaces\pscm_ws\portal is up-to-date (cset:22@Portal@****:8087)
There aren't new changesets on your current configuration you can switch to. You've pending changes on your workspace. If you are trying to get latest changes, try to undo those changes instead of running update.

So it appears that the update logic has changed since that blog post in 2012? The blog post makes it sound like I would be able to pull down the new content of files that I have not changed.

 

 

I wanted to try a different scenario for update: I am on changeset 22 of the branch but have not modified any files.  Developer #2 makes changes and commits changeset 23.  I know that I can simply move my workspace to this changeset, but I would expect the Update command to do the same thing.  When I run "cm update <workspace> I get:

The workspace c:\Workspaces\pscm_ws\portal is up-to-date (cset:22@Portal@****:8087)

This does not appear correct.  Changeset 23 is the latest changeset on the branch.

 

 

 

What is "Update" or "Update to Latest Version" supposed to do?  Right now they don't appear to do anything.

Link to comment
Share on other sites

Hi,

 

1. Yes, if there are new changesets in the branch and also you have pending changes tu commit, your screenshot is totally normal.

 

2. There is an "Update workspace" botton just above the root item in the "Items" view. This button actually do the same as the "cm udpate ." command. This command will update your workspace to the existing changeset.

 

If want to get the content of the new created changesets created in your branch, you have different options:

 

   2.1. Go to the "Branch explorer" right-click the last changeset --> Switck workspace to the last changeset

   2.1. " cm switchtobranch br:/main/task001" --> Update your workspace to last changeset on the branch

 

- In case you have pending changes in your workspaces, you will need to perfrom the checkin operation, this way your workspace will be updated to the last changeset of the branch, and in case there were file conflicts you would need to solve them.

 

Regards,

Carlos

Link to comment
Share on other sites

If want to get the content of the new created changesets created in your branch, you have different options:

 

   2.1. Go to the "Branch explorer" right-click the last changeset --> Switck workspace to the last changeset

   2.1. " cm switchtobranch br:/main/task001" --> Update your workspace to last changeset on the branch

 

I must say that this sound to me like a poor answer.

You mix GUI and command line, show only some options without full explanation of what it takes.

 

I am not an expert but I think there are these options in GUI in the described situation:

- Update workspace using the button in an Items view (or using Update to Latest Version in the Visual Studio)

- Update workspace / Merge all changes using a button after exploring new changes in a merge view opened from Pending changes > View new changes (Look for newer changes in repository need to be selected in Options of Pending changes)

- Checkin (possibly with a merge), which updates the workspace automatically.

- Checkin to different branch or to a Shelve and Undo the changes and then:

Switch workspace to this branch or Switch workspace to this changeset on a last changeset (which is very different for future updates!!!) from a Branch explorer (or a Branches/Changesets view). (It is not allowed to do so when you have un-checked-in changes in your workspace).

 

@sbaum:

The second problem you have is probably connected with this: (I was confused by that too before.)

Look to the upper left corner of the GUI. Do you see Branch ... or Changeset ...? If you see Changeset 22, it means that you are stuck to this changeset and any Update operation just updates your workspace to this changeset. You need to Switch to a branch. Then any Update operation would update your workspace according to the last changeset of that branch.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...