Cleartool findmerge select changes from file 2 by default in all cases? - clearcase

So I have a branch is that is dreadfully out of date with the rest of the world. I'd love to simply create a new branch and merge over... but that task would be even larger... anyways what I'm trying to figure out is if I can set findmerge to always accept file 2. To speed my merge up, I initially did:
cleartool findmerge <path to out of date code> -ftag <my merge from view> -merge -abort
to cover all the simple merges, but not I want to grab the 'conflicting' changes, but I really just want all changes from from 'file 2'.
Is there an easy way or flag to provide to findmerge to do that?
Or do I have to go file by file and choose each change individually?
At the end of the day, I want what is an branch that has for a specified folder what is exactly in the merge from area.
I'm guessing the answer is 'no' but I have hope, and my figures are getting tired of pressing the return key :-)

For that kind of "reset" merge, where you want one branch content to (after merge) mirror the content of the source of that merge (2), I don't use findmerge at all.
I set an activity (if I am on UCM), and I initiate a clearfsimport in order to import data from the source view to the destination view.
I then create merge arrows between any visible version of the source view and their matching element in the destination view (as in "how to ignore files when finishing private ClearCase branch?", or "Merge arrow in ClearCase" -- that is the red merge arrow --, also used in "How to perform a trivial merge of a binary file in a ClearCase VOB")
cleartool merge -ndata -to aFile -version /main/a/SourceVersion /main/a/DestVersion
That way, one source branch has been merged to the destination, and the source content has been copied over the destination view content.

Related

How to merge changes from a specific UCM activity from one ClearCase stream to another

This should in theory be quite simple, i.e. merge the changes from a specific UCM activity from one stream to another.
I had thought that I might just be able to use the Deliver command in the GUI and then select just the required activity to deliver, but it seems that the target stream is set to not allow deliveries from other streams.
From searching the documentation it seems that I might instead be able to do this via the command line using the findmerge tool, but it's not at all clear from the rather sparse documentation how you do this. It seems like it might be a two stage process, i.e. first generate a "changeset", then merge that changeset ? Also I'd like to do the merge manually for each affected file, so I would need the graphical merge tool to be invoked if possible.
If someone can give me an example findmerge + whatever command line for merging an activity that would be a great start. Also any other suggestions for how to merge an activity would be welcome.
First, deliver in UCM are (usually) made to deliver all activities.
You can try to deliver only a subset, but you quickly comes to gripe with "timeline", which are linked artificially all the activities together, forcing you at the next deliver to deliver them (all).
findmerge tool, but it's not at all clear from the rather sparse documentation how you do this. It seems like it might be a two stage process, i.e. first generate a "changeset" then merge that changeset ?
cleartool findmerge activity: is the non-UCM way to merge all versions referenced by an activity from a stream (a branch actually here) to another branch.
ct findmerge activity:A1#\pvob activity:A3#\pvob -fcsets -c "report for delivery" -merge -gmerge
See "ClearCase : Making new baseline with old baseline activities" for more on timeline (activity dependencies) and findmerge.
This is documented in the technote swg21267316:
WORKAROUND:
From the target view:
Set to an activity (setact) or create a new activity (mkact). This activity is just like the Integration activity normally used/created during a deliver. It allows you to:
check the files in after the merge.
Run a findmerge using the following format:
cleartool findmerge activity-selector ... -fcsets [-gmerge | -merge]
Merge files as needed
Checkin files that were merged
Example:
M:\int\cvob1>cleartool findmerge activity:A#\pvob -fcsets -gmerge
Needs Merge "M:\int\cvob1\old folder\new name" [to \main\int\7 from \main\int\de
v\2 base \main\int\dev\1]
Checkout comments for this and any additional elements:
deliver dependencies work around
.
Checked out "M:\int\cvob1\old folder\new name" from version "\main\int\7".
Attached activities:
activity:int-merge#\pvob "int-merge"

ClearCase UCM - How to get only latest versions from latest baseline

