Adding your own VCS support to NetBeans 6.0 thanks to Maros' Skeleton

Note: 26th June, few changes, added externally visible link to VCS API doc and removed step due to platform API changes. 

Hi - a few folks expressed interest in doing what we've just done for Mercurial using Maros Sandor's VCS skeleton for NetBeans 6.0 with their own Version Control Systems. Andy's comment finally prompted me to put down a few rough guidelines. Make sure to touch base with the NetBeans Version Control folks as they can offer plenty of guidance and make sure your module is created in the correct location and so on.

Maros has written a VCS API Overview (Externally accessible) of the key integration points that is a really useful starting point. There are already skeletons available for Mercurial, Perforce and Clearcase. Mercurial and Perforce are under active development.

Setup

You will need to get developer access on the NetBeans versioncontrol project
$ cvs -d :pserver:anoncvs@cvs.netbeans.org:/shared/data/ccvs/repository co 
stable_nowww
  • Create you stub module under versioncontrol/<your vcs stub>
    • As a basis grab the mercurial skeleton code that Maros very kindly provided for us.
$ cvs -d :pserver:anoncvs@cvs.netbeans.org:/shared/data/ccvs/repository 
export -D "8 Feb 2007" -r mercurial versioncontrol/mercurial
Change the skeleton code to whatever name you want and check it in as your own skeleton 
vcs stub. There are already existing stubs for Mercurial, ClearCase and Perforce, that
can be checked out directly
The skeletons have a very useful list of TODO's in the code that act as good set of starting 
points, see below.
  • [Jun 26th - No Longer Required due to Platform API changes] 
    As your module will not yet be in standard build, you need to patch the
    versioncontrol/nbproject/project.xml file to include <Your VCS Module> in its
    list of friends:
                <friend>org.netbeans.modules.<Your VCS Module></friend>
  • Build the IDE by running "ant build-nozip" from the nbbuild directory
    •  cd netbeans/nbbuild
    •  ant build-nozip
  •  Launch NetBeans 6.0 - Open Project versioncontrol/<Your VCS Module>
    •  Right click on <Your VCS Module>l and Build with dependencies
    •  Run - IDE launches and under Versioning see <Your VCS Module> submenu

TODO

Look at the Mercurial Plugin and the Subversion Plugin code to get hints on what to do for your own VCS. 

$ find . -exec grep "TODO" {} \\; -print
        entry = null;     
        // TODO: read your detailed information about the file here, or disregard the entry field
./src/org/netbeans/modules/mercurial/FileInformation.java
        // TODO: insert you status logic here, device status of a file, cache it and return it
        // TODO: make all files and folders uptodate for now
        // TODO: in case the NEW file status does not match OLD file status, fire a change event
        // TODO: FAKE now make all files uptodate and files beginning with "m" as modified
        // TODO: use your own logic here
        // TODO: scan the given folder and return information about containing files
        // TODO: do not put up-to-date files in the map
        // TODO: fake, now only return existing files and make them all uptodate
./src/org/netbeans/modules/mercurial/FileStatusCache.java
        // TODO: insert your logic here
        // TODO FAKE: what lies inside mercurial-root folder is managed by mercurial
./src/org/netbeans/modules/mercurial/Mercurial.java
        // TODO: make locally modified files blue, leave others default
        // TODO; new files should be green, ignored files gray, etc.
        // TODO: ignored folders should be gray
./src/org/netbeans/modules/mercurial/MercurialAnnotator.java


 

Comments:

Post a Comment:
Comments are closed for this entry.
About

jmr

Search

Top Tags
Categories
Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today