db0e4c7dbc280db090d1bd5805806bb464d1d0f1
jcasper
  Tue Jan 28 14:58:23 2014 -0800
Fixed error where chdir failed due to final carriage return in directory name (from pwd)
diff --git src/test/perllib/HgConf.pm src/test/perllib/HgConf.pm
index b9f9114..3a4a0a7 100644
--- src/test/perllib/HgConf.pm
+++ src/test/perllib/HgConf.pm
@@ -16,30 +16,31 @@
 # readConf: read an hg.conf file, which may include other files.
 #
 sub readConf {
     my ($this, $filename, $depth) = (shift, shift, shift);
     confess "Too many arguments" if (defined shift);
     if ($depth > 10) {
       die "Too many levels of included hg.conf files.";
     }
     open(HGCONF, "<$filename")
       || die "Couldn't open $filename: $!\n";
     while (<HGCONF>) {
       next if (/^\s*#/ || /^\s*$/);
       if (/^\s*include\s+(\S+)/) {
 	my $includeFile = $1;
 	my $cwd = `pwd`;
+	chomp($cwd);
 	if ($filename =~ /^(.*\/)[^\/]+$/) {
 	  chdir $1;
 	}
 	readConf($this, $includeFile, $depth+1);
 	chdir $cwd;
       } elsif (/([\w.]+)\s*=\s*(\S+)/) {
 	$this->{$1} = $2;
       }
     }
     close(HGCONF);
 }
 
 #
 # new: create an HgConf object.
 # Mandatory argument: <none>