How to get only latest versions from latest baseline -
For example, First time in ClearCase, developers check in for the first time, we would have a.zip, b.zip ; ClearCase does the incremental baseline baseline_1. Then the build tool comes in, does it gets artifact..and deploy it - everything looks good.
Second time in ClearCase, they check in c.zip and d.zip ; ClearCase does an incremental baseline again baseline_2... now how can I get the ClearCase snapshot view to only present the new files (c.zip and d.zip) so the buil tool can only get the latest files (or last baseline)
This will go on and on and on.. so baseline will change each time.. so would the file.... and the date will not work since we don;t know the schedule or cycle. The files name can also change from *.zip to whatever...
A baseline references all the files of a component, even if it is incremental.
Using an incremental baseline in a non-UCM snapshot view wouldn't work, because it applies a label only on the elements which are changing (which means the parent directories might not have that label, because they haven't changed, which results in a config spec incapable of selecting the changed files, since said parent directory isn't even selected).
If you are after a view able to show all the latest files, what you can do is:
a sub-stream ST to stream S which produce those baselines
a rebase of ST with the latest baseline from S:
cleartool lsbl -fmt "%[latest_bls]p" -component C -stream S
a diffbl with the previous baseline, in order to get all the new versions
But you also can:
list only the changed/new files:
cleartool diffbl -pred -ver latestBl#\aPVob
access those files through a dynamic view with the extended pathnames returned by the diffbl -pred -ver command.
That would allow to list/access only the new/changed versions between 'latestBl' and its previous baseline (with latestBl obtained from the lsbl command shown above).

Activity becomes undeliverable as folder in it was delivered. What could be the remedy?

