Using Perforce Changelist

david woon
2008-08-11
2013-06-03
  • david woon
    david woon
    2008-08-11

    Hi,

    Got 1.9.5 implemented, it works well with diff file upload and Bugzilla integration

    Reading from the 1.9.5 CodeStriker Guide and other user's comments
    I can put Perforce changelist in either Start_tag or End_tag and specify // in Module
    To have CodeStriker get the changes automatically from perforce database.
    But it fails with following:

    Problem generating topic text:

    Perforce client error:
    Connect to server failed; check $P4PORT.
    TCP connect to perforce failed.
    perforce: host unknown.

    Checked again with codestriker.conf and had setup up p4 access rights correctly for webserver/ user access.
    After many tries, I wonder if this ever worked? Or it only worked for the cvs setup? I'd assume something is not setup correctly on my end instead. How can I make this work?

    thanks,
    -david woon

     
    • David Sitsky
      David Sitsky
      2008-08-12

      Hi David,

      The function certainly does work for Perforce.

      Try logging in as the same user that is running apache, and try running the p4 command manually from the shell.  Usually it is related to permissions or some sort of mis-configuration or a firewall getting in the way.

      If you have uploaded Perforce diffs already, do the Parallel links work from the view topic page?  They also use p4 in order to retrieve the entire file from the depot.

      Cheers,
      David

       
    • david woon
      david woon
      2008-08-13

      Hi David,

      To answer your question, yes, I was able to do the Parallel link and it worked.
      As user 'apache' I'd updated it's access to the perforce server yet it's still giving the same error.
      I wonder if I have to restart the httpd service.

      IT support who'd setup the web server suggested that a perl module had to be created that spec P4PORT?
      Does that make sense?

      thanks,
      -david

       
      • David Sitsky
        David Sitsky
        2008-08-13

        I think I can see the problem.  The person who implemented this code assumed that perforce is running on the same machine as the web-server.  This however is not the case with the Parallel link handlers.

        Can you modify the file lib/Codestriker/Repository/Perforce.pm.  Open it in a text editor, go right to the bottom and replace the text:

        Codestriker::execute_command($stdout_fh, $stderr_fh, $Codestriker::p4,
                     '-u', $self->{user}, '-P', $self->{password}, 'describe',
                     '-du', $tag);

        with

        Codestriker::execute_command($stdout_fh, $stderr_fh, $Codestriker::p4,
                     '-p', $self->{hostname} . ':' . $self->{port},
                     '-u', $self->{user}, '-P', $self->{password}, 'describe',
                     '-du', $tag);

        We are just adding an extra line.  If you can restart apache, and try again and let me know if that fixes it, that would be great.  Thanks.

        Cheers,
        David

         
    • david woon
      david woon
      2008-08-13

      That seemed to have solved the problem.
      The submission of a changelist went through! It works! thanks!!
      I guess by specifying the host and port tell it where to go.

      Now it stumps me with Software error: when submitting with a diff_file or existing changelist that consists of files with no extensions? For example, developing Linux Kernel files, we have files as Kconfig and Makefile. And it seemed that when there is a combination of files included in a diff_file or changelist, I get the Software error. Doesn't matter if there was 1 file or 10 files in the changelist.

      Here's an example... it keeps referring back to lib/Codestriker/Http/HighlightLineFilter.pm line 38

      Software error:

      Error in tempfile() using /tmp/XXXXXXXXXX.4-rigel/cpu/ppc4xx/Makefile: Parent directory (/tmp/f84ETCt13J.4-rigel/cpu/ppc4xx/) does not exist at /var/www/codestriker/codestriker-1.9.5/bin/../lib/Codestriker/Http/HighlightLineFilter.pm line 38

      For help, please send mail to the webmaster, giving this error message and the time and date of the error.

       
      • David Sitsky
        David Sitsky
        2008-08-13

        I have a feeling this was fixed in 1.9.6.  Can you try upgrading and try again and let me know if it fixes it?  Thanks.

        Cheers,
        David