Skip to Content.
Sympa Menu

notify-dpml - svn commit: r2253 - in infrastructure/jira-dpml/svn/src: main/net/dpml/jira test/net/dpml/jira

notify-dpml AT lists.ibiblio.org

Subject: DPML Notify

List archive

Chronological Thread  
  • From: peter AT neubauer.se
  • To: notify-dpml AT lists.ibiblio.org
  • Subject: svn commit: r2253 - in infrastructure/jira-dpml/svn/src: main/net/dpml/jira test/net/dpml/jira
  • Date: Sat, 09 Apr 2005 03:08:21 -0400

Author: peter AT neubauer.se
Date: Sat Apr 9 03:08:18 2005
New Revision: 2253

Modified:
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
Log:
minor tweaks, still not working. INFRA-3


Modified: infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java
==============================================================================
--- infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java
(original)
+++ infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnHelper.java Sat
Apr 9 03:08:18 2005
@@ -22,15 +22,6 @@

public class SvnHelper
{
- public static void update( File workDir, PrintStream log ) throws
Exception
- {
- String[] t_args = new String[]{"update"};
- log.println( format( t_args ) );
- executeCommand( log, "svn", t_args, workDir );
- return;
-
- }
-
public static void commit( String file, String user, String password,
PrintStream log ) throws Exception
{
@@ -53,15 +44,14 @@
}

public static void updateSvnPassword( String htpasswordPath,
- File passwordFilePath, String confirmedUser, String password,
- PrintStream log, String iWorkingDir )
+ String iFile, String confirmedUser, String password,
+ PrintStream log )
{
try
{
- String m_CommandLine = htpasswordPath;
- String[] t_args = new
String[]{"-b",passwordFilePath.getAbsolutePath(), confirmedUser, password};
+ String[] t_args = new String[]{htpasswordPath, "-b",iFile ,
confirmedUser, password};
log.println( t_args );
- executeCommand( log, m_CommandLine,t_args, new File(iWorkingDir)
);
+ executeCommand( log, t_args );
return;
}
catch ( Exception e )
@@ -74,10 +64,10 @@

}

- private static void executeCommand( PrintStream log, String command,
String[] t_args, File workDir )
+ private static void executeCommand( PrintStream log, String[] t_args )
throws Exception
{
- Process p = Runtime.getRuntime().exec( command, t_args, workDir);
+ Process p = Runtime.getRuntime().exec( t_args );
if ( p.waitFor() != 0 )
{
java.io.DataInputStream dis = new java.io.DataInputStream( p

Modified:
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
==============================================================================
---
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
(original)
+++
infrastructure/jira-dpml/svn/src/main/net/dpml/jira/SvnUpdateListener.java
Sat Apr 9 03:08:18 2005
@@ -27,9 +27,10 @@
import com.atlassian.jira.event.user.UserEventListener;

/**
- * A listener for updating Svn user acoount file from Jira user events.
- * To make the commit/checkout work, we are relying on the cached svn
credentials,
- * so if your repo is user-protected, you woul need to check out the stuff
manually once.
+ * A listener for updating Svn user acoount file from Jira user events. To
make
+ * the commit/checkout work, we are relying on the cached svn credentials,
so if
+ * your repo is user-protected, you woul need to check out the stuff manually
+ * once.
*
* <p>
* Useful for debuggin when certain events are fired, and the content of
those
@@ -42,33 +43,31 @@

private Map m_Params;

- public static final String WORK_DIR = "workDir";
+ public static final String SVN_DIR = "svnDir";

- private String m_svnWorkingDir;
+ private String m_svnWorkingDir;

- private String m_passwordFile;
+ private String m_passwordFile;

public void init( Map params )
{
log( "SvnListener.init" );
log( params.toString() );
m_Params = params;
-
- m_svnWorkingDir = params.get( WORK_DIR ).toString();
- m_passwordFile = params.get( PWD_FILE_NAME ).toString();
try
{
- SvnHelper.update( new File(m_svnWorkingDir), System.out );
+ m_svnWorkingDir = params.get( SVN_DIR ).toString();
+ m_passwordFile = params.get( PWD_FILE_NAME ).toString();
}
- catch ( Exception e )
+ catch ( NullPointerException npe )
{
- log( "could not update:" + m_Params.toString() );
+ log( "seems to be not yet configured " + params );
}
}

public String[] getAcceptedParams()
{
- return new String[]{PWD_FILE_NAME, WORK_DIR};
+ return new String[]{PWD_FILE_NAME, SVN_DIR};
}

// IssueEventListener implementation
@@ -151,7 +150,8 @@
logEvent( event );
String username = event.getUser().getEmail();
String password = "test";
- SvnHelper.updateSvnPassword("/usr/bin/htpaswd2", new
File(m_svnWorkingDir, m_passwordFile), username, password, System.out,
m_svnWorkingDir);
+ SvnHelper.updateSvnPassword( "htpasswd2", m_passwordFile, username,
+ password, System.out );
}

public void userForgotPassword( UserEvent event )
@@ -212,10 +212,10 @@
public String getDescription()
{
String description = "A listener for updating Svn user acoount file
from Jira user events."
- + "<table>" +
- "<tr><td><b>pwdFileName</b></td><td>the name of the
*.pwd file within the svnWork directory</td></tr>"
- + "<tr><td><b>workDir</b></td><td>the directory where the
file is previously checked out with svn commit rights</td></tr>" +
- "</table>";
+ + "<table>"
+ + "<tr><td><b>pwdFileName</b></td><td>the relative path of
the *.pwd file from the working dir of jira</td></tr>"
+ + "<tr><td><b>svnDir</b></td><td>the directory where the
file is previously checked out with svn commit rights</td></tr>"
+ + "</table>";
return description;
}
}

Modified:
infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
==============================================================================
--- infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
(original)
+++ infrastructure/jira-dpml/svn/src/test/net/dpml/jira/SvnCommandTest.java
Sat Apr 9 03:08:18 2005
@@ -26,17 +26,11 @@
{
public void testSvnCheckout() throws Exception
{
- String m_1 =
"https://scm.dpml.net/repos/dpml/development/main/transit/core/etc/";;
- String m_2 = "peter AT neubauer.se";
- String m_string = "test";
String m_string2 = "target";
Map params = new HashMap();
- params.put(SvnUpdateListener.SVN_CONTAINER,m_1);
String file = "test";
params.put(SvnUpdateListener.PWD_FILE_NAME,file);
- params.put(SvnUpdateListener.USERNAME,m_1);
- params.put(SvnUpdateListener.PASSWORD,m_string);
- params.put(SvnUpdateListener.WORK_DIR,m_string2);
+ params.put(SvnUpdateListener.SVN_DIR,m_string2);

//SvnUpdateListener listener = new SvnUpdateListener();
//listener.init(params);



  • svn commit: r2253 - in infrastructure/jira-dpml/svn/src: main/net/dpml/jira test/net/dpml/jira, peter, 04/08/2005

Archive powered by MHonArc 2.6.24.

Top of Page