[Webkit-unassigned] [Bug 26999] bugzilla-tool/svn-apply can't handle patches made from a non-root directory

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 14 16:03:20 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=26999





--- Comment #11 from Joseph Pecoraro <joepeck02 at gmail.com>  2009-07-14 16:03:19 PDT ---
(In reply to comment #5)
> (From update of attachment 32491 [details])
> > +use webkitdirs;
> 
> It's unfortunate that we need to use the webkitdirs module since this script
> could be used on any SVN working directory previously.  (Darin Adler may have
> more input on this.)

This removes the dependency on "webkitdirs" which removes a few other includes
that this had introduced.


> > +sub chdirWebKitAndGetPrefix;
> 
> This needs empty parenthesis after the declaration (an empty prototype) to
> match the style of the rest of the source.

Done. This and all other style changes.


> > +    my $file = $prefix . $fileData->{path};
> 
> This should use File::Spec->catdir($prefix, $fileData->{path}) instead.  Then
> you don't have to worry about the trailing '/' in chdirWebKitAndGetPrefix().

Done. Much cleaner.


> > +{
> > +    my $before = File::Spec->rel2abs( File::Spec->curdir() );
> > +    chdirWebKit();
> > +    my $after = File::Spec->rel2abs( File::Spec->curdir() );
> > +    $before =~ s/^$after\/?//;
> 
> I think it would be clearer to use File::Spec::abs2rel() instead of rolling
> your own regex here:
> 
> my $relativePath = File::Spec->abs2rel($after, $before);

Done. Much cleaner.


> IMO, it would be great to have a replacement subroutine for chdirwebkit() that
> got the svn URL from the "svn info" command in the current directory, then did
> a "chdir .." until the current svn URL no longer matched the previous svn URL
> (minus one directory), then you could chdir back into the last directory.  This
> would then put you at the root of the svn working directory regardless of
> whether you're working on WebKit or not.

The way I went about it was using "svn info [PATH]".  And building up that path
as a trail of "../".  I also use system() to check the error code of svn info. 
Let me know if there is a problem with this approach (cross platform?) or if
you think of a better way and I'll see what I can do.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list