Best way to “un-promote” files in Accurev?

对着背影说爱祢 提交于 2019-11-30 10:52:24
  1. Go to main stream browser

  2. Right click on stream you accidentally promoted to and choose 'Show History'

  3. In History browser, right click on the promote you wish to revert and choose 'Revert'

  4. It'll prompt you which workspace you want to put the result of the revert into, you can choose the workspace you made the accidental promote from if you like.

  5. In your workspace, the files should now be back to the state before the accidental promote. You can now promote that back up into the stream above. The stream will now contain versions of the files that have your accidental promote removed.

  6. You can note your workspace no longer contains any of the files in question, but presumably you want to get the files you accidentally promoted back into your workspace? If so go back to the history browser for the stream, right click on the promote on there you just made (the promote with the reverted edits in), and choose 'Revert'. You can then choose the same workspace as the destination.

  7. The files will probably appear in the default group for your workspace now, and be conflicted, so just select the lot, and do a merge. You will likely want to accept trivial merges here.

Once you have merged the files, they should appear in your pending filter. You should now have the same files in pending as you have before you accidentally promoted, and the stream above should have the same contents in the file as before you promoted.

Simple as that (irony intended).

Steve

user129236

The audit-friendly, append-only nature of accurev really means that reverting a change means re-applying the version that you want. Intuitively, you want to go backwards "1-step." But in an append-only system, this really means going-forward and re-applying an old version. Thus, reverting is naturally a "2-steps forward" process instead of "1-step back."

In most situations, reverting doesn't happen as often so the global value of 'append only' outweighs the revert recipe (IMO).

As a one-stop-shop consistent solution, the most accurate approach (as you mention) is t revert the promote transaction. View the stream history, find the unwanted promote, RClick > Revert. You'll need a child workspace.. why? because doing a revert may require an un-merge. Think about reverting an interstitial promote... it's like taking the lettuce out of a sandwich and needing to merge the top- and bottom- buns together. Only in a txn-based system, that revert may also include the tomato, mustard, and celery salt and as a single "undo." So you'll need to save the changes of the merge if one exists. In any case, and even if you're just undo'ing the most recent promote, just revert the change to the workspace, do the [occasional] merge, and promote everything up.

Long story short. Reverting in any CM system is a bit like doing surgery so you likely want relevant people involved.

Taking a step back. I tend to take advantage of accurev streams to validate code earlier-than-often and promoting up the chain only when validated. so the chance of reverting is less as you promote higher.

AccuRev version 5.2 introduces the ability to revert a transaction or issue directly in a stream, without involving a workspace. This is useful for reverting a change in the "release" stream, but does not solve the second part of your question (to put the new version back in the "development" stream. The full "unpromote/demote" feature is scheduled for a future release.

For more info on version 5.2, visit the release notes at -

http://www.accurev.com/download/docs/5.2.0_books/AccuRev_5_2_0_Install_Release_Notes.pdf

I say this not entirely tongue-in-cheek, but you can run Mercurial locally and then when you run into this situation roll back your Mercurial, re-promote to Accurev, and then roll Mercurial forward again. Several developers at my workplace find Accurev so burdensome to use that this pattern is gaining some traction.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!