git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Johan Compagner
Currently i just have 3 workspaces for wicket (1.4,1,5 and trunk/master)

But git works with a/one working directory...

thats always one of those..

So is the only solution to have the remote git repo dumped three times on
my disk?
I don't find that very logical..

And no i don't want to constantly switch, i could do that with wicket if
really needed, but i find that annoying because i also look for our self
(and eclipse projects also now move)
and there i have really all kind of changes in 1 when i want to go to the
other...

And clicking between eclipse instances is way faster (i always have 3 or
more eclipse instances open on various workspaces)

johan


Re: git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Martin Grigorov
Hi Johan,

You can have one working directory (aka local repository) with these
three branches and switch between them with git checkout or the same
command in EGit.
You can also have 3 working directories - one for each branch. This
way you can load them at once in one Eclipse instance of each one in
its own Eclipse instance.

I personally use the first approach for now.

On Wed, Jan 4, 2012 at 5:25 PM, Johan Compagner jcompag...@gmail.com wrote:
 Currently i just have 3 workspaces for wicket (1.4,1,5 and trunk/master)

 But git works with a/one working directory...

 thats always one of those..

 So is the only solution to have the remote git repo dumped three times on
 my disk?
 I don't find that very logical..

 And no i don't want to constantly switch, i could do that with wicket if
 really needed, but i find that annoying because i also look for our self
 (and eclipse projects also now move)
 and there i have really all kind of changes in 1 when i want to go to the
 other...

 And clicking between eclipse instances is way faster (i always have 3 or
 more eclipse instances open on various workspaces)

 johan



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com


Re: git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Martijn Dashorst
On Wed, Jan 4, 2012 at 4:25 PM, Johan Compagner jcompag...@gmail.com wrote:
 Currently i just have 3 workspaces for wicket (1.4,1,5 and trunk/master)

 But git works with a/one working directory...

 thats always one of those..

 So is the only solution to have the remote git repo dumped three times on
 my disk?
 I don't find that very logical..

It is logical: it is no different than having 3 checkouts of SVN
living on your hard disk.

A git checkout with full history is probably the size of O(1) of a SVN
checkout (especially for SVN  1.7). You can still use your normal
flow just as you'd do with SVN.

If you don't like having to wait for the full checkout coming from the
apache server, you can easily just clone locally, and set the remote
afterwards.

You don't have to use the one folder for all branches paradigm, but
you can. Or I can, or Igor can, or Emond can. With git we have a
choice ourselves. WIth SVN not so.

Martijn


Re: git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Carl-Eric Menzel
What you need is a separate working directory managed
by the same local repo. There's a script git new-workdir in contrib/
that does that for you. 
See http://nuclearsquid.com/writings/git-new-workdir/ for details.

Carl-Eric
www.wicketbuch.de

On Wed, 4 Jan 2012 16:25:32 +0100
Johan Compagner jcompag...@gmail.com wrote:

 Currently i just have 3 workspaces for wicket (1.4,1,5 and
 trunk/master)
 
 But git works with a/one working directory...
 
 thats always one of those..
 
 So is the only solution to have the remote git repo dumped three
 times on my disk?
 I don't find that very logical..
 
 And no i don't want to constantly switch, i could do that with wicket
 if really needed, but i find that annoying because i also look for
 our self (and eclipse projects also now move)
 and there i have really all kind of changes in 1 when i want to go to
 the other...
 
 And clicking between eclipse instances is way faster (i always have 3
 or more eclipse instances open on various workspaces)
 
 johan


Re: git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Emond Papegaaij
With git, switching between branches is very fast, but as you said, with 
Eclipse it's not. You can have a look at this:
http://finik.net/2010/10/24/multiple-working-folders-with-single-git-
repository/

Another solution is to use git remotes to link the clones using (local) 
remotes. You can add a remote using 'git remote add name path', after 
which you can push/fetch changes between your workspaces directly.

Personally, I use this last approach, but that's mainly because I do not yet 
feel comfortable enough to play with git internals :)

Emond

On Wednesday 04 January 2012 16:25:32 Johan Compagner wrote:
 Currently i just have 3 workspaces for wicket (1.4,1,5 and trunk/master)
 
 But git works with a/one working directory...
 
 thats always one of those..
 
 So is the only solution to have the remote git repo dumped three times on
 my disk?
 I don't find that very logical..
 
 And no i don't want to constantly switch, i could do that with wicket if
 really needed, but i find that annoying because i also look for our self
 (and eclipse projects also now move)
 and there i have really all kind of changes in 1 when i want to go to the
 other...
 
 And clicking between eclipse instances is way faster (i always have 3 or
 more eclipse instances open on various workspaces)
 
 johan


