Jump to content

Getting latest code without clean workspace (Plastic 4)


Amimoller

Recommended Posts

Hi,

Is there a way to get the latest changelist on your current branch without having to commit or shelve your pending changes?

I know it should be possible because you can do it if you only commit one file, but is there a more clean way to do it without having to submit something?

 

Cheers!

Link to comment
Share on other sites

Hi,

 

If you have pending changes in your workspace, you can go to the "Pending Changes" view:

 

vbqf.png

 

Plastic detects that there are new changesets. If you click on "View new changes" button, you will make an "update/merge" operation, to get the latest changes on the branch.

 

Regards,

Carlos

Link to comment
Share on other sites

Ahh yes that is what i was looking for.

I think it could be a little more user friendly, like when you checkin files it will tell you that you can get latest without merging and you just have to say yes or no instead of going directly to a merge operation?

Anyway just a thought.

 

Thanks for the help!

Link to comment
Share on other sites

Hi,

 

When I say "update/merge" operation, I mean if there are no conflicts there is no merge to perform, only an update and checkin operation is done. But in case there are conflicts between your checkin and the new changes, you will need to merge them.

 

Regards,

Carlos

Link to comment
Share on other sites

Is there a way to do this from a command line?

 

Our build process will commit updates to projects with the new build and version numbers.  So, if some developer merges code to the build trunk after the build machine does a check-out, but before it does a commit, the automated commit will fail - even if there are no conflicts.

 

I tried "cm update --last" but that indicates there are pending changes (due to the build) and fails to update with the new users code changes - if I open the GUI, it WILL perform the update operation without problems (as there were really no conflicts)

Link to comment
Share on other sites

Hi SilverKnight,

 

it's possible but the default merge-to mechanism in the CLI requires an interactive answer from the user:

PS C:\tmp\mer> cm update .
Searching for changed items in the workspace...
There are conflicts between the latest changes in branch and your local changes.
Do you want to perform the merge? (y/n)
y
Merging c:\tmp\mer\foo.txt
Merge done

And it will only work if inside your preferences you have the option "Allow" enabled at the "Behavior when trying to switch / update the workspace with changed items" preference.

 

You can automatize the interactive answer to select always "y" but it will not guarantee that the merge will success due to you will might have a manual conflict resolution to perform before finishing the merge.

 

There's another alternative and it's the following:

 

1) Try the commit and parse the output.

2) If the output start with "A merge is needed from" take the changeset "from".

3) Run a merge from the changeset saved.

4) Commit.

PS C:\tmp\mer> cm ci
The selected items are about to be checked in. Please wait ...
Assembling checkin data
Validating checkin data
A merge is needed from changeset cs:3@rep:mer@repserver:localhost:8084(mount:/) to changeset cs:2@rep:mer@repserver:loca
lhost:8084(mount:/) (the changeset you are currently loading) in order to checkin. The checkin operation cannot continue
. It is necessary to solve the conflicts by merging your current workspace contents with the latest contents of the bran
ch you are currently working on. Then, you can retry the checkin operation.
PS C:\tmp\mer> cm merge cs:3 --merge
The file /foo.txt needs to be merged from cs:3 to cs:2 base cs:2. Changed by both contributors.
Merging c:\tmp\mer\foo.txt
Merge done
PS C:\tmp\mer> cm ci
The selected items are about to be checked in. Please wait ...
Assembling checkin data
Validating checkin data
Uploading file data
Uploaded 7 bytes of 7 bytes (100%)
Confirming checkin operation
Modified c:\tmp\mer\foo.txt
Created changeset cs:4@br:/main@mer@localhost:8084 (mount:'/')
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...