[MonoDevelop] Some more code for version control support

Lluis Sanchez lluis@ximian.com
Tue, 07 Dec 2004 02:18:08 +0100


Some comments:

      * VcService is using a copy of the GetXmlAttributes and
        SetXmlAttributes from AbstractProject. We need to factorize this
        code into a class so it can be easily reused (although that code
        is really awful). 
      * Project specific information should always be stored in the
        project's directory, never in a global shared file. 
      * Looks like the class VcResource is not used at all. 
      * Why the IVcRepository interface is defining ToString()? This
        method is already defined in Object. If you want to give a
        special meaning to that method (such as, for example, getting
        the uri of the repository) better use another name. 
      * IVcLocalProject.PrjxFile: better use "ProjectFile", since the
        prjx extension may change in the future. 
      * Since CvsService is actually a version control backend, I think
        that CvsBackendService would be more clarifying name. 
      * In IVcBackend, it is difficult to understand what's the
        difference between CreateRepository and RawCreateRepository. I
        rather would use CreateRepository to create a IVcRepository
        instance, and a ShowEditRepositoryDialog method that displays
        the dialog that can be used to enter/modify repository
        parameters. 
      * The CvsRepository.GetOptions method (which implements
        IVcRepository.GetOptions) returns some HTML that shows
        repository parameters. You are mixing version control logic code
        with GUI code here, and that's not good design pattern. A better
        solution would be to return, for example, a NameValueCollection,
        and leave to the GUI the choice of the best way of showing this
        info. 
      * CvsService.CreateConnection is also mixing logic and GUI. You
        are assuming that a dialog will always be displayed when
        connecting a project to a repository, and this may not be true.
        You should have a method for creating a connection object and
        another for displaying the connection dialog. 
      * After going through the code, I think that a IVcRepository is
        not a version control repository, but a set of repository
        connection parameters. IVcLocalProject looks like it contains
        version control parameters for a project. Maybe you should use
        names that better describe what the class represents. 
      * The cvsOptionsDialog and cvsRepositoryWidget dialogs look very
        similar, they could probably be the same.

Lluis.

On dg, 2004-12-05 at 20:38 +1030, Rubens Ramos wrote: 
> Hi All,
> 
>  Here is an updated patch+new code for version control in
> MD. It is not complete, but has core support to save/load
> CVS repositories and map projects to repositories. 
> Feedback is welcome.
> 
>  It will not compile as default; you need to
>  "configure --with-version-control" to enable compilation of
> this code.
> 
>  And yes, I know, the GUI is ugly - that will need to be
> improved as the vc core and cvs backend code evolve.
> 
>  Todd, let me know if this is at a stage you want to add
> it to svn :)
> 
> Cheers
> Rubens
>