Recursive checkout with ClearCase UCM - clearcase-ucm

I have been looking for a recursive checkout/checkin script, and everything that I have seen has been for base ClearCase only. Is there a reason for this? Does anyone have a script that can be used for ClearCase UCM?
I also don't personally see a reason that someone would have to checkout a bunch of files at once. Are there any major pitfalls to giving someone the ability to do this?
Added:
I found this, but I am unsure if this is the best way. It seems that it has your commands. I would like them to have the ability to do this with the GUI, since they aren't too familiar with the command line.
http://www.ibm.com/developerworks/rational/library/4687.html
Script to recursively Check Out and Check In
Note: For the following procedures, you need to have local
administration rights to be able to customize a ClearCase menu.
Checkout For the check out recursively option, do the following:
Start the clearmenuadmin.exe utility (to do this, click Start > Run, and
type clearmenuadmin.exe) In the Object type tab, select the directory
object. Choose checked-in as the Object state Click the new button in
the Available menu Choices pane, and then enter the following
information in the appropriate fields:
Menu Text: Checkout (recursively)...
Help Text: Check out the selected item recursively...
Command Type: Executable/Regentry
Command: Software\Atria\ClearCase\CurrentVersion\ContextMenus\CmdLineExe
Initial Directory:
Arguments: /c cleartool find $file -exec "cmd /c
cleartool checkout -nc \"%CLEARCASE_PN%\"" Comment:
When this is done, you can add this new menu entry to the This menu
contents pane by pressing the Add button. Position it as desired with
the Move up button. After completing this customization, choose
Configuration>Apply to apply the changes. Then you can test it in
Windows Explorer.
Checkin
For the check in recursively option, do the following: Start the
clearmenuadmin.exe utility In the Object type tab, select the
directory object. Choose checked-in as the Object state Click the new
button in the Available menu Choices pane, and then enter the
following information in the appropriate fields:
Menu Text: Checkin (recursively)...
Help Text: Check in the selected item recursively...
Command Type: Executable/Regentry
Command: Software\Atria\ClearCase\CurrentVersion\ContextMenus\CmdLineExe
Initial Directory:
Arguments: /c cleartool find $file -exec "cmd /c
cleartool checkin -nc -identical \"%CLEARCASE_PN%\"" Comment:
When this is done, you can add this new menu entry to the menu
contents pane, position it as desired, and apply the changes as
described in the previous procedure, and then test it in Windows
Explorer.Command:
Is this the best way to do it? (I understand the Arguements, but the Command is throwing me. (Is this the .exe on the local machine or server?) Can this be available to anyone or would I have to set this up on each machine that people are using?)

Any UCM recursive checkout would be identical to a base ClearCase one (like in "How do I perform a recursive checkout using ClearCase?").
The only difference would be the need to check for a current set activity, or to create/set one UCM activity before making any checkout.
Now, UCM or not, checkout many files without knowing if they will be modified or not is not a very good idea, because you have no easy way to detect said unmodified files when it comes to check-in all the checked out files.
(That is why a recursive checkin will have to include two steps: see "Recursive checkin using Clearcase")

Related

Where does Visual Studio store toolbar and menu customizations?

Is there a file somewhere that I can use to do massive changes to the context menu in an easier fashion?
The GUI:
gives me no way to move a command from one menu to another, nor does it let me see what the command actually is (in order to add that same exact command to another menu), thus I don't have much to work with.
And thus I am seeking a file (or a gigantic registry key? ugh.) that I can edit somewhere else where I have more powerful tools. (my VS version is Enterprise 2017 if that matters)
You can find the defaults at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Profiles, with a general settings and some language-specific overrides. There's an additional override in IDE\VC\Profiles as well.
In my case, I wanted to move 'Start new instance" on a Project into the top-level context menu. So I:
Made a copy of CurrentSettings.vssettings
Added a new command where I wanted it (via the Tools > Customize... GUI)
Found the command I wanted to clone and moved it up one
Closed VS (it saves on exit)
Compared the two files to find the diffs (use your favorite tool.) You'll find them under Category[#name="Environment_CommandBars"]\CommandBars\UserCustomizations as add remove and modify entries
Took the Cmd attribute from the moved entry and pasted it over the added one (it was Cmd="{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}:00000164" for me, to save interested parties a few steps)
Undid the move to retain only the added entry
I wasn't able to find a command entry for this anywhere in the defaults, so had to figure it out the hard way.

How can I see the change log of a directory with TFS?

