[svk-devel] svk 2.0.0 is released. [win32]

Joshua Jensen jjensen at workspacewhiz.com
Fri Dec 29 18:46:49 EST 2006


Michael Hendricks wrote:
> On Fri, Dec 29, 2006 at 01:23:58PM -0700, Joshua Jensen wrote:
>   
>>    * I use a modified bin/svk that starts at the working directory and
>>      scans up the directory chain looking for an svk.ini.  When found,
>>      it reads each line in and sets it into $ENV.  This way, I can have
>>      multiple SVK repositories and have the environment set dependent
>>      on where SVK is run from.  I've posted a patch for this before,
>>      but there seemed to be no interest, so I just apply it myself each
>>      time.  I am unsure if SVK 2.0 offers something similar.  An
>>      example follows.  Anyway, due to the .exe packed up, I can't apply
>>      my patch.
>>
>> SVKROOT=p:\repos
>> SVKDIFF="c:\Program Files\kdiff3\kdiff3.exe"
>> SVKMERGE="c:\Program Files\kdiff3\kdiff3.exe"
>>     
>
> I'd be interested in seeing this patch if you don't mind resending it.
> I have an SVK branch that adds a user configuration file to SVK.  I'm
> interested to see what I can steal from your approach.
>   
I was going to use SVK to generate the patch for me, but something isn't 
working quite right with it connecting to the server to get the svk 
drop.  So, I generated the patch with WinMerge.  My apologies.

(Remember, my Perl skills are virtually non-existent.  I'm sure someone 
who knows Perl better than me will look at this, laugh at it, collapse 
it to 2 lines, and have a much better implementation... ;) )

Josh

*** U:\svk\2.0-releng\bin\svk    Thu Dec 28 10:25:53 2006
--- c:\svk    Fri Dec 29 13:19:09 2006
***************
*** 56,61 ****
--- 56,63 ----
  use Getopt::Long qw(:config no_ignore_case bundling);
  use autouse 'SVK::Util' => qw(get_anchor catfile catdir find_dotsvk);
  use Class::Autouse qw(SVK::Command SVK::XD);
+ use Cwd;
+ use File::Spec;
 
  =head1 NAME
 
***************
*** 117,122 ****
--- 119,154 ----
  $ENV{USER} ||= (
      (defined &Win32::LoginName) ? Win32::LoginName() : ''
  ) || $ENV{USERNAME} || (getpwuid($<))[0];
+
+ my $dir = cwd() . "/";
+
+ sub SVKSearch
+ {
+     my $dir = shift();
+
+     if (open(INI_IN, $dir . "svk.ini")) {
+         while (<INI_IN>) {
+             my ($left, $right) = /^(.*)=(.*)/;
+             if ($left) {
+                 $ENV{$left} = $right;
+             }
+         }
+
+         close(INI_IN);
+
+         return 1;
+     }
+
+     $dir =~ m/(.*\/).+\//;
+     $dir = $1;
+     if (!$dir) {
+         return 0;
+     }
+
+     &SVKSearch($dir);
+ }
+
+ SVKSearch($dir);
 
  my $svkpath = find_dotsvk || $ENV{SVKROOT} || catfile($ENV{HOME}, ".svk");
  my $floating = undef;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/svk-devel/attachments/20061229/7072b844/attachment-0001.htm


More information about the svk-devel mailing list