We are having 2 development stream and an integration stream in our project.
Following are the streams
ProjName-Int-Stream
Bangalore-Dev-Team
Madurai-Dev-Team
Bangalore-Dev-Team member deleted a folder and created a new folder with the same name(Uncataloged the folder and created the same). Then he added more files into it and delivered it to integration stream.
Madurai team member was working in the same folder and unaware that Bangalore member deleted it. Now his activity is not listed while he is about to deliver his changes.
Has any one faced this scenario? If so what did you do as remedy action and how did you prevent it from happening ?
Yes, those are called evil twins (see an example here: two elements -- here a directory -- created, that is "add to source control" twice, meaning they have different oid.
If the history of that directory isn't too important, the easiest way to go forward is for Madurai team to:
rebase first
accept the version of directory from Bangalore during the rebase (his own file will disappear)
redo its works on the files as newly created by Bangalore
deliver
The other (cleaner) option would be for Bengalore to:
restore removed directory "D" with its original content. The way you do that is by:
display the version tree of the parent directory of "D"
look for the previous version in that version tree which still referenced "D" in it (do some "compare with another version" between the current latest version of that parent directory and a previous version in the version tree)
right-click on that previous version (the one which stil references "D" and select "merge to", click to the current version (it will ask you to check out it)
select a graphical merge, and then, in the merge window, select the right version of the "D" (ie the one coming from the older version instead of the one re-created)
check-in the parent directory
If Bangalore did his modifications in a single activity, he could also reverse that activity, which is simpler to do.
- do the modifications in the (now present again) directory "D"
- deliver again
- then Madurai rebases, and delivers too

cleartool list activities since last 7 days

We use ClearCase UCM which has multiple Vobs (10).
How to find the activities for past one week?
Or list activities between two date ranges?
It is a bit trickey, because all cleartool lsactivity commands are limited to one pvob ("project vob" or "special vob with UCM metadata in it"):
cleartool lsact -invob \my\pvob -stream ...
And an activity can be reused (meaning an old activity can have in its changeset very recent versions)
If you have two baselines, you can easily diff them (by activity): See ..diffbl**.
ct diffbl -act baseline:bas1#\myPVob baseline:bas2#\myPVob
(that is necessary for one component within one Vob though)
But if not, you need to list all activities and their changeset, to see which one contains version produced in the relevant date range.
We are using a ClearCase UCM plugin which called "Compare BL", made by "Go Midjets". It answers your needs.
Here a useful snippet for Linux tcsh.
For each activity you get you may want to list its changed set.
You can use
cleartool lsact -s and cleartool lsact -fmt "%[versions]p" <act_Name>
as shown here:
http://www.snip2code.com/Snippet/961/list-files-changed-in-clearcase-ucm-stre?fromPage=1

How to order project solution content in SQL Server Management Studio

In SQL Server Management Studio (SSMS) running against SQL Server 2005, I have a solution which contains a number of views.
These views are not sorted alphabetically.
Can anyone provide either an explanation of why, or a solution to order them alphabetically ?
I just came across this forum post. It doesn't get any simpler.
Just edit the ssmssqlproj file.
The file for my project (SQL Main) is
located in "My Documents\SQL Server
Management Studio\Projects\SQL
Main\SQL Main\SQL Main.ssmssqlproj".
Its just an xml file. Change the
following line
<LogicalFolder Name="Queries" Type="0" Sorted="true">
to
<LogicalFolder Name="Queries" Type="0" Sorted="false">
It will revert back to true so you
need to repeat this if you make
changes. THere is probably a better
way Smile
There is a tool that you can install to sort the contents of a SQL Server Solution project.
See the following reference.
http://web.archive.org/web/20121019155526/http://www.sqldbatips.com/showarticle.asp?ID=78
Please ensure you save your work, before attempting a sort.
When you add new item to the project they are added to the end of the list. They are kept in the order that they were added to the project because this order is preserved in the corresponding *.ssmssqlproj file. To change this order, close the project/solution, then locate the *.ssmssqlproj file and edit it with Notepad or your favorite XML editor (always make a backup first!). Reorder the FileNode elements along with their children to reorder the items appearance in the Solution Explorer.
Here's the solution I took. Up votes for the recommendation of the source code, however I don't have .NET installed here, so I had to go for a manual approach.
finish working on any project or solution files you have checked out, and check these edits in.
get latest version on everything in the solution.
Check everything out
Backup the whole folder structure
open the .ssmssqlproj file in notepad
maximise notepad full screen and turn word-wrapping off
edit the .ssmssqlproj file, reordering the XML nodes in the required order
save the .ssmssqlproj file
check everything back in.
That seems to have fixed my issue.
The stored procedure listed in the following post can do it as well:
http://beyondrelational.com/blogs/jacob/archive/2009/08/22/xquery-lab-48-sorting-query-files-in-sql-server-management-studio-ssms-solution-project.aspx
Please note that the sorting is case-sensitive.
So "B..sql" will come before "a...sql".
Remember to start all your scripts with the same casing (be it lower or upper).
Another easier (I think) way to edit the ssmssqlprog is to do so with MS XML Notepad 2007. With that I could drag the nodes around to order them. Make a copy of course. 2007 appears to be the latest version and is available at ...
http://www.microsoft.com/en-us/download/details.aspx?id=7973
Another way to handle this is to start with a new query from Management Studio (not by selecting 'New Query' in the solution).
Save the query file into the solution folder with a good name.
Then 'Add Existing Item' into the solution.
It adds with your chosen name, sorted correctly instead of creating the file initially as 'SQLQuery1'.
Maybe not much better, but another option to editing the project file and reopening.
Building on the previous answer, you can add it as a new query in the solution, and when you are done, just remove it from the solution and then Add existing item to the solution, and select your new query. Doing it this way adds the new query to the correct solution folder for you before you remove and add back in.
And yet another way... while one of these ways worked for me several times... sometimes it becomes stubborn. Find the location where it is broken. Take a screenshot of the file names.
Select all the file names you need to remove before the glitch.
in other works, if it sorts a - f and then sorts b - z
Remove all the a-f (don't delete them) that occur before the b-z, then save the project.
Now add them back in and save the project again. Presto.
So far this has worked very well for me and is fairly easy to do.

Resources