Page MenuHomePhabricator

Not able to call phabricator api's through svn pre-commit script.
Closed, WontfixPublic

Description

Not able to call phabricator api's through svn pre-commit script.

When I execute svn commit, it gives error like this :

libphutil loaded from '/home/ubuntu/arc_files/libphutil/src'.
arcanist loaded from '/home/ubuntu/arc_files/arcanist/src'.
Config: Reading user configuration file "/root/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/home/ubuntu/jforum_local_repo/.arcconfig".
Working Copy: Path "/home/ubuntu/jforum_local_repo" is part of `svn` working copy "/home/ubuntu/jforum_local_repo".
Working Copy: Project root is at "/home/ubuntu/jforum_local_repo".
Config: Did not find local configuration at "/home/ubuntu/jforum_local_repo/.svn/arc/config".
[2015-03-17 04:04:59] ERROR 8: Undefined offset: 0 at [/home/ubuntu/arc_files/arcanist/src/workflow/ArcanistSvnHookPreCommitWorkflow.php:45]
arcanist(head=master, ref.master=b961869edac9), phutil(head=master, ref.master=ce3959b4046f)
  #0 ArcanistSvnHookPreCommitWorkflow::run() called at [<arcanist>/scripts/arcanist.php:378]
[2015-03-17 04:04:59] ERROR 8: Undefined offset: 1 at [/home/ubuntu/arc_files/arcanist/src/workflow/ArcanistSvnHookPreCommitWorkflow.php:46]
arcanist(head=master, ref.master=b961869edac9), phutil(head=master, ref.master=ce3959b4046f)
  #0 ArcanistSvnHookPreCommitWorkflow::run() called at [<arcanist>/scripts/arcanist.php:378]
>>> [0] <exec> $ svnlook log --transaction '' ''
<<< [0] <exec> 3,213 us

[2015-03-17 04:04:59] EXCEPTION: (CommandException) Command failed with error #1!
COMMAND
svnlook log --transaction '' ''

STDOUT
(empty)

STDERR
svnlook: Can't open file 'format': No such file or directory
 at [<phutil>/src/future/exec/ExecFuture.php:416]
arcanist(head=master, ref.master=b961869edac9), phutil(head=master, ref.master=ce3959b4046f)
  #0 ExecFuture::resolvex() called at [<phutil>/src/future/exec/execx.php:17]
  #1 execx(string, NULL, NULL) called at [<arcanist>/src/workflow/ArcanistSvnHookPreCommitWorkflow.php:51]
  #2 ArcanistSvnHookPreCommitWorkflow::run() called at [<arcanist>/scripts/arcanist.php:378]

Event Timeline

madhavi created this task.Mar 17 2015, 5:07 AM
madhavi raised the priority of this task from to Needs Triage.
madhavi updated the task description. (Show Details)
madhavi added a subscriber: madhavi.

If anyone know, any solution, please reply back.
Thanks in advance

chad updated the task description. (Show Details)Mar 17 2015, 5:09 AM

My pre-commit script is like this :

#!/bin/bash

#sh /svn/madhavi_repo/hooks/shell_script.sh

fab -f /svn/jforum/hooks/fabfile.py phab > /tmp/phab.txt

And my fabfile code is like :

#!/usr/bin/env python
from future import with_statement
from fabric.api import local, settings, abort
from fabric.contrib.console import confirm

from fabric.api import *

import phabricator
import os
import sys

env.user = 'root'
env.hosts = ['10.43.4.236']
env.password = 'gogslab'

phab = phabricator.Phabricator('madhavi','slscgfnhu42b2mqo5nmbhqtlbcq6u4hzzvkfsvhd35ranune5xgidfoccczmpr6us4ug3crxisgfd4bew22z5iqbakkwmj7j3qsjnzg6fowoxrgzuisok5xfjxgcypiltkcyxmmpnmmjxliqx3xas7cpblgryp4samzwfufachpeov5izkr5ogzu7qmmyl4zjqq3vu2tbs4f4df7dutvuqyppsy4xmm4i32sc7ukf47vds5no7zhn72liu5uf4p')

def update():

#run("sudo apt-get update")
sudo('apt-get update')

def phab():

phab = phabricator.Phabricator('madhavi','slscgfnhu42b2mqo5nmbhqtlbcq6u4hzzvkfsvhd35ranune5xgidfoccczmpr6us4ug3crxisgfd4bew22z5iqbakkwmj7j3qsjnzg6fowoxrgzuisok5xfjxgcypiltkcyxmmpnmmjxliqx3xas7cpblgryp4samzwfufachpeov5izkr5ogzu7qmmyl4zjqq3vu2tbs4f4df7dutvuqyppsy4xmm4i32sc7ukf47vds5no7zhn72liu5uf4p')
#run('phab.user.whoami()')
print(phab.user.whoami())

If anyone know solution, please reply back.

#Thanks

Something is calling arc svn-hook-pre-commit, but it's not any of that code. Do you have another hook?

epriestley closed this task as Wontfix.May 4 2015, 2:30 PM
epriestley claimed this task.

Closing for lack of feedback. See also T7674.