<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Michael Hendricks wrote:
<blockquote cite="mid:20061229223758.GA29565@ginosko" type="cite">
<pre wrap="">On Fri, Dec 29, 2006 at 01:23:58PM -0700, Joshua Jensen wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> * 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"
</pre>
</blockquote>
<pre wrap=""><!---->
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.
</pre>
</blockquote>
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.<br>
<br>
(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... ;) )<br>
<br>
Josh<br>
<br>
*** U:\svk\2.0-releng\bin\svk Thu Dec 28 10:25:53 2006<br>
--- c:\svk Fri Dec 29 13:19:09 2006<br>
***************<br>
*** 56,61 ****<br>
--- 56,63 ----<br>
use Getopt::Long qw(:config no_ignore_case bundling);<br>
use autouse 'SVK::Util' => qw(get_anchor catfile catdir
find_dotsvk);<br>
use Class::Autouse qw(SVK::Command SVK::XD);<br>
+ use Cwd;<br>
+ use File::Spec;<br>
<br>
=head1 NAME<br>
<br>
***************<br>
*** 117,122 ****<br>
--- 119,154 ----<br>
$ENV{USER} ||= (<br>
(defined &Win32::LoginName) ? Win32::LoginName() : ''<br>
) || $ENV{USERNAME} || (getpwuid($<))[0];<br>
+ <br>
+ my $dir = cwd() . "/";<br>
+ <br>
+ sub SVKSearch<br>
+ {<br>
+ my $dir = shift();<br>
+ <br>
+ if (open(INI_IN, $dir . "svk.ini")) {<br>
+ while (<INI_IN>) {<br>
+ my ($left, $right) = /^(.*)=(.*)/;<br>
+ if ($left) {<br>
+ $ENV{$left} = $right;<br>
+ }<br>
+ }<br>
+ <br>
+ close(INI_IN);<br>
+ <br>
+ return 1;<br>
+ }<br>
+ <br>
+ $dir =~ m/(.*\/).+\//;<br>
+ $dir = $1;<br>
+ if (!$dir) {<br>
+ return 0;<br>
+ }<br>
+ <br>
+ &SVKSearch($dir);<br>
+ }<br>
+ <br>
+ SVKSearch($dir);<br>
<br>
my $svkpath = find_dotsvk || $ENV{SVKROOT} || catfile($ENV{HOME},
".svk");<br>
my $floating = undef;<br>
<br>
</body>
</html>