List Info

Thread: Creating a project entry automatically if workbench is launched from within a working copy?




Creating a project entry automatically if workbench is launched from within a working copy?
user name
2006-08-25 14:34:14
Barry Scott wrote:
...
>> Today, one of my coworkers suggested that it is
much too
>> complicated to "attach" pysvn workbench
to an existing
>> subversion working copy. All he wants to do is
bring up
>> workbench from within the working copy directory
>> and be done with it.
...
> this needs to have something extra on the command line.
> Always having workbench do this on its default command
> line is not good. maybe
> 
> workbench --project .

The attached patch works fine for me.
It does require "--project `pwd`" or (more
general)
"--project /abs/path/to/working/copy", because
at the time
WbApp sees the args, the working directory has been changed
to the home directory.
That's fine, though, because we use a wrapper to call
workbench anyway.

Carsten.
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org
Creating a project entry automatically if workbench is launched from within a working copy?
user name
2006-09-12 07:53:12
Carsten Koch wrote:
> Barry Scott wrote:
...
>> this needs to have something extra on the command
line.
>> Always having workbench do this on its default
command
>> line is not good. maybe
>>
>> workbench --project .



Do you require anything else on that patch
before it can get commited?

Carsten.





> It does require "--project `pwd`" or (more
general)
> "--project /abs/path/to/working/copy",
because at the time
> WbApp sees the args, the working directory has been
changed
> to the home directory.
> That's fine, though, because we use a wrapper to call
> workbench anyway.
> 
> Carsten.
> 
> 
>
------------------------------------------------------------
------------
> 
> Index: wb_tree_panel.py
>
============================================================
=======
> --- wb_tree_panel.py	(revision 675)
> +++ wb_tree_panel.py	(working copy)
>  -13,6 +13,7 
>  import wx
>  import cPickle
>  import os
> +import pysvn
>  
>  import wb_exceptions
>  import wb_source_control_providers
>  -142,7 +143,26 
>          return '<WbTreePanel %r>' %
self.getSelectionProjectInfo()
>  
>      def initFrame( self ):
> -        self.initTree(
self.app.prefs.getProjects().getProjectList() )
> +        project_list =
self.app.prefs.getProjects().getProjectList()
> +        if self.app.auto_project_dir is not None:
> +            for project in project_list:
> +                if project.wc_path ==
self.app.auto_project_dir:
> +                    break
> +            else:
> +                if
wb_source_control_providers.hasProvider( 'subversion' ):
> +                    try:
> +                        url = pysvn.Client().info(
self.app.auto_project_dir ).url
> +                    except pysvn.ClientError:
> +                        url = None
> +                    if url is not None:
> +                        provider =
wb_source_control_providers.getProvider( 'subversion' )
> +                        project_info =
provider.getProjectInfo( self.app )
> +                        project_name = os.path.split(
self.app.auto_project_dir )[1]
> +                        project_info.init(
project_name, url = url, wc_path = self.app.auto_project_dir
)
> +                       
self.app.prefs.getProjects().addProject( project_info )
> +                        project_list =
self.app.prefs.getProjects().getProjectList()
> +
> +        self.initTree( project_list )
>          self.gotoBookmark(
self.last_position_bookmark_name )
>  
>      def OnSetFocus( self, event ):
> Index: wb_app.py
>
============================================================
=======
> --- wb_app.py	(revision 675)
> +++ wb_app.py	(working copy)
>  -42,6 +42,14 
>  
>          wb_platform_specific.setupPlatform()
>  
> +        # --project <dir> automatically creates
a project entry for <dir>
> +        # if <dir> is a subversion working copy
and no project entry exists for it.
> +        self.auto_project_dir = None
> +        if '--project' in args:
> +            project_arg_index = args.index(
'--project' )
> +            if project_arg_index < len( args ) - 1:
> +               self.auto_project_dir =
args[project_arg_index+1]
> +
>          # Debug settings
>  
>          # don't redirect IO into the log window
> 
> 

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org

Creating a project entry automatically if workbench is launched from within a working copy?
user name
2006-09-12 21:18:56
On Sep 12, 2006, at 08:53, Carsten Koch wrote:

> Carsten Koch wrote:
>> Barry Scott wrote:
> ...
>>> this needs to have something extra on the
command line.
>>> Always having workbench do this on its default
command
>>> line is not good. maybe
>>>
>>> workbench --project .
>
>
>
> Do you require anything else on that patch
> before it can get commited?

I need to review and the commit. Sorry I overlooked this.
I should do this in a day or so.

Barry



------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )