You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Robin Batra <ro...@gmail.com> on 2009/10/20 13:45:29 UTC

Branching

Has anybody implemented Branching and Merging using Jackrabbit?

any help will be appreciated, thanks in advance.

-- 
Regards

Robin Batra

Re: Branching

Posted by Alexander Klimetschek <ak...@day.com>.
On Fri, Oct 30, 2009 at 05:41, Robin Batra <ro...@gmail.com> wrote:
> Are  there any pointers for implementing Merge operation in Jackrabbit as
> provided by CVS. Because what i have noticed is that the CVS merges the
> changes in the user's local workspace and after that the user has to
> manually commit the changes where as Node.merge() commits the changes
> directly in the Repository thus creating the next version.
> Am i right about this?

Yes, the "workspace" concept in JCR is something different than the
"local workspace" concept in version control systems. It is similar to
how some relational databases (eg. Oracle) provide versioning (and
branching), effectively calling a "branch" a "workspace".

Typically I would always see the repository as the server for a
revision control system. But since versioning is per-node (or
per-tree), you could have both the central repository and the "local"
user checkouts all within the repository. A commit would then be a
copy to the central plus then some versioning operations there.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Re: Branching

Posted by Robin Batra <ro...@gmail.com>.
Hi Guys

Are  there any pointers for implementing Merge operation in Jackrabbit as
provided by CVS. Because what i have noticed is that the CVS merges the
changes in the user's local workspace and after that the user has to
manually commit the changes where as Node.merge() commits the changes
directly in the Repository thus creating the next version.
Am i right about this? any help would be appreciated.
Thanks in advance.

On Wed, Oct 28, 2009 at 2:34 AM, Tobias Bocanegra <tr...@day.com> wrote:

> hi,
>
> On Tue, Oct 27, 2009 at 11:18 AM, Robin Batra <ro...@gmail.com>
> wrote:
> > Thanks a lot guys, finally i got the branching code working. now i am
> able
> > to saparate the working of files in different branches. Thanks a lot once
> > again.
> congratulations.
>
> > One more thing if i want to merge the nodes in different branch, do i
> > have to create my own compare view or does jcr provide anything for
> that??
> unfortunately not. you have to do it yourself.
>
> regards, toby
>
> >
> > On Tue, Oct 27, 2009 at 2:14 PM, Jukka Zitting <jukka.zitting@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> On Tue, Oct 27, 2009 at 6:36 AM, Robin Batra <ro...@gmail.com>
> >> wrote:
> >> > [...]
> >> > N.checkout();
> >> > N.checkin();
> >> > N-> V1.3
> >> > now i clone P1 to W2 (workspace 2)
> >> >
> >> > N' (node under cloned P1' )
> >> > N'.checkout()
> >> > N'.checkin()
> >> >
> >> > it still gave me 1.4 and not 1.3.1
> >>
> >> That's expected, since the base version (1.3) against which you are
> >> making the checkin does not yet have any other successors. You'll only
> >> end up with a branch when you checkin against a base version that
> >> already has one or more successors.
> >>
> >> For example, if you now did a N.checkin() without first updating it to
> >> the latest 1.4 version, you'd end up with 1.3.1.
> >>
> >> BR,
> >>
> >> Jukka Zitting
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Robin Batra
> >
>



-- 
Regards

Robin Batra

Re: Branching

Posted by Tobias Bocanegra <tr...@day.com>.
hi,

On Tue, Oct 27, 2009 at 11:18 AM, Robin Batra <ro...@gmail.com> wrote:
> Thanks a lot guys, finally i got the branching code working. now i am able
> to saparate the working of files in different branches. Thanks a lot once
> again.
congratulations.

> One more thing if i want to merge the nodes in different branch, do i
> have to create my own compare view or does jcr provide anything for that??
unfortunately not. you have to do it yourself.

regards, toby

>
> On Tue, Oct 27, 2009 at 2:14 PM, Jukka Zitting <ju...@gmail.com>wrote:
>
>> Hi,
>>
>> On Tue, Oct 27, 2009 at 6:36 AM, Robin Batra <ro...@gmail.com>
>> wrote:
>> > [...]
>> > N.checkout();
>> > N.checkin();
>> > N-> V1.3
>> > now i clone P1 to W2 (workspace 2)
>> >
>> > N' (node under cloned P1' )
>> > N'.checkout()
>> > N'.checkin()
>> >
>> > it still gave me 1.4 and not 1.3.1
>>
>> That's expected, since the base version (1.3) against which you are
>> making the checkin does not yet have any other successors. You'll only
>> end up with a branch when you checkin against a base version that
>> already has one or more successors.
>>
>> For example, if you now did a N.checkin() without first updating it to
>> the latest 1.4 version, you'd end up with 1.3.1.
>>
>> BR,
>>
>> Jukka Zitting
>>
>
>
>
> --
> Regards
>
> Robin Batra
>

Re: Branching

