Changeset 46669 in webkit


Ignore:
Timestamp:
Aug 1, 2009 7:23:34 AM (15 years ago)
Author:
ddkilzer@apple.com
Message:

Implement VCSUtils::determineVCSRoot()

Reviewed by Eric Seidel.

Step 1 to fix:
<http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths

  • Scripts/VCSUtils.pm: Removed reference to webkitdirs module. (VCSUtils::EXPORT): Added &determineVCSRoot. Realphabetized. (VCSUtils::determineGitRoot): Added. Based on code in commit-log-editor. (VCSUtils::determineVCSRoot): Implemented using determineGitRoot() and determineSVNRoot().
  • Scripts/commit-log-editor: Replaced use of topLevelSourceDirectory() with determineVCSRoot(). Resorted use statements. (topLevelSourceDirectory): Removed.
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r46664 r46669  
     12009-08-01  David Kilzer  <ddkilzer@apple.com>
     2
     3        Implement VCSUtils::determineVCSRoot()
     4
     5        Reviewed by Eric Seidel.
     6
     7        Step 1 to fix:
     8        <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
     9
     10        * Scripts/VCSUtils.pm: Removed reference to webkitdirs module.
     11        (VCSUtils::EXPORT): Added &determineVCSRoot.  Realphabetized.
     12        (VCSUtils::determineGitRoot): Added.  Based on code in
     13        commit-log-editor.
     14        (VCSUtils::determineVCSRoot): Implemented using
     15        determineGitRoot() and determineSVNRoot().
     16        * Scripts/commit-log-editor: Replaced use of
     17        topLevelSourceDirectory() with determineVCSRoot().  Resorted
     18        use statements.
     19        (topLevelSourceDirectory): Removed.
     20
    1212009-07-31  Daniel Bates  <dbates@intudata.com>
    222
  • trunk/WebKitTools/Scripts/VCSUtils.pm

    r46236 r46669  
    1 # Copyright (C) 2007 Apple Inc.  All rights reserved.
     1# Copyright (C) 2007, 2008, 2009 Apple Inc.  All rights reserved.
    22#
    33# Redistribution and use in source and binary forms, with or without
     
    2929use strict;
    3030use warnings;
     31
     32use File::Basename;
    3133use File::Spec;
    32 use webkitdirs;
    3334
    3435BEGIN {
     
    3738   $VERSION     = 1.00;
    3839   @ISA         = qw(Exporter);
    39    @EXPORT      = qw(&isGitDirectory &isGit &isSVNDirectory &isSVN &determineSVNRoot &makeFilePathRelative);
     40   @EXPORT      = qw(&determineSVNRoot &determineVCSRoot &isGit &isGitDirectory &isSVN &isSVNDirectory &makeFilePathRelative);
    4041   %EXPORT_TAGS = ( );
    4142   @EXPORT_OK   = ();
     
    103104    $isSVN = isSVNDirectory(".");
    104105    return $isSVN;
     106}
     107
     108sub determineGitRoot()
     109{
     110    chomp(my $gitDir = `git rev-parse --git-dir`);
     111    return dirname($gitDir);
    105112}
    106113
     
    140147}
    141148
     149sub determineVCSRoot()
     150{
     151    if (isGit()) {
     152        return determineGitRoot();
     153    }
     154    if (isSVN()) {
     155        return determineSVNRoot();
     156    }
     157    die "Unable to determine VCS root";
     158}
     159
    142160sub svnRevisionForDirectory($)
    143161{
  • trunk/WebKitTools/Scripts/commit-log-editor

    r46453 r46669  
    11#!/usr/bin/perl -w
    22
    3 # Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
     3# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
    44# Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
    55#
     
    3535use FindBin;
    3636use lib $FindBin::Bin;
     37use Term::ReadKey;
    3738use VCSUtils;
    3839use webkitdirs;
    39 use Term::ReadKey;
    4040
    4141sub normalizeLineEndings($$);
     
    126126exec $editor, @ARGV if $existingLog && $keepExistingLog;
    127127
    128 my $topLevel = topLevelSourceDirectory();
     128my $topLevel = determineVCSRoot();
    129129
    130130my %changeLogSort;
     
    221221unlink "$log.edit";
    222222
    223 sub topLevelSourceDirectory
    224 {
    225     if (isGit()) {
    226         chomp(my $gitDir = `git rev-parse --git-dir`);
    227         return dirname($gitDir);
    228     } elsif (isSVN()) {
    229         return determineSVNRoot();
    230     }
    231 }
    232 
    233223sub normalizeLineEndings($$)
    234224{
Note: See TracChangeset for help on using the changeset viewer.