Clearcase - Unite two files into one file with united History

61 views Asked by At

I have two different files each with its own history, I want to unite them as one, but keep both histories.

For example (My actual issue): I have x.vcproj and x.vcxproj, after converting from older visual studio to a newer one (I don't even remember any more which ones these were). Basically after the conversion we stopped using the old format all together.

What should have been done back then, is to write a script that goes over all converted projects (before adding anything to clearcase):

  • Checkout the x.vcproj and its containing folder.
  • Rename the x.vcxproj to some temporary file, let say x.vcxproj.temp
  • Use cleartool to rename x.vcproj to x.vcxproj
  • Overwrite x.vcxproj with the x.vcxproj.temp
  • Check in the x.vcxproj file.

This would have done the trick back then, but it has not been done, and now most of the <Project Name>.vcxproj already have their own extensive history.

Can the history of these two files be united and some how simulate the above flow?

Visual Example:

From:

x.vcproj                              x.vcxproj
 [main]                                 [main] 
   |                                      |
  (0)                                    (0)
   | \                                    | \
   |  \                                   |  \
   |  (0) [v1]                            |  (0) [v2]
   |   |                                  |   |
   |  (1)                                 |  (1) <<- First Node of x.vcxproj  
   |   | \                                |   |      
   |  (2) \                              (1)<(2) 
   |   |  (0) [v1.1]                      |   | \  
  (1)<(3)  |                              |   |  \ 
   |      (1)                             |   |  (0) [v2.1]
   |       |                              |   |   |
  (2)<----(2)                            (2)<(3)<(2)
   |                                      |       |  
  (3)                                    (3)<----(3)
   | \                                    | 
   |  \                                  (4) 
   |  (0) [v2]                            | \ 
   |   |                                  |  \
  (4)<(1) <<- Last node of x.vcproj       |  (0) [v3]
                                          |   |
                                         (5)<(1)

I want to get the following resulting tree:

x.vcproj -+-> x.vcxproj
       [main]           
         |                
        (0)               
         | \              
         |  \             
         |  (0) [v1]        
         |   |            
         |  (1)           
         |   | \          
         |  (2) \         
         |   |  (0) [v1.1]  
        (1)<(3)  |        
         |      (1)       
         |       |        
        (2)<----(2)       
         |                
        (3)               
         | \              
         |  \             
         |  (0) [v2]        
         |   |            
        (4)<(1) <<- Last node of x.vcproj          
         |   |
         |  (2) <<- First Node of x.vcxproj   
         |   |      Original Node (1) of [v2]
        (5)<(3) 
         |   | \  
         |   |  \ 
         |   |  (0) [v2.1]
         |   |   |
        (6)<(4)<(2)
         |       |  
        (7)<----(3)
         | 
        (8) 
         | \ 
         |  \
         |  (0) [v3]
         |   |
        (9)<(1)
1

There are 1 answers

6
VonC On

Can the history of these two files be united and some how simulate the above flow?

Not through a native single cleartool command, but using a script which would, folder where both x.vcxproj and x.vcproj are present:

  • checkout the parent folder
  • delete x.vcxproj
  • checkout x.vcproj, rename it to x.vcxproj, and checkin
  • then, for each version of the x.vcxproj, read through a dynamic view, accessing the previous version of the parent folder (the one where both files were still present):
    • checkout x.vcxproj,
    • override its content with the old version of x.vcxproj
    • checkin

Use cleartool get for that:

cleartool get –to x.vcxproj /path@@/main/<previousVersion>/x.vcxproj@@/main/x