You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2002/08/23 14:34:19 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/content Content.java ContentImpl.java

juergen     2002/08/23 05:34:19

  Modified:    src/share/org/apache/slide/content Content.java
                        ContentImpl.java
  Log:
  Fixed bug in create() method related to branching.
  Method fork() now returns the NodeRevisionNumber of the created version.
  (ralf)
  
  Revision  Changes    Path
  1.11      +15 -9     jakarta-slide/src/share/org/apache/slide/content/Content.java
  
  Index: Content.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/Content.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Content.java	25 Apr 2002 21:12:25 -0000	1.10
  +++ Content.java	23 Aug 2002 12:34:19 -0000	1.11
  @@ -219,9 +219,12 @@
        * @param strUri Uri
        * @param branchName Name of the new branch
        * @param basedOnRevisionDescriptor Node revision descriptor of 
  -     * the revision on which the new branch is based on
  +     *                                  the revision on which the new branch
  +     *                                  is based on.
  +     *
  +     * @return the NodeRevisionNumber of the created revision.
        */
  -    void fork(SlideToken token, String strUri, String branchName, 
  +    NodeRevisionNumber fork(SlideToken token, String strUri, String branchName,
                 NodeRevisionDescriptor basedOnRevisionDescriptor)
           throws ObjectNotFoundException, AccessDeniedException, 
           LinkedObjectNotFoundException, ServiceAccessException, 
  @@ -234,10 +237,13 @@
        * 
        * @param strUri Uri
        * @param branchName Name of the new branch
  -     * @param basedOnRevisionNumber Node revision number of 
  -     * the revision on which the new branch is based on
  +     * @param basedOnRevisionDescriptor Node revision descriptor of
  +     *                                  the revision on which the new branch
  +     *                                  is based on.
  +     *
  +     * @return the NodeRevisionNumber of the created revision.
        */
  -    void fork(SlideToken token, String strUri, String branchName, 
  +    NodeRevisionNumber fork(SlideToken token, String strUri, String branchName,
                 NodeRevisionNumber basedOnRevisionNumber)
           throws ObjectNotFoundException, AccessDeniedException, 
           LinkedObjectNotFoundException, ServiceAccessException, 
  
  
  
  1.44      +23 -14    jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java
  
  Index: ContentImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/content/ContentImpl.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- ContentImpl.java	1 Aug 2002 11:56:55 -0000	1.43
  +++ ContentImpl.java	23 Aug 2002 12:34:19 -0000	1.44
  @@ -695,17 +695,20 @@
        *
        * @param strUri Uri
        * @param branchName Name of the new branch
  -     * @param basedOnRevisionDescriptor Node revision descriptor of the
  -     * revision on which the new branch is based on
  +     * @param basedOnRevisionDescriptor Node revision descriptor of
  +     *                                  the revision on which the new branch
  +     *                                  is based on.
  +     *
  +     * @return the NodeRevisionNumber of the created revision.
        */
  -    public void fork(SlideToken token, String strUri, String branchName,
  +    public NodeRevisionNumber fork(SlideToken token, String strUri, String branchName,
                        NodeRevisionDescriptor basedOnRevisionDescriptor)
           throws ObjectNotFoundException, AccessDeniedException,
           LinkedObjectNotFoundException, ServiceAccessException,
           RevisionDescriptorNotFoundException, ObjectLockedException,
           NodeNotVersionedException, RevisionAlreadyExistException {
           
  -        fork(token, strUri, branchName,
  +        return fork(token, strUri, branchName,
                basedOnRevisionDescriptor.getRevisionNumber());
           
       }
  @@ -716,10 +719,13 @@
        *
        * @param strUri Uri
        * @param branchName Name of the new branch
  -     * @param basedOnRevisionNumber Node revision number of
  -     * the revision on which the new branch is based on
  +     * @param basedOnRevisionDescriptor Node revision descriptor of
  +     *                                  the revision on which the new branch
  +     *                                  is based on.
  +     *
  +     * @return the NodeRevisionNumber of the created revision.
        */
  -    public void fork(SlideToken token, String strUri, String branchName,
  +    public NodeRevisionNumber fork(SlideToken token, String strUri, String branchName,
                        NodeRevisionNumber basedOnRevisionNumber)
           throws ObjectNotFoundException, AccessDeniedException,
           LinkedObjectNotFoundException, ServiceAccessException,
  @@ -727,7 +733,7 @@
           NodeNotVersionedException, RevisionAlreadyExistException {
           
           if (branchName.equals(NodeRevisionDescriptors.MAIN_BRANCH))
  -            return;
  +            return null;
           
           // Retrieve the associated object
           ObjectNode associatedObject = 
  @@ -805,6 +811,7 @@
                              basedOnRevisionDescriptor,
                              basedOnRevisionContent, POST_STORE);
           
  +        return branchedRevisionNumber;
       }
       
       
  @@ -1196,8 +1203,10 @@
           
           // Update the revision graph in the revision descriptors
           revisionDescriptors
  -            .addSuccessor(revisionDescriptors.getLatestRevision(),
  +            .addSuccessor(revisionDescriptors.getLatestRevision(newRevisionDescriptor.getBranchName()),
                             newRevisionDescriptor.getRevisionNumber());
  +        revisionDescriptors
  +            .setSuccessors(newRevisionDescriptor.getRevisionNumber(), new Vector());
           revisionDescriptors
               .setLatestRevision(newRevisionDescriptor.getBranchName(),
                                  newRevisionDescriptor.getRevisionNumber());
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>