From: Joey Hess Date: Sun, 28 Oct 2007 23:55:02 +0000 (-0400) Subject: * Make registration work when no config file yet exists. Closes: #448422 X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/154cb0f1671c05c0dfb5ec1c13c3a1fe06983692 * Make registration work when no config file yet exists. Closes: #448422 --- diff --git a/debian/changelog b/debian/changelog index 2c7d823..9e05825 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ mr (0.10) UNRELEASED; urgency=low * Add a lib file for using unison with mr. + * Make registration work when no config file yet exists. Closes: #448422 - -- Joey Hess Fri, 26 Oct 2007 03:57:51 -0400 + -- Joey Hess Sun, 28 Oct 2007 19:54:31 -0400 mr (0.9) unstable; urgency=low diff --git a/mr b/mr index 67196ca..ccc7647 100755 --- a/mr +++ b/mr @@ -960,14 +960,19 @@ sub register { #{{{ # Find the closest known mrconfig file to the current # directory. $directory.="/" unless $directory=~/\/$/; + my $foundconfig=0; foreach my $topdir (reverse sort keys %config) { next unless length $topdir; if ($directory=~/^\Q$topdir\E/) { $ENV{MR_CONFIG}=$configfiles{$topdir}; $directory=$topdir; + $foundconfig=1; last; } } + if (! $foundconfig) { + $directory=""; # no config file, use builtin + } } if (@ARGV) { my $subdir=shift @ARGV;