How to download a specific version of the code from RTC? - rtc

In SVN we have one option to download code on a particular revision. This provides the flexibility to download code on old revision also for build.
Is there a option in RTC to download a code on particular revision?

Yes: once you have done a repo workspace on a stream (where that old version was baselined), you can select a component (in the components section of your workspace), and click on "Replace with".
You can then chose the baseline you want to see, and it will be downloaded if you have a local workspace or sandbox in place.
Simply don't "deliver" to the stream, or you would replace the most recent baseline by an old one.
For setting a file to an older version, it is a bit manual (as in this thread):
Right click on the file in the change set, and select "show history" (or if the file is in an editor, right click on the editor and select "Team -> Show_History). That will open the History view on the file, form which you can select the version you want.

SOLVED! 🚀
The only thing that worked for me was:
.
On your workspace's tab [Pending Changes] -> RightClick on the component that you want to get file(s) back -> [Show] -> [History]
RightClick on the "PackOfChanges" that has your wanted file(s) -> [Revert]
.
PS: It won't actually revert your actual project state to that day, and won't undo that "commit". The only thing that it does is showing on your workspace's tab [Pending Changes] all the diferences between that day and you actual code, and in every file(s) that you want back you:
"DoubleClick" the file that you want back that was showed by revert, and an Editor will appear with the diferences between you file's actual code and it self on that day, and you pass all the code from the right to the left.
After it's done, on your workspace's tab [Pending Changes], RightClick on the RevertPackage -> Remove
.
Have a nice day! 😄

Related

Intellij vcs plugin, view changed files AND file changes in the same window

I normally do git diff for this but want to leverage the intellij gui.
The Version Control tab just shows me all the files that changed:
To view the actual changes I have to select a file and choose "Show Diff".
This opens another window. Now from this other window if I want to see changes for another file I have to click this button then open the other file:
I don't like that. Is there a way to have this in the same pane? Where on the left I see a list of the changed files and I just have to select the file to see its changes? Otherwise its very clunky and unusable for being able to see a tree of changed files and selecting the one's changes I want to see
Just found it, I wanted "preview diff"

How to do a svn compare between local code base and latest from repository like in Eclipse

In Eclipse, when click Synchronize view it will show up a tree structure of diff comparison from local to svn repo. Click on each file will pop up view to show code diff.
Is there a similar feature in Intellij and how to activate it? I am on latest Intellij Ultimate btw.
Click on the Version Control button on the bottom, click on the Incoming tab. Hit the refresh button (circle with arrows). First time it will ask you if you want to set up automatic refresh. It will then show any changes pending from the repository. You can click on files and get a diff. (You may have to right click on a revision and select "Show Affected Files".)
There is no exact same view in IDEA. See https://youtrack.jetbrains.com/issue/IDEA-119596
You can use Subversion -> Compare to the Latest repository version from a file's context menu.
There is also the Incoming tab that shows changes from the server not yet applied to your working copy. You could invoke Show Diff with local from the Details pane of the Incoming change

Intellij Idea: Override and update local changes

Is there a way to override/replace the local changes from the version controls (like svn, CVS)? In Eclipse, I can right click on the project->team->synchornize.. then it shows all changes comparing to the repository. Then, If I need to override the file, "update and override" option is there. Correspondingly, Is there such a way to replace local changes in a class or a package with one click in IntelliJ Idea?
(I found a way to compare incoming changes, then I had to get one by one changes to my local class files) . I use IntelliJ Idea community edition 15
For single file you can follow below steps :
a) Right click on file
b) Git ---> Show History
c) It will show a window in which you can see the history of changes, select a commit,right click on it. Select Get.
Link : https://intellij-support.jetbrains.com/hc/en-us/community/posts/207743285/comments/207412185
If I understand the question right, I think you need to revert your local changes then update from the remote. You can do this at a class or package level, or on the whole project.
I think it is going to be an two way process.
Revert the changes (Ctrl+Alt+Z).
Update the project (Ctrl+T).
Choose the project(if you have multiple files changed), right click -> GIT -> Compare with branch(select the branch which you want to override your changes) -> it will show the differences it detected -> click "Get" icon, it prompts "Some files were locally modified" -> choose "Overwrite Modified Files"
But sometimes it doesn't work well.
Another simple but dangerous way is to use git command:
git fetch --all
git reset --hard origin/master
(Then all your local change will be lost)

