Accurev undo a revert to basis - revert

In Accurev I have accidently purge a stream by doing a revert to basis while trying to pull the latest from the stream. This removed all the files within the stream. Is it possible to undo it? and how?

AccuRev doesn't have a command to revert a revert operation, but the following workaround will allow you to restore these elements.
Create a new stream off the stream where the purge occurred and set the time stamp to 1 second before the purge operation.
From the new stream, perform a change pallet into the stream that had the purge.
Select the elements that were purged and promote them back into the stream.

Related

How to exclude folder from stream temporarily then include it later on

I want to download a stream to a workspace and exclude certain folder(because it's too large)
then when I am done downloading I want to download it to my workspace
so
1- how to exclude a folder from stream
2- how to include the same folder without messing anything
If you only want to exclude it from your initial sync operation, you don't necessarily need to modify the stream at all. (Modifying the stream may potentially impact other workspaces using the same stream, which you don't want.)
Edit your client to point at the new stream (in this instance you don't want to use p4 switch since that auto-syncs the new stream), and then sync only the folders that you need (i.e. enumerate all the top-level folders except for the big folder in your sync command).
The next time you do an unrestricted sync, it will pick up everything that hasn't been downloaded, including the big folder that you avoided the first time around.

P4V: What is the difference between merge down and merge any in perforce streams

What is the difference between merge any and merge down in Perforce P4V?. when I try to create a stream in Perforce I am seeing these two options in Advanced settings/options.
The "merge any" option allows a merge operation to be done in either direction (up or down), whereas the default "merge down" requires that you only merge down (and must copy up instead of merging up).
https://www.perforce.com/perforce/doc.current/user/relnotes.txt:
#963443 (Bug #65298, #74627) **
The new 'mergeany' stream option allows flow rules for 'p4 merge'
to be ignored for a particular stream. The default option of
'mergedown' preserves the previously existing flow rules. Streams
created by 'p4 switch' on a personal server use 'mergeany'.

TFS cannot rollback: "The item being rolled back has changed in a later version"

The Scenario
I want to rollback a changeset.
The Problem
When I perform Rollback Entire Changeset from my $/SAM/Main branch using the VS2012 IDE, the Resolve Conflicts tab displays, and ALL of the files I'm trying to rollback have the following message associated with them:
The item being rolled back has changed in a later version
Changes being rolled back: 54460~54460 Your workspace version is: 54460
You have a pending change on the item
At this point, the only option available to me in the Resolve Conflicts tab is an Undo Rollback button.
Things to Note
CS54460 was created using the following command line:
merge $/SAM/Dev $/SAM/Main /discard /recursive /version:C54426~C54426
CS54460, when viewing the Changeset Details, performs a [merge, branch, delete] on ALL the files.
Why I Need to Do This
I need to do this, because I need to merge CS54426 from the $/SAM/Dev branch up to the $/SAM/Main branch.
Don't use rollback, just do it manually:
get the version you want to roll back to
back up the changed files
check out the changed files. If you're lucky the old code will be preserved but the checkout may force you back to the newest version.
so if necessary copy the backups over the master source files again
test and check in
My problem was solved by using the following command:
merge $/SAM/Dev $/SAM/Main /recursive **/force** /version:C54426~C54426
This forced the changeset I needed in $/SAM/Dev to disregard the "Keep Yours" changeset in $/SAM/Main, thus merging the code I needed up to the $/SAM/Main branch.
I was getting the error "TF203051: Cannot rollback item XYZ because the workspace version of the item is at or older than the version to which you are trying to rollback to. Update the version in your workspace to a newer version than the version to which you are trying to rollback to and then retry your operation." when attempting to roll back to a specific version in the history in VS2017.
The problem was that file XYZ, one of the files was included in multiple changesets, a second one was more recent than the one I was trying to roll back.
Luckily I needed to roll back that too. So the solution was to roll back both versions at the same time by selecting them together in the history view of Source Control Explorer.

after a merge down between a parent and child stream,if I rollback a specific folder, I cant see the mergedown option anymore between the two streams

In my local stream workplace, I first did a merge down from a parent stream and then used rollback to revert the merge down on a specific folder.
The rollback worked on that folder, however since the child dev stream and the parent stream are different again, I dont see a merge down option again (say I want to merge down the two streams again).
Why cant I see the merge down option again?

Overwrite from branch

I have two branches _trunk and _dev.
There is a folder (actually it's config) where intensive work is performed in both branches.
Now I need to merge from _trunk to _dev. But I need to merge only the code.
The config should be REPLACED. I'm not sure that replacing it manually is right way. How this operation is called? How do you do similair things?
It's an integration as usual, but during resolve you'll accept the source files without trying to merge them into the destination. This will replace the destination files' content with the source content.
Edit: If there are adds and deletes in the source, make sure you let Perforce propagate those with the appropriate options checked.
You can do an "Integrate/Merge" from _trunk to _dev. Any conflicts will set up in your pending changelist as a "Resolve" for each file.
For code you can let P4V attempt to merge it for you and make changes / do the merge manually. For the config files, in the resolve window do "Accept Source" - this overrides the target with the source regardless.
Likewise, if there's any where you know you don't want to bring your changes forward but still want it to recognise you've checked and accomodated for the changes, use "Accept Target"

Resources