Wolfram Posted November 11, 2016 Report Share Posted November 11, 2016 Hiho. In the past (Unity AssetServer, a purely serial VCS), we regularly needed to commit SOME changes in files, but not ALL of them. For example, there would be a bugfix or new feature in a file, but it also contained other, unfinished changes that in the worst case wouldn't even compile in their current state. So the usual workflow was to diff with the head, and then only apply those changes that needed to committed (i.e., with a diff tool like WinMerge, click together the relevant changes that needed to be committed, save that version, commit it, then undo/restore the changes in WinMerge so that the original, current WIP-version of the file was restored. As far as I can see, the PCM diff tool doesn't allow making changes on either side, it's a purely read-only, visual help. Is there some setting I missed, or do we need to change our workflow? What is the best approach of "commiting partial changes to files" in PSCM? I do not believe the hassle of something like cloning to a new branch, then manually remove all local changes that shouldn't be committed there or something like that is the best way to handle this. Link to comment Share on other sites More sharing options...
psantosl Posted November 11, 2016 Report Share Posted November 11, 2016 Hi Wolfram, Ok, there are two things you can do: 1) Use shelving. You have your file with all changes. Shelve it. Then undo the changes you do not need. checkin. Then apply the shelve to restore the other changes you didn’t checkin. 2) About the diff: suppose you checked in something you want to undo now, for whatever reason (I think you want to achieve exactly the opposite). Well, diff the last changeset you checkedin, where the change to undo is. If the right side of the diff matches your working copy (I mean, they *are the same version in version control*) then it will let you edit the right side, save it to disk, undo diffs, everything. Hope it helps :-) pablo Link to comment Share on other sites More sharing options...
Wolfram Posted November 14, 2016 Author Report Share Posted November 14, 2016 HI pablo, On 11/11/2016 at 7:41 PM, psantosl said: 1) Use shelving. You have your file with all changes. Shelve it. Then undo the changes you do not need. checkin. Then apply the shelve to restore the other changes you didn’t checkin. Thanks, that's a great concept, and it helps me accomplishing what I was looking for. It'd be great to see my baseline of the shelf in the shelves overview, though, or in the header area when examining it. The ONLY place I found that info was in each diff filename when examining a shelf, for example it says "/Assets/myfile.cs#cs:41@br:/main" in the left hand side of the diff. On 11/11/2016 at 7:41 PM, psantosl said: 2) About the diff: suppose you checked in something you want to undo now, for whatever reason (I think you want to achieve exactly the opposite). Well, diff the last changeset you checkedin, where the change to undo is. If the right side of the diff matches your working copy (I mean, they *are the same version in version control*) then it will let you edit the right side, save it to disk, undo diffs, everything. Ah, I didn't notice that. I'm not used to the automatic top-bottom split view diff when single-clicking a file in the pending changes. I always do a double-click, out of habit, and this does open the diff in a separate window - but here it is read-only, and I also don't see the "=>" and "X" markings to individually select blocks. Is this intentional? So the double-click really is just for viewing, and the "editable diff" is always the one integrated into the "pending changes" view? Also, to quickly go through these changes and decide what to keep, IMHO Keyboard shortcuts are essential. I noticed the ctrl-n/-m to move to the previous/next change, but what about actually applying or discarding a block, or undoing the last action (OK, that one is the regular ctrl-z it seems), is this possible via keyboard, or am I forced to click the "=>" and "X" each time? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.