Posted by Robin Batra <ro...@gmail.com>.
Thanks a lot guys, finally i got the branching code working. now i am able
to saparate the working of files in different branches. Thanks a lot once
again. One more thing if i want to merge the nodes in different branch, do i
have to create my own compare view or does jcr provide anything for that??

On Tue, Oct 27, 2009 at 2:14 PM, Jukka Zitting <ju...@gmail.com>wrote:

> Hi,
>
> On Tue, Oct 27, 2009 at 6:36 AM, Robin Batra <ro...@gmail.com>
> wrote:
> > [...]
> > N.checkout();
> > N.checkin();
> > N-> V1.3
> > now i clone P1 to W2 (workspace 2)
> >
> > N' (node under cloned P1' )
> > N'.checkout()
> > N'.checkin()
> >
> > it still gave me 1.4 and not 1.3.1
>
> That's expected, since the base version (1.3) against which you are
> making the checkin does not yet have any other successors. You'll only
> end up with a branch when you checkin against a base version that
> already has one or more successors.
>
> For example, if you now did a N.checkin() without first updating it to
> the latest 1.4 version, you'd end up with 1.3.1.
>
> BR,
>
> Jukka Zitting
>



-- 
Regards

Robin Batra

Re: Branching

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Oct 27, 2009 at 6:36 AM, Robin Batra <ro...@gmail.com> wrote:
> [...]
> N.checkout();
> N.checkin();
> N-> V1.3
> now i clone P1 to W2 (workspace 2)
>
> N' (node under cloned P1' )
> N'.checkout()
> N'.checkin()
>
> it still gave me 1.4 and not 1.3.1

That's expected, since the base version (1.3) against which you are
making the checkin does not yet have any other successors. You'll only
end up with a branch when you checkin against a base version that
already has one or more successors.

For example, if you now did a N.checkin() without first updating it to
the latest 1.4 version, you'd end up with 1.3.1.

BR,

Jukka Zitting

Re: Branching

Posted by Robin Batra <ro...@gmail.com>.
Hi,

posting the code would not be possible but i can explain it through the
psuedo code.

What i did was

create a new node in W1 (workspace 1).
create a node P1
create a node N under P1
made some changed in it and committed it back
N.checkout();
N.checkin();
N-> V1.1
N.checkout();
N.checkin();
N-> V1.2
 N.checkout();
N.checkin();
N-> V1.3
now i clone P1 to W2 (workspace 2)

N' (node under cloned P1' )
N'.checkout()
N'.checkin()

it still gave me 1.4 and not 1.3.1
On Sat, Oct 24, 2009 at 1:36 AM, Tobias Bocanegra <tr...@day.com> wrote:

> hi,
> the history stays linear until you commit a node which baseversion has
> a successor.
> so after the 2nd checkin in my example, N' has still base version
> V1.0. and V1.0 has a successor V1.1.
> so the next checkin of N' should produce a V1.0.1.
>
> can you post sample code that reproduces you problem?
>
> regards, toby
>
> On Fri, Oct 23, 2009 at 11:49 AM, Robin Batra <ro...@gmail.com>
> wrote:
> > Hi Toby,
> >
> > Thanks a lot for your reply. I tired what you suggested but when i
> checked
> > in the cloned node it still was committed to the same version history.
> >
> > I cloned a node into a separate workspace and then made changes into the
> > cloned node and committed it back again. initially its version was 1.3
> and
> > when i committed changes to it the version was changed to 1.4
> >
> > I am using jcr 1.0 and jackrabbit 1.5. Is it due to the jackrabbit or jcr
> > version.
> >
> > Thanks a lot once again for replying...
> >
> > On Fri, Oct 23, 2009 at 1:36 AM, Tobias Bocanegra <tr...@day.com>
> wrote:
> >
> >> hi,
> >> what exactly do you need to know ?
> >>
> >> the repository supports non-linear version histories. to create a
> >> branch you do the following:
> >>
> >> Assume you have a full versionable node N in workspace W and it's
> >> versions Vn. And a 2nd workspace W' with the corresponding node N'
> >>
> >> N.checkin() -> V1.0
> >> W'.clone(W, N) -> N' (with V1.0)
> >>
> >> N.checkout()
> >> N.checkin() -> V1.1
> >>
> >> N'.checkout()
> >> N'.checkin() -> V1.0.1 (now you created a branch)
> >> N'.checkout()
> >> N'.checkin() -> V1.0.2
> >>
> >> N.merge(W') -> V1.2 (now you merged the branches again)
> >>
> >> i hope this helps.
> >> regards, toby
> >>
> >>
> >> On Tue, Oct 20, 2009 at 1:45 PM, Robin Batra <ro...@gmail.com>
> >> wrote:
> >> > Has anybody implemented Branching and Merging using Jackrabbit?
> >> >
> >> > any help will be appreciated, thanks in advance.
> >> >
> >> > --
> >> > Regards
> >> >
> >> > Robin Batra
> >> >
> >>
> >
> >
> >
> > --
> > Regards
> >
> > Robin Batra
> >
>



-- 
Regards

Robin Batra

Re: Branching

Posted by Tobias Bocanegra <tr...@day.com>.
hi,
the history stays linear until you commit a node which baseversion has
a successor.
so after the 2nd checkin in my example, N' has still base version
V1.0. and V1.0 has a successor V1.1.
so the next checkin of N' should produce a V1.0.1.

can you post sample code that reproduces you problem?

regards, toby

On Fri, Oct 23, 2009 at 11:49 AM, Robin Batra <ro...@gmail.com> wrote:
> Hi Toby,
>
> Thanks a lot for your reply. I tired what you suggested but when i checked
> in the cloned node it still was committed to the same version history.
>
> I cloned a node into a separate workspace and then made changes into the
> cloned node and committed it back again. initially its version was 1.3 and
> when i committed changes to it the version was changed to 1.4
>
> I am using jcr 1.0 and jackrabbit 1.5. Is it due to the jackrabbit or jcr
> version.
>
> Thanks a lot once again for replying...
>
> On Fri, Oct 23, 2009 at 1:36 AM, Tobias Bocanegra <tr...@day.com> wrote:
>
>> hi,
>> what exactly do you need to know ?
>>
>> the repository supports non-linear version histories. to create a
>> branch you do the following:
>>
>> Assume you have a full versionable node N in workspace W and it's
>> versions Vn. And a 2nd workspace W' with the corresponding node N'
>>
>> N.checkin() -> V1.0
>> W'.clone(W, N) -> N' (with V1.0)
>>
>> N.checkout()
>> N.checkin() -> V1.1
>>
>> N'.checkout()
>> N'.checkin() -> V1.0.1 (now you created a branch)
>> N'.checkout()
>> N'.checkin() -> V1.0.2
>>
>> N.merge(W') -> V1.2 (now you merged the branches again)
>>
>> i hope this helps.
>> regards, toby
>>
>>
>> On Tue, Oct 20, 2009 at 1:45 PM, Robin Batra <ro...@gmail.com>
>> wrote:
>> > Has anybody implemented Branching and Merging using Jackrabbit?
>> >
>> > any help will be appreciated, thanks in advance.
>> >
>> > --
>> > Regards
>> >
>> > Robin Batra
>> >
>>
>
>
>
> --
> Regards
>
> Robin Batra
>

Re: Branching

Posted by Robin Batra <ro...@gmail.com>.
Hi Toby,

Thanks a lot for your reply. I tired what you suggested but when i checked
in the cloned node it still was committed to the same version history.

I cloned a node into a separate workspace and then made changes into the
cloned node and committed it back again. initially its version was 1.3 and
when i committed changes to it the version was changed to 1.4

I am using jcr 1.0 and jackrabbit 1.5. Is it due to the jackrabbit or jcr
version.

Thanks a lot once again for replying...

On Fri, Oct 23, 2009 at 1:36 AM, Tobias Bocanegra <tr...@day.com> wrote:

> hi,
> what exactly do you need to know ?
>
> the repository supports non-linear version histories. to create a
> branch you do the following:
>
> Assume you have a full versionable node N in workspace W and it's
> versions Vn. And a 2nd workspace W' with the corresponding node N'
>
> N.checkin() -> V1.0
> W'.clone(W, N) -> N' (with V1.0)
>
> N.checkout()
> N.checkin() -> V1.1
>
> N'.checkout()
> N'.checkin() -> V1.0.1 (now you created a branch)
> N'.checkout()
> N'.checkin() -> V1.0.2
>
> N.merge(W') -> V1.2 (now you merged the branches again)
>
> i hope this helps.
> regards, toby
>
>
> On Tue, Oct 20, 2009 at 1:45 PM, Robin Batra <ro...@gmail.com>
> wrote:
> > Has anybody implemented Branching and Merging using Jackrabbit?
> >
> > any help will be appreciated, thanks in advance.
> >
> > --
> > Regards
> >
> > Robin Batra
> >
>



-- 
Regards

Robin Batra

Re: Branching

Posted by Tobias Bocanegra <tr...@day.com>.
hi,
what exactly do you need to know ?

the repository supports non-linear version histories. to create a
branch you do the following:

Assume you have a full versionable node N in workspace W and it's
versions Vn. And a 2nd workspace W' with the corresponding node N'

N.checkin() -> V1.0
W'.clone(W, N) -> N' (with V1.0)

N.checkout()
N.checkin() -> V1.1

N'.checkout()
N'.checkin() -> V1.0.1 (now you created a branch)
N'.checkout()
N'.checkin() -> V1.0.2

N.merge(W') -> V1.2 (now you merged the branches again)

i hope this helps.
regards, toby


On Tue, Oct 20, 2009 at 1:45 PM, Robin Batra <ro...@gmail.com> wrote:
> Has anybody implemented Branching and Merging using Jackrabbit?
>
> any help will be appreciated, thanks in advance.
>
> --
> Regards
>
> Robin Batra
>