Accurev: change package merge required

I've got a workspace backed to my collaboration stream (CS), the CS has a parent stream (Parent).
In my workspace I changed a file with version Parent/1 and then promoted it to the collaboration stream some times. Its version became CS/2.
Then I got an update from the Parent and found that I don't need to keep my changes in that file and purged it on the CS. Its version became "CS/2*" on the CS and "Parent/2" in my workspace.
Now I'm trying to make some changes in the file in my workspace and promote it to the CS again, but I've got the message "change package merge required" for the file.
If I understand correctly, it can't be promoted due to the file version in my workspace is not derived from CS/2. How can I resolve the issue and promote new changes to the CS?
P.S. Moreover I have a pack of such files - about 70 files. How can I resolve the problem for the whole pack of files?
Open the issue you are associating your promotion with.
Click on Changes tab.
Select the file from the list in changes tab.
Right click -> Remove.
Now promote using this issue.
the only way that i have found to fix this is to use the "send to>issue (specifying ancestor)" command from the version browser tree.
open accurev
view>view streams (pick your depot)
click the "active issues" icon in the upper-right corner
click the "show active issues" icon under the problem stream
right-click>"send to change palatte" on the source issue
right-click>"browse versions" on the problem file
select "everything" in the "show" dropdown
right-click>"send to">"issue (specifying basis)" on the latest version in the current stream
click on the earliest ancestor (this should be a common ancestor of all versions)
enter the target ticket number and click "ok"
these steps should work for any source/target issue, even "unaffiliated" changes. technically, you shouldn't have to "show everything" and choose the oldest version. you really just need to get back to a common ancestor.

IntelliJ - not asking if I want to save a file

I'm new to the IntelliJ IDE. In the past I was working with Visual Studio or Eclipse.
In those IDEs there was an asterisk * above the name of the file which has been modified.
But in IntelliJ with the default configuration I can't see if the file is modified. What's more the file is saved automatically when I change focus to another window.
I've found some options under Settings -> IDE Settings -> General -> Synchronization:
Synchronize files on frame activation
Save files on frame deactivation
Save files automatically if application is idle for...
After unchecking all that options the file is not saved automatically every time I change focus to another window, which is good. But still I can't:
see if the file is modified (no asterisk)
decide if the file should be saved when I'm closing it (IDE doesn't ask for that)
And when I'm closing IntelliJ file which has been modified is saved without even noticing.
Do you know what can I do to change how IntelliJ behaves?
After unchecking mentioned options go to:
Settings/Editor(IDE Settings)/Editor Tabs:
Check "Mark modified tabs with asterisk"
On 2019.3 Ultimate it's under:
Settings/Editor/General/Editor Tabs:
Mark modified (*)
The exact Save feature like eclipse is not available in IntelliJ.
Because IntelliJ IDEA has the ability to change so many files
simultaneously in large refactoring actions, and change them without
ever opening them, single file saves don't make very much sense. In
recognition of this, IntelliJ IDEA reserves the right to save any of
your files literally whenever it wishes. It's actually quite nice to
never have to worry about your file's save statuses, once you get used
to it.
"What if I don't like some changes I made, and want to roll them
back?", I hear you say. Well, for that IntelliJ IDEA includes this
amazing feature called the Local History. Every time it saves your
files, IntelliJ IDEA actually saves a diff of your file from it's
previous state, and saves that as well. You can see the entire edit
history of your files (going back some number of days), see the
changes you've made, and roll back any change. It rules triumphantly,
and more than makes up for the temporary disorientation caused by lack
of single-file save.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206336279/comments/207351939
To show an asterisk when a file is modified: open Settings (CTRL+ALT+S), switch to Editor > General > Editor Tabs and select the Mark modified tab with asterisk checkbox.
To remove autosave, uncheck: Appearance & Behavior > System Settings > Save files on frame deactivation