[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Anyone want to add a cool new feature to Subclipse?

From: Mark Phippard <MarkP_at_softlanding.com>
Date: 2005-09-26 22:09:15 CEST

JavaSVN added a new ability to perform a commit of files contained in
multiple disconnected working copies as a single atomic operation. I have
added support for this feature to svnClientAdapter and committed it.
However, I do not have the time in the next week or so to work on this for
Subclipse. If this is something you want to tackle I have committed
everything you need, you should just have to work on the Subclipse part.

There is a new boolean method canCommitAcrossWC() that tells you if the
selected adapter support this feature. You would want to condition your
code on that boolean. I am not 100% sure how best to implement this, such
as whether it ought to be as automatic as possible or there should be some
UI choice.

Currently, since the existing adapters did not support this feature,
Subclipse has code to manually split the commit in multiple commits. That
will be the first place where code will need to be changed. Then, in the
CheckInResourcesCommand method, you would have to add support for using
the new svnClientAdapter method.

        /**
         * Commits changes to the repository. This usually requires
         * authentication, see Auth.
         *
         * This differs from the normal commit method in that it can
accept paths from
         * more than one working copy.
         *
         * @return Returns an array of longs representing the revisions.
It returns a
         * -1 if the revision number is invalid.
         * @param path files to commit.
         * @param message log message.
         * @param recurse whether the operation should be done
recursively.
         * @param keepLocks whether to keep locks on files that are
committed.
         * @param atomic whether to attempt to perform the commit from
multiple
         * working copies atomically. Files from the same repository will
be
         * processed with one commit operation. If files span multiple
repositories
         * they will be processed in multiple commits.
         * When atomic is false, you will get one commit per WC.
         * @exception SVNClientException
         */
        public abstract long[] commitAcrossWC(File[] paths, String
message, boolean recurse, boolean keepLocks, boolean Atomic)
                throws SVNClientException;

Finally, if someone wants to add generic support for JavaHL and the CLI
that would also be cool. Currently, it is technically impossible to
implement the exact same capabilities in these adapters. However, some
people, myself included, use a master working copy where all of our
projects are part of the same WC. We then import these projects into
Eclipse. In this scenario, if we could properly detect it, then those
adapters could do an atomic commit. So we could try to do the right
checking to enable this feature for those adapters.

If you want to try to tackle this, please post a message in case my time
frees up and I start to work on it. I will do the same.

Mark

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________
Received on Tue Sep 27 06:09:15 2005

This is an archived mail posted to the Subclipse Dev mailing list.