List Info

Thread: Updated workbench patches - workbench_missing_diff_file_workaround.patch.




Updated workbench patches - workbench_missing_diff_file_workaround.p atch.
user name
2007-06-25 06:17:11
Hi,

I have updated my workbench copy to the latest revision
(r865)
and re-merged my remaining 3 patches which have not yet made
it
into Barrys official workbench repository.

Attached is patch #2:
workbench_missing_diff_file_workaround.patch

My mod description is:



Mod name: cko-issue_15326b.
Issues resolved: 15326.
Mod description:
If one of the local files for a diff operation is missing,
do not abort diff processing, but create an empty temp
file,
so the diff tool does not complain, but still comes up
showing just one file.






Barry, if you approve, please commit.

Thanks and Cheers,
Carsten.


------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribepysvn.tigris.org
For additional commands, e-mail: dev-helppysvn.tigris.org
  
Re: Updated workbench patches - workbench_missing_diff_file_workaround.p atch.
user name
2007-07-07 08:43:26
What is the use case that this is a fix for?

I can see what it does not I;m not sure why you think this is needed.
If I add a file the diff is not allow. If a file is not in the working copy then
a revert or delete will fix things.

Barry



On Jun 25, 2007, at 12:17, Carsten Koch wrote:

Hi,

I have updated my workbench copy to the latest revision (r865)
and re-merged my remaining 3 patches which have not yet made it
into Barrys official workbench repository.

Attached is patch #2: workbench_missing_diff_file_workaround.patch

My mod description is:



Mod name: cko-issue_15326b.
Issues resolved: 15326.
Mod description:
If one of the local files for a diff operation is missing,
do not abort diff processing, but create an empty temp file,
so the diff tool does not complain, but still comes up showing just one file.






Barry, if you approve, please commit.

Thanks and Cheers,
Carsten.

diff -ruN WorkbenchBarry865/wb_subversion_diff.py WorkbenchICEM/wb_subversion_diff.py
--- WorkbenchBarry865/wb_subversion_diff.py 2007-06-19 16:09:56.728795000 +0200
+++ WorkbenchICEM/wb_subversion_diff.py 2007-06-22 19:04:12.382332000 +0200
-91,11 +91,14

 

     # Check for possible errors in advance to give the user a clear message.
     for path_info in (old_path_info, new_path_info):
-        if( path_info.revision is None
-        or path_info.revision.kind == pysvn.opt_revision_kind.working ):
+        if ( path_info.revision is None
+             or path_info.revision.kind == pysvn.opt_revision_kind.working ):
             if not os.path.exists( path_info.path ):
                 app.log_error( '"%s" does not exist.' % path_info.path )
-                return
+                fd, path_info.path = tempfile.mkstemp( suffix=os.path.basename( path_info.path ) )
+                os.close( fd )
+                # keep track of the temp file
+                app.all_temp_files.append( path_info.path )

 

             if os.path.isdir( path_info.path ):
                 app.log_error( '"%s" refers to a directory.' % path_info.path )
-131,9 +134,6
         except IOError, e:
             app.log_error( e )

 

-        except pysvn.ClientError, e:
-            app.log_client_error( e )
-
         yield app.foregroundProcess

 

         if ok:
-162,9 +162,6
         except IOError, e:
             app.log_error( e )

 

-        except pysvn.ClientError, e:
-            app.log_client_error( e )
-
         yield app.foregroundProcess

 

         if ok:
-182,9 +179,6
         except IOError, e:
             app.log_error( e )

 

-        except pysvn.ClientError, e:
-            app.log_client_error( e )
-
         yield app.foregroundProcess

 

         # built-in
-277,64 +271,73
     return options

 

 #
-#   throws IOError and pysvn.ClientError
+#   throws IOError.
 #
