Lock paths in the scm cache

[?]
Feb 21, 2017, 5:11 PM
7EGUBBRQLBNFHH2E3ZMOTJBV36JG2A4Y5J2CR5I7V3WOXJVNLXYAC

Dependencies

  • [2] IBW53PUC HipChat notification: add support for Mercurial inputs for determining who might have broken the build.
  • [3] CKYPPACO Hopefully fix UTF-8 chars in Hipchat notification messages
  • [4] 3BTJRSU3 GitInput.pm: Don't do a chdir to the Git clone
  • [5] NB2VOKIR Include names of committers in HipChat notifications
  • [6] JAH3UPWA Support revision control systems via plugins

Change contents

  • edit in src/lib/Hydra/Plugin/GitInput.pm at line 10
    [3.12]
    [4.5040]
    use Fcntl qw(:flock);
  • replacement in src/lib/Hydra/Plugin/GitInput.pm at line 22
    [4.5245][4.0:128]()
    # Clone or update a branch of a repository into our SCM cache.
    sub _cloneRepo {
    my ($self, $uri, $branch, $deepClone) = @_;
    [4.5245]
    [4.5421]
    sub _parseValue {
    my ($value) = @_;
    (my $uri, my $branch, my $deepClone) = split ' ', $value;
    $branch = defined $branch ? $branch : "master";
    return ($uri, $branch, $deepClone);
    }
    sub fetchInput {
    my ($self, $type, $name, $value) = @_;
    return undef if $type ne "git";
    my ($uri, $branch, $deepClone) = _parseValue($value);
  • edit in src/lib/Hydra/Plugin/GitInput.pm at line 36
    [4.5422]
    [4.5422]
    # Clone or update a branch of the repository into our SCM cache.
  • edit in src/lib/Hydra/Plugin/GitInput.pm at line 40
    [4.5545]
    [4.5545]
    open(my $lock, ">", "$clonePath.lock") or die;
    flock($lock, LOCK_EX) or die;
  • edit in src/lib/Hydra/Plugin/GitInput.pm at line 78
    [4.7738][4.292:513](),[4.514][4.514:614]()
    return $clonePath;
    }
    sub _parseValue {
    my ($value) = @_;
    (my $uri, my $branch, my $deepClone) = split ' ', $value;
    $branch = defined $branch ? $branch : "master";
    return ($uri, $branch, $deepClone);
    }
    sub fetchInput {
    my ($self, $type, $name, $value) = @_;
    return undef if $type ne "git";
  • edit in src/lib/Hydra/Plugin/GitInput.pm at line 79
    [4.615][4.615:741]()
    my ($uri, $branch, $deepClone) = _parseValue($value);
    my $clonePath = $self->_cloneRepo($uri, $branch, $deepClone);
  • edit in src/lib/Hydra/Plugin/MercurialInput.pm at line 9
    [4.10854]
    [4.10854]
    use Fcntl qw(:flock);
  • edit in src/lib/Hydra/Plugin/MercurialInput.pm at line 43
    [2.469]
    [4.11336]
    open(my $lock, ">", "$clonePath.lock") or die;
    flock($lock, LOCK_EX) or die;