I'm interested in seeing the latest changes that landed to a solution with TFS (I'm using Visual Studio). However, I can't seem to find the option: using View History on a solution or project brings up the history of the file itself. Am I missing something?
If you right click on folder the containing a solution in the Source Control Explorer window you'll see all changesets. It's obvious but I had to ask for it too. I am using TFS2010/VS2010.
Edit
Here are the steps:
Team/Connect to Team Foundation Server / select Team Project/ in Team Explorer dblclick on Source Control and in Source Control Explore right click folder containing your solution select View History and here you are.
The View History command will list you all the changesets where the file/directory was changed (add/move/content changed, deleted, etc.).
So if you do a View History on a .sln or .csproj file you'll see only the changes that were made inside the file's content, not on the "Visual Studio Item" and its related item.
To sum up, the View History command is only a File System history, there's not a smarter logic out there.
EDIT
The only way to know what changed inside a solution or project is to do a View History on the common denominator (i.e. the directory that contains everything you want to view history). But it'll still be a File System kind of History.
There's not Logical History for Solution and Projects in Visual Studio. For instance you can't know what files where added to a given project your viewing the history from two given versions. Or what projects were added/removed in the solution.
All the pieces are there (because all the changes are stored in the .csproj or .sln), but the feature itself that parses the content and retrieve the logic you want to see doesn't exist. (by the way, it's a great feature and I agree it should be there).
Bottom line: TFS/Visual Studio gives you two history system:
Based on the source control/file system, by displaying changesets.
Based on the source control/file system, by displaying labels.
That's all...
Right click on folder in solution explorer, and choose View History. Then you can see all the Changesets listed that apply to that directory. Then right click a particular changeset and choose Changeset details... to see what changes occurred in that changeset.

TFS 2010: Seeing and comparing changes after getting latest

When I get latest from TFS source control, I don't see the changes made to my workspace.
I know I can go to the Output window and see the changes, but this is just a text list with no context actions.
What I really want is to see a list of changes, with the ability to right-click a file and see differences straight away.
Is there a better, alternative way to see changes like this after getting latest?
Sounds like using the command line tool tf.exe with folderdiff command would achieve what you need.
Use the folderdiff command to display
and compare a visual representation of
the differences between files in two
server folders, in a server folder and
a local folder, or in two local
folders.
From the header toolbar click the "Find Chengsets" option (it is between History and Branch options), it will open a dialog box, on that fill your required attributes and click Find button on that dialog box.

How easy is it to roll back a file that has been checked-in in TFS?

I've (apparently) checked-in (added) a file that shouldn't have been added to a branch. I need to revert this, but since then, 20 or so changesets have been added to the repository.
I'm used to working with Subversion, where it's only a few clicks and it's out. How easy is it in TFS?
TFS is a pain to use in general (personal and biased opinion). Here's a how-to article from Microsoft on how to proceed to revert changes back (warning: more than a few clicks away).
As given in that article, the steps to revert to a prior version of (a) file(s) are:
In Source Control Explorer, right-click the file whose changeset you want to roll back, and then click Get specific version on the
context menu.
In the Get dialog box, select the prior version of the file, and then click Get. For more information, see How to: Retrieve
Old Versions of Files from
Changesets.
After this file is in your workspace, right-click the file, and then click Check Out for Edit on the context menu.
Right-click the file again, and then click Check In Pending Changes.
In the Check In - Source Files dialog box, select the file, and then click Check in.
The Resolve Conflicts dialog box appears.
Click Resolve to open the Resolve version conflict dialog box.
Select Discard server changes.
Click OK.
NOTE: To review your decision before discarding the server changes, you can click Compare to view the server and local copies
simultaneously.
In the Resolve Conflicts dialog box, click Close.
In Source Control Explorer, right-click the file, and then click Check In Pending Changes.
In the Check In - Source Files dialog box, click Check in.
As #Darin has posted, you can simply Get the state of the previous version/changeset onto your PC and then check it in as a new version, thus undoing the effect of the check in. This is dead easy and can be done from the GUI, but does involve a fair bit of faffing around.
If you're happy to use the command line, you can also command TFS to rollback the changeset for you. This does all the "work" of the above option, leaving you with a changeset in your pending changes that will undo the checkin's effect, but hopefully with a bit less effort.
If it is added by mistake, you don't want to roll back. Instead, you want to tf destroy (from the command line) that file in each of the branches.
TFS can be a bear to work with if you add a file, delete it, then re-add a new file with the same name. It makes merging much more difficult.

SourceSafe Label Search

Is there a way to search Microsoft Visual SourceSafe 6.0d for all files tagged with a specific label?
AJ had the right idea, but you just need to use the "dir" command instead of get:
ss dir -v"LABEL" $\PROJECT -R
This will output each file with version that is at that label in the format of:
someFile.c;23
someOtherFile.h;3
<filename>;<version>
For those interested if you want to quickly tell what the latest version of a file is you can do:
ss dir -v. $\PROJECT -R
Have a great time!
I don't think you can search by label, but you can get by label.
From MSDN:
To get a version by label:
Make sure that you have set a working folder in Visual SourceSafe Explorer. See How to: Set the Working Folder.
Ensure that you have set the history options. See How to: View History.
Select the project that contains the file to retrieve.
On the Tools menu, click Show History.
In the History Options dialog box, select the version of the file to retrieve and click OK.
In the History of dialog box, click Get to retrieve the version of the file that you have chosen.
In the Get dialog box, make any additional entries needed and click OK to retrieve the file.
It does seem to be a failure on Microsofts part not to put in a simple search feature on the comments of checkins/checkouts.
I have found this
http://www.codeproject.com/KB/cpp/Schiott_SourceReport.aspx
It extracts all the comments you want to a text file.
You can get by label.
This may not be the same as searching by label.
Sourcesafe accepts a label as a valid version number, so it's the same syntax:
ss get -V"my label" $\myproject -R
this will get everything labelled my label from the myproject project.

Resources