2 Replies Latest reply on Apr 5, 2013 11:23 AM by Satya M

    Issue with merge

    Satya M Newbie

      I was trying to merge 2 workspaces but for some reason merge is not merging the workspaces correctly. Following is the sample test code.

       

      CND Details

      [Parent] > mix:versionable
        - name (string) copy
        + * (Child) version
      
      
      [Child] > mix:versionable
        - name (string) copy
      

       

       

      Session session = repository.login("default");
              
      session.getWorkspace().createWorkspace("original");
      session = repository.login("original");
        
      Node root = session.getRootNode();  
      Node parent1 = root.addNode("parent1", "Parent");
      session.save();
        
      Node child1 = parent1.addNode("child1", "Child");
      session.save();
        
      session.getWorkspace().createWorkspace("clone", "original");
      session = repository.login("clone");
        
      Node child2 = session.getNode("/parent1").addNode("child2", "Child");
      session.save();
      
      session = repository.login("original");  
      vm = session.getWorkspace().getVersionManager(); 
      
      NodeIterator ni = vm.merge("/", "clone", true);
      session.save();
      
      session.getNode("/parent1/child2") // this call is throwing path not found exception.
      

       

      In the above code when I merge the clone workspace with original workspace it should add the child2 node under parent1 node in the original workspace. But it is not happening. Is this an issue with merge ???