-def __getFileContents( project_info, path_info ):
-    if path_info.revision is None or path_info.revision.kind == pysvn.opt_revision_kind.working:
-        all_content_lines = wb_read_file.readFileContentsAsUnicode( path_info.path ).split('n')
-
-    else:
-        if path_info.revision.kind == pysvn.opt_revision_kind.base:
-            all_contents = project_info.client_bg.cat(
-                url_or_path=path_info.path,
-                revision=path_info.revision )
-
-        else:
-            if path_info.peg_revision is not None:
-                all_contents = project_info.client_bg.cat(
-                    url_or_path=path_info.peg_path,
-                    revision=path_info.revision,
-                    peg_revision=path_info.peg_revision )
-
-            else:
-                all_contents = project_info.client_bg.cat(
-                    url_or_path=path_info.path,
-                    revision=path_info.revision )
-
-        all_content_lines = wb_read_file.contentsAsUnicode( all_contents ).split( 'n' ) 
+def __getFileContents( project_info, path_info ):    
+    all_content_lines = ''
+    try:
+       if path_info.revision is None or path_info.revision.kind == pysvn.opt_revision_kind.working:
+           all_content_lines = wb_read_file.readFileContentsAsUnicode( path_info.path ).split('n')
+    
+       else:
+           if path_info.revision.kind == pysvn.opt_revision_kind.base:
+               all_content_liness = project_info.client_bg.cat(
+                   url_or_path=path_info.path,
+                   revision=path_info.revision )
+    
+           else:
+               if path_info.peg_revision is not None:
+                   all_content_liness = project_info.client_bg.cat(
+                       url_or_path=path_info.peg_path,
+                       revision=path_info.revision,
+                       peg_revision=path_info.peg_revision )
+    
+               else:
+                   all_content_liness = project_info.client_bg.cat(
+                       url_or_path=path_info.path,
+                       revision=path_info.revision )
+    
+           all_content_lines = wb_read_file.contentsAsUnicode( all_content_liness ).split( 'n' ) 
+    except pysvn.ClientError, e:
+        app.log_client_error( e )
+   

 

     return all_content_lines

 

 #
-#   throws IOError and pysvn.ClientError
+#   throws IOError.
 #
 def __getLocalFilename( app, project_info, path_info ):
     rev_description = ''
-    if path_info.revision is None or path_info.revision.kind == pysvn.opt_revision_kind.working:
-        return path_info.path
+    all_content = ''
+    try:
+        if path_info.revision is None or path_info.revision.kind == pysvn.opt_revision_kind.working:
+            return path_info.path

 

-    elif path_info.revision.kind == pysvn.opt_revision_kind.base:
-        rev_description = 'BASE'
-        all_content = project_info.client_bg.cat(
-                url_or_path=path_info.path,
-                revision=path_info.revision )
-
-    else:
-        if path_info.revision.kind == pysvn.opt_revision_kind.head:
-            rev_description = 'HEAD'
-        else:
-            rev_description = 'R%d' % path_info.revision.number
-
-        if path_info.peg_revision is not None:
-            all_content = project_info.client_bg.cat(
-                    url_or_path=path_info.peg_path,
-                    peg_revision=path_info.peg_revision,
-                    revision=path_info.revision )
-        else:
+        elif path_info.revision.kind == pysvn.opt_revision_kind.base:
+            rev_description = 'BASE'
             all_content = project_info.client_bg.cat(
                     url_or_path=path_info.path,
                     revision=path_info.revision )

 

+        else:
+            if path_info.revision.kind == pysvn.opt_revision_kind.head:
+                rev_description = 'HEAD'
+            else:
+                rev_description = 'R%d' % path_info.revision.number
+
+            if path_info.peg_revision is not None:
+                all_content = project_info.client_bg.cat(
+                        url_or_path=path_info.peg_path,
+                        peg_revision=path_info.peg_revision,
+                        revision=path_info.revision )
+            else:
+                all_content = project_info.client_bg.cat(
+                        url_or_path=path_info.path,
+                        revision=path_info.revision )
+    except pysvn.ClientError, e:
+        app.log_client_error( e )
+
     # create a temp file with a name that is based on the original filename
     prefix = 'tmp-%s-%s-' % (os.path.basename( path_info.path ), rev_description)
     suffix = os.path.splitext( path_info.path )[1]

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

Re: Updated workbench patches - workbench_missing_diff_file_workaround.p atch.
user name
2007-07-12 13:15:12
Barry Scott wrote:
> What is the use case that this is a fix for?

we have found a number of cases here at ICEM where
one of the two files is unavailable.

1) You specified a revision where the file did not yet
exist.

2) You added the file in your branch, so the branch has it,
   but the branch origin does not.

3) You deleted the file in your branch, so the branch origin
has it,
   but the branch does not.

There may be more, I do not remember all.

In any event, my users requested this feature.
They seem to like it.

Carsten.



------------------------------------------------------------
---------
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 )