Re: git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Johan Compagner
Yes i don't care to much about the disk space
But if i make a commit in to 1.4 that also want to merge over 1.5 and trunk

What is then the nicest way?
Because must i then do a commit the local on 1.4 push that to the remote
then go to 1.5 and pull it, then merge the 1.4 changes to 1.5, commit that
(this could be slightly different because of some changes)
push that again to remote,
and then do that for trunk/master/1.6 all over again?

Of course this can all be different i am just starting to look at git, so i
maybe don't see all the different handles..
But the above approach is quite a bit harder and way more steps (at least
it looks that way to me now) then what i would do with svn.. (using the
merge client shipped with subclipse)


On Wed, Jan 4, 2012 at 16:40, Martijn Dashorst
martijn.dasho...@gmail.comwrote:

 On Wed, Jan 4, 2012 at 4:25 PM, Johan Compagner jcompag...@gmail.com
 wrote:
  Currently i just have 3 workspaces for wicket (1.4,1,5 and trunk/master)
 
  But git works with a/one working directory...
 
  thats always one of those..
 
  So is the only solution to have the remote git repo dumped three times on
  my disk?
  I don't find that very logical..

 It is logical: it is no different than having 3 checkouts of SVN
 living on your hard disk.

 A git checkout with full history is probably the size of O(1) of a SVN
 checkout (especially for SVN  1.7). You can still use your normal
 flow just as you'd do with SVN.

 If you don't like having to wait for the full checkout coming from the
 apache server, you can easily just clone locally, and set the remote
 afterwards.

 You don't have to use the one folder for all branches paradigm, but
 you can. Or I can, or Igor can, or Emond can. With git we have a
 choice ourselves. WIth SVN not so.

 Martijn



Re: git and multiple workspaces with the 2 branches and 1 trunk (master?)

2012-01-04 Thread Johan Compagner
Git switching could be very vast
But between 1.4 and 1.5 there are really project changes (like wicket-core
and just wicket)

So if i switch between them in eclipse, i constantly get all kind of
compile warnings...
And if i reflect that again on our own servoy product (if we would also go
to git)
this is really not doable, i have also there 3 to 4 active branches
and there from branch to branch the number of projects are completely
different! because in eclipse plugins
you just create quite a lot of projects, so every new branch has a few more
projects
Then switching it is just quite annoying if you ask me, because you
constantly have to get eclipse into sync.

I will look at the multiply working folders option, that really looks be me
the best way.



On Wed, Jan 4, 2012 at 16:43, Emond Papegaaij emond.papega...@topicus.nlwrote:

 With git, switching between branches is very fast, but as you said, with
 Eclipse it's not. You can have a look at this:
 http://finik.net/2010/10/24/multiple-working-folders-with-single-git-
 repository/http://finik.net/2010/10/24/multiple-working-folders-with-single-git-%0Arepository/

 Another solution is to use git remotes to link the clones using (local)
 remotes. You can add a remote using 'git remote add name path', after
 which you can push/fetch changes between your workspaces directly.

 Personally, I use this last approach, but that's mainly because I do not
 yet
 feel comfortable enough to play with git internals :)

 Emond

 On Wednesday 04 January 2012 16:25:32 Johan Compagner wrote:
  Currently i just have 3 workspaces for wicket (1.4,1,5 and trunk/master)
 
  But git works with a/one working directory...
 
  thats always one of those..
 
  So is the only solution to have the remote git repo dumped three times on
  my disk?
  I don't find that very logical..
 
  And no i don't want to constantly switch, i could do that with wicket if
  really needed, but i find that annoying because i also look for our self
  (and eclipse projects also now move)
  and there i have really all kind of changes in 1 when i want to go to the
  other...
 
  And clicking between eclipse instances is way faster (i always have 3 or
  more eclipse instances open on various workspaces)
 
  johan



Re: [1/2] git commit: WICKET-4212: Add ISessionStore BindListener

2012-01-04 Thread Martin Grigorov
Few comments below

On Wed, Jan 4, 2012 at 8:56 PM,  papega...@apache.org wrote:
 Updated Branches:
  refs/heads/master 184e41e1f - f3edce1a7


 WICKET-4212: Add ISessionStore BindListener


 Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
 Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/f3edce1a
 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/f3edce1a
 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/f3edce1a

 Branch: refs/heads/master
 Commit: f3edce1a75ac4bcc3978e3056354a1a30c0ffd1b
 Parents: 35c66b2
 Author: Emond Papegaaij papega...@apache.org
 Authored: Wed Nov 9 15:31:56 2011 +0100
 Committer: Emond Papegaaij papega...@apache.org
 Committed: Wed Jan 4 18:01:17 2012 +0100

 --
  .../org/apache/wicket/mock/MockSessionStore.java   |   23 +++--
  .../apache/wicket/session/HttpSessionStore.java    |   34 ++
  .../org/apache/wicket/session/ISessionStore.java   |   36 +++
  3 files changed, 88 insertions(+), 5 deletions(-)
 --


 http://git-wip-us.apache.org/repos/asf/wicket/blob/f3edce1a/wicket-core/src/main/java/org/apache/wicket/mock/MockSessionStore.java
 --
 diff --git 
 a/wicket-core/src/main/java/org/apache/wicket/mock/MockSessionStore.java 
 b/wicket-core/src/main/java/org/apache/wicket/mock/MockSessionStore.java
 index 8b78ae0..523c5a4 100644
 --- a/wicket-core/src/main/java/org/apache/wicket/mock/MockSessionStore.java
 +++ b/wicket-core/src/main/java/org/apache/wicket/mock/MockSessionStore.java
 @@ -46,6 +46,9 @@ public class MockSessionStore implements ISessionStore

        private String sessionId;
        private final MapString, Serializable attributes = new 
 HashMapString, Serializable();
 +       private final SetUnboundListener unboundListeners = new 
 CopyOnWriteArraySetUnboundListener();
 +       private final SetBindListener bindListeners = new 
 CopyOnWriteArraySetBindListener();
 +
        private Session session;

        @Override
 @@ -107,8 +110,6 @@ public class MockSessionStore implements ISessionStore
                return session;
        }

 -       private final SetUnboundListener unboundListeners = new 
 CopyOnWriteArraySetUnboundListener();
 -
        @Override
        public void registerUnboundListener(UnboundListener listener)
        {
 @@ -121,9 +122,6 @@ public class MockSessionStore implements ISessionStore
                attributes.remove(name);
        }

 -       /**
 -        * @see org.apache.wicket.session.ISessionStore#getUnboundListener()
 -        */
        @Override
        public final SetUnboundListener getUnboundListener()
        {
 @@ -142,6 +140,21 @@ public class MockSessionStore implements ISessionStore
                unboundListeners.remove(listener);
        }

 +       public void registerBindListener(BindListener listener)
 +       {
 +               bindListeners.add(listener);
 +       }
 +
 +       public void unregisterBindListener(BindListener listener)
 +       {
 +               bindListeners.remove(listener);
 +       }
 +
 +       public SetBindListener getBindListeners()
 +       {
 +               return Collections.unmodifiableSet(bindListeners);
 +       }
 +
        @Override
        public void flushSession(Request request, Session session)
        {

 http://git-wip-us.apache.org/repos/asf/wicket/blob/f3edce1a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 --
 diff --git 
 a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java 
 b/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 index a8403f9..3b8a4b3 100644
 --- 
 a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 +++ 
 b/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 @@ -55,6 +55,8 @@ public class HttpSessionStore implements ISessionStore
        /** */
        private final SetUnboundListener unboundListeners = new 
 CopyOnWriteArraySetUnboundListener();

 +       private final SetBindListener bindListeners = new 
 CopyOnWriteArraySetBindListener();

Is it a good idea to make use of
org.apache.wicket.util.listener.ListenerCollection ?
See org.apache.wicket.ApplicationListenerCollection for example.
ListenerCollection uses CopyOnWriteArrayList but I don't think this is
a problem here.

The old is 'Unbound', the new is 'Bind'.
I think the new should be 'Bound' because the listener is invoked
after the binding.
 +
        /**
         * Construct.
         */
 @@ -103,6 +105,10 @@ public class HttpSessionStore implements ISessionStore
                {
                        // call template method
                        onBind(request, newSession);
 +                       for (BindListener listener : 

Re: [1/2] git commit: WICKET-4212: Add ISessionStore BindListener

2012-01-04 Thread Martin Grigorov
On Wed, Jan 4, 2012 at 8:55 PM,  papega...@apache.org wrote:
 Updated Branches:
  refs/heads/wicket-1.5.x ec53d1b75 - b01790689


 WICKET-4212: Add ISessionStore BindListener


 Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
 Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b0179068
 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b0179068
 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b0179068

 Branch: refs/heads/wicket-1.5.x
 Commit: b01790689f54327ba755e5250dfe7d15c8059c06
 Parents: eb86ba3
 Author: Emond Papegaaij papega...@apache.org
 Authored: Wed Nov 9 15:31:56 2011 +0100
 Committer: Emond Papegaaij papega...@apache.org
 Committed: Wed Jan 4 17:56:13 2012 +0100

 --
  .../apache/wicket/session/HttpSessionStore.java    |   34 +
  .../org/apache/wicket/session/ISessionStore.java   |   38 +++
  2 files changed, 72 insertions(+), 0 deletions(-)
 --


 http://git-wip-us.apache.org/repos/asf/wicket/blob/b0179068/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 --
 diff --git 
 a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java 
 b/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 index 68e2a1a..07d3e6d 100644
 --- 
 a/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 +++ 
 b/wicket-core/src/main/java/org/apache/wicket/session/HttpSessionStore.java
 @@ -55,6 +55,8 @@ public class HttpSessionStore implements ISessionStore
        /** */
        private final SetUnboundListener unboundListeners = new 
 CopyOnWriteArraySetUnboundListener();

 +       private final SetBindListener bindListeners = new 
 CopyOnWriteArraySetBindListener();
 +
        /**
         * Construct.
         */
 @@ -102,6 +104,10 @@ public class HttpSessionStore implements ISessionStore
                {
                        // call template method
                        onBind(request, newSession);
 +                       for (BindListener listener : getBindListeners())
 +                       {
 +                               listener.bindingSession(request, newSession);
 +                       }

                        HttpSession httpSession = getHttpSession(request, 
 false);

 @@ -354,6 +360,34 @@ public class HttpSessionStore implements ISessionStore
        }

        /**
 +        * Registers listener invoked when session is bound.
 +        *
 +        * @param listener
 +        */
 +       public void registerBindListener(BindListener listener)
 +       {
 +               bindListeners.add(listener);
 +       }
 +
 +       /**
 +        * Unregisters listener invoked when session is bound.
 +        *
 +        * @param listener
 +        */
 +       public void unregisterBindListener(BindListener listener)
 +       {
 +               bindListeners.remove(listener);
 +       }
 +
 +       /**
 +        * @return The list of registered bind listeners
 +        */
 +       public SetBindListener getBindListeners()
 +       {
 +               return Collections.unmodifiableSet(bindListeners);
 +       }
 +
 +       /**
         * Reacts on unbinding from the session by cleaning up the session 
 related data.
         */
        protected static final class SessionBindingListener

 http://git-wip-us.apache.org/repos/asf/wicket/blob/b0179068/wicket-core/src/main/java/org/apache/wicket/session/ISessionStore.java
 --
 diff --git 
 a/wicket-core/src/main/java/org/apache/wicket/session/ISessionStore.java 
 b/wicket-core/src/main/java/org/apache/wicket/session/ISessionStore.java
 index f4894d7..ead 100644
 --- a/wicket-core/src/main/java/org/apache/wicket/session/ISessionStore.java
 +++ b/wicket-core/src/main/java/org/apache/wicket/session/ISessionStore.java
 @@ -180,4 +180,42 @@ public interface ISessionStore
         * @return The list of registered unbound listeners
         */
        SetUnboundListener getUnboundListener();
 +
 +       /**
 +        * Listener invoked when session is bound.
 +        */
 +       public interface BindListener
 +       {
 +               /**
 +                * Informs the listener that a session is about to be bound. 
 Note that this method is also
 +                * called for {@link Session#isTemporary() temporary 
 sessions}.
 +                *
 +                * @param request
 +                *            The request the session is bound in
 +                * @param newSession
 +                *            The session that will be bound
 +                */
 +               void bindingSession(Request request, Session newSession);
 +       }
 +
 +       // TODO Wicket.next add these methods to the interface

What's the purpose of these 

Re: [2/2] git commit: WICKET-4290: Do not render page parameters for statefull links

2012-01-04 Thread Martin Grigorov
Can we add some test cases that stateless link/form doesn't have the
parameters and stateful have them ?

On Wed, Jan 4, 2012 at 8:56 PM,  papega...@apache.org wrote:
 WICKET-4290: Do not render page parameters for statefull links


 Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
 Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/35c66b27
 Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/35c66b27
 Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/35c66b27

 Branch: refs/heads/master
 Commit: 35c66b27e5dd1f9e9fe3f2c1a075f2b717c682a1
 Parents: 184e41e
 Author: Emond Papegaaij papega...@apache.org
 Authored: Tue Jan 3 08:09:05 2012 +0100
 Committer: Emond Papegaaij papega...@apache.org
 Committed: Wed Jan 4 17:55:14 2012 +0100

 --
  .../src/main/java/org/apache/wicket/Component.java |   17 +---
  .../wicket/behavior/AbstractAjaxBehavior.java      |    3 +-
  .../org/apache/wicket/markup/html/form/Check.java  |    3 +-
  .../apache/wicket/markup/html/form/CheckBox.java   |    3 +-
  .../wicket/markup/html/form/DropDownChoice.java    |    4 +-
  .../org/apache/wicket/markup/html/form/Form.java   |   33 +++
  .../org/apache/wicket/markup/html/form/Radio.java  |    3 +-
  .../wicket/markup/html/form/RadioChoice.java       |    3 +-
  .../wicket/markup/html/form/StatelessForm.java     |    6 +++
  .../image/resource/LocalizedImageResource.java     |    2 +-
  .../wicket/markup/html/link/InlineFrame.java       |    2 +-
  .../org/apache/wicket/markup/html/link/Link.java   |    3 +-
  .../wicket/markup/html/link/ResourceLink.java      |    2 +-
  .../wicket/markup/html/link/StatelessLink.java     |    6 +++
  .../wicket/markup/html/pages/RedirectPage.java     |    5 +-
  .../request/handler/PageAndComponentProvider.java  |   14 ++
  .../wicket/request/handler/PageProvider.java       |    2 +-
  .../wicket/util/tester/BaseWicketTester.java       |    8 ++-
  .../org/apache/wicket/BehaviorRequestTest.java     |    4 +-
  .../java/org/apache/wicket/BehaviorUrlTest.java    |    4 +-
  .../wicket/behavior/ImmutableBehaviorIdsTest.java  |    3 +-
  .../captcha/kittens/KittenCaptchaPanel.java        |    4 +-
  22 files changed, 81 insertions(+), 53 deletions(-)
 --


 http://git-wip-us.apache.org/repos/asf/wicket/blob/35c66b27/wicket-core/src/main/java/org/apache/wicket/Component.java
 --
 diff --git a/wicket-core/src/main/java/org/apache/wicket/Component.java 
 b/wicket-core/src/main/java/org/apache/wicket/Component.java
 index 4c25361..8725706 100644
 --- a/wicket-core/src/main/java/org/apache/wicket/Component.java
 +++ b/wicket-core/src/main/java/org/apache/wicket/Component.java
 @@ -3309,7 +3309,7 @@ public abstract class Component
        {
                return getRequestCycle().urlFor(pageClass, parameters);
        }
 -
 +
        /**
         * Gets a URL for the listener interface on a behavior (e.g. 
 IBehaviorListener on
         * AjaxPagingNavigationBehavior).
 @@ -3318,14 +3318,16 @@ public abstract class Component
         *            The behavior that the URL should point to
         * @param listener
         *            The listener interface that the URL should call
 +        * @param parameters
 +        *            The parameters that should be rendered into the urls
         * @return The URL
         */
        public final CharSequence urlFor(final Behavior behaviour,
 -               final RequestListenerInterface listener)
 +               final RequestListenerInterface listener, final PageParameters 
 parameters)
        {
                int id = getBehaviorId(behaviour);
                Page page = getPage();
 -               PageAndComponentProvider provider = new 
 PageAndComponentProvider(page, this);
 +               PageAndComponentProvider provider = new 
 PageAndComponentProvider(page, this, parameters);
                IRequestHandler handler;
                if (page.isPageStateless())
                {
 @@ -3352,7 +3354,7 @@ public abstract class Component
        {
                return getRequestCycle().urlFor(requestHandler);
        }
 -
 +
        /**
         * Gets a URL for the listener interface (e.g. ILinkListener).
         *
 @@ -3360,12 +3362,15 @@ public abstract class Component
         *
         * @param listener
         *            The listener interface that the URL should call
 +        * @param parameters
 +        *            The parameters that should be rendered into the urls
         * @return The URL
         */
 -       public final CharSequence urlFor(final RequestListenerInterface 
 listener)
 +       public final CharSequence urlFor(final RequestListenerInterface 
 listener,
 +               final PageParameters parameters)
        {
                Page page = getPage();
 -