You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm-dev@maven.apache.org by Ryan Daum <rd...@informiam.com> on 2007/04/12 16:58:33 UTC

Question re: StatusCommandTckTest

Many revision control systems (Mercurial included) ignore the addition of
empty directories to a repository. But the following code in
StatusCommandTckTest requires that the SCM provider "pretend" to have added
the directory:

        // /src/test/java/org
        ScmTestCase.makeDirectory( getUpdatingCopy(), "/src/test/java/org"
);

        addToWorkingTree( getUpdatingCopy(), new File( "src/test/java/org"
), repository );

I can write some fairly elaborate code to have mercurial-provider-hg "lie"
about the addition, but I am worried about potential side effects here.

Is it really the intention of maven-scm to enforce this behaviour, or can we
have a per-SCM-provider configuration which declares whether to test this
behaviour?

Thanks, Ryan

-- 
Ryan Daum
rdaum@informiam.com
Senior Developer, Toronto
647.724.5232 x 2073

Re: Question re: StatusCommandTckTest

Posted by Emmanuel Venisse <em...@venisse.net>.

Ryan Daum a écrit :
> 
> 
> On 4/12/07, *Emmanuel Venisse* <emmanuel@venisse.net 
> <ma...@venisse.net>> wrote:
> 
>     If it ignore the addition, it doesn't generate an error, right?
>     So the result of the add command should return true.
> 
> 
> Actually the code in addToWorkingTree expects that for this addition 
> there should be one file added.
> 
> Wouldn't a better place for the "isAllowEmptyDirectoryAdd" be on the 
> AbstractScmProvider?

I don't think, because it's related to the add command.

> 
> Ryan
>  
> 
>     But we can add a "isAllowToAddEmptyDirectory()" method in the
>     AddCommand and use it in ScmTestCase
> 
>     Emmanuel
> 
>     Ryan Daum a écrit :
>      > Many revision control systems (Mercurial included) ignore the
>     addition
>      > of empty directories to a repository. But the following code in
>      > StatusCommandTckTest requires that the SCM provider "pretend" to have
>      > added the directory:
>      >
>      >         // /src/test/java/org
>      >         ScmTestCase.makeDirectory( getUpdatingCopy(),
>      > "/src/test/java/org" );
>      >
>      >         addToWorkingTree( getUpdatingCopy(), new File(
>      > "src/test/java/org" ), repository );
>      >
>      > I can write some fairly elaborate code to have mercurial-provider-hg
>      > "lie" about the addition, but I am worried about potential side
>     effects
>      > here.
>      >
>      > Is it really the intention of maven-scm to enforce this
>     behaviour, or
>      > can we have a per-SCM-provider configuration which declares
>     whether to
>      > test this behaviour?
>      >
>      > Thanks, Ryan
>      >
>      > --
>      > Ryan Daum
>      > rdaum@informiam.com <ma...@informiam.com>
>     <mailto:rdaum@informiam.com <ma...@informiam.com>>
>      > Senior Developer, Toronto
>      > 647.724.5232 x 2073
> 
> 
> 
> 
> -- 
> Ryan Daum
> rdaum@informiam.com <ma...@informiam.com>
> Senior Developer, Toronto
> 647.724.5232 x 2073


Re: Re: Question re: StatusCommandTckTest

Posted by Ryan Daum <rd...@informiam.com>.
I have made maven-scm-provider-hg "lie" about empty directory additions for
now.

I've added attachments to SCM-244 and SCM-230.  The attachment on SCM-244 is
a patch re: the tick time in the changelog test in mvn-scm-test.  The
attachment in SCM-230 is a tarball of a cleaned-up, working, test-passing
maven-scm-provider-hg.

Can you integrate these into the maven-scm package at your convenience?

Ryan

On 4/12/07, Emmanuel Venisse <em...@venisse.net> wrote:
>
> the directory itself and files must be listed as an addition.
>
> Ryan Daum a écrit :
> > Question: for non-empty directories, does the test assume that the
> > directory itself shows up as an addition?  Or just the files in it?
> >
> > Ryan
> >
> > On 4/12/07, * Ryan Daum* <rdaum@informiam.com
> > <ma...@informiam.com>> wrote:
> >
> >
> >
> >     On 4/12/07, *Emmanuel Venisse* < emmanuel@venisse.net
> >     <ma...@venisse.net>> wrote:
> >
> >         If it ignore the addition, it doesn't generate an error, right?
> >         So the result of the add command should return true.
> >
> >
> >     Actually the code in addToWorkingTree expects that for this addition
> >     there should be one file added.
> >
> >     Wouldn't a better place for the "isAllowEmptyDirectoryAdd" be on the
> >     AbstractScmProvider?
> >
> >     Ryan
> >
> >
> >         But we can add a "isAllowToAddEmptyDirectory()" method in the
> >         AddCommand and use it in ScmTestCase
> >
> >         Emmanuel
> >
> >         Ryan Daum a écrit :
> >         >  Many revision control systems (Mercurial included) ignore the
> >         addition
> >         >  of empty directories to a repository. But the following code
> in
> >         >  StatusCommandTckTest requires that the SCM provider "pretend"
> >         to have
> >         >  added the directory:
> >         >
> >         >         // /src/test/java/org
> >         >         ScmTestCase.makeDirectory( getUpdatingCopy(),
> >         >  "/src/test/java/org" );
> >         >
> >         >         addToWorkingTree( getUpdatingCopy(), new File(
> >         >  "src/test/java/org" ), repository );
> >         >
> >         >  I can write some fairly elaborate code to have
> >         mercurial-provider-hg
> >         >  "lie" about the addition, but I am worried about potential
> >         side effects
> >         >  here.
> >         >
> >         >  Is it really the intention of maven-scm to enforce this
> >         behaviour, or
> >         >  can we have a per-SCM-provider configuration which declares
> >         whether to
> >         >  test this behaviour?
> >         >
> >         >  Thanks, Ryan
> >         >
> >         >  --
> >         >  Ryan Daum
> >         >  rdaum@informiam.com <ma...@informiam.com>
> >         <mailto:rdaum@informiam.com <ma...@informiam.com>>
> >         >  Senior Developer, Toronto
> >         >  647.724.5232 x 2073
> >
> >
> >
> >
> >     --
> >     Ryan Daum
> >     rdaum@informiam.com <ma...@informiam.com>
> >     Senior Developer, Toronto
> >     647.724.5232 x 2073
> >
> >
> >
> >
> > --
> > Ryan Daum
> > rdaum@informiam.com <ma...@informiam.com>
> > Senior Developer, Toronto
> > 647.724.5232 x 2073
>
>


-- 
Ryan Daum
rdaum@informiam.com
Senior Developer, Toronto
647.724.5232 x 2073

Re: Re: Question re: StatusCommandTckTest

Posted by Emmanuel Venisse <em...@venisse.net>.
the directory itself and files must be listed as an addition.

Ryan Daum a écrit :
> Question: for non-empty directories, does the test assume that the 
> directory itself shows up as an addition?  Or just the files in it?
> 
> Ryan
> 
> On 4/12/07, * Ryan Daum* <rdaum@informiam.com 
> <ma...@informiam.com>> wrote:
> 
> 
> 
>     On 4/12/07, *Emmanuel Venisse* < emmanuel@venisse.net
>     <ma...@venisse.net>> wrote:
> 
>         If it ignore the addition, it doesn't generate an error, right?
>         So the result of the add command should return true.
> 
> 
>     Actually the code in addToWorkingTree expects that for this addition
>     there should be one file added.
> 
>     Wouldn't a better place for the "isAllowEmptyDirectoryAdd" be on the
>     AbstractScmProvider?
> 
>     Ryan
>      
> 
>         But we can add a "isAllowToAddEmptyDirectory()" method in the
>         AddCommand and use it in ScmTestCase
> 
>         Emmanuel
> 
>         Ryan Daum a écrit :
>         >  Many revision control systems (Mercurial included) ignore the
>         addition
>         >  of empty directories to a repository. But the following code in
>         >  StatusCommandTckTest requires that the SCM provider "pretend"
>         to have
>         >  added the directory:
>         >
>         >         // /src/test/java/org
>         >         ScmTestCase.makeDirectory( getUpdatingCopy(),
>         >  "/src/test/java/org" );
>         >
>         >         addToWorkingTree( getUpdatingCopy(), new File(
>         >  "src/test/java/org" ), repository );
>         >
>         >  I can write some fairly elaborate code to have
>         mercurial-provider-hg
>         >  "lie" about the addition, but I am worried about potential
>         side effects
>         >  here.
>         >
>         >  Is it really the intention of maven-scm to enforce this
>         behaviour, or
>         >  can we have a per-SCM-provider configuration which declares
>         whether to
>         >  test this behaviour?
>         >
>         >  Thanks, Ryan
>         >
>         >  --
>         >  Ryan Daum
>         >  rdaum@informiam.com <ma...@informiam.com>
>         <mailto:rdaum@informiam.com <ma...@informiam.com>>
>         >  Senior Developer, Toronto
>         >  647.724.5232 x 2073
> 
> 
> 
> 
>     -- 
>     Ryan Daum
>     rdaum@informiam.com <ma...@informiam.com>
>     Senior Developer, Toronto
>     647.724.5232 x 2073 
> 
> 
> 
> 
> -- 
> Ryan Daum
> rdaum@informiam.com <ma...@informiam.com>
> Senior Developer, Toronto
> 647.724.5232 x 2073


Re: Question re: StatusCommandTckTest

Posted by Ryan Daum <rd...@informiam.com>.
Question: for non-empty directories, does the test assume that the directory
itself shows up as an addition?  Or just the files in it?

Ryan

On 4/12/07, Ryan Daum <rd...@informiam.com> wrote:
>
>
>
> On 4/12/07, Emmanuel Venisse <em...@venisse.net> wrote:
> >
> > If it ignore the addition, it doesn't generate an error, right?
> > So the result of the add command should return true.
>
>
> Actually the code in addToWorkingTree expects that for this addition there
> should be one file added.
>
> Wouldn't a better place for the "isAllowEmptyDirectoryAdd" be on the
> AbstractScmProvider?
>
> Ryan
>
>
> But we can add a "isAllowToAddEmptyDirectory()" method in the AddCommand
> > and use it in ScmTestCase
> >
> > Emmanuel
> >
> > Ryan Daum a écrit :
> > > Many revision control systems (Mercurial included) ignore the addition
> >
> > > of empty directories to a repository. But the following code in
> > > StatusCommandTckTest requires that the SCM provider "pretend" to have
> > > added the directory:
> > >
> > >         // /src/test/java/org
> > >         ScmTestCase.makeDirectory( getUpdatingCopy(),
> > > "/src/test/java/org" );
> > >
> > >         addToWorkingTree( getUpdatingCopy(), new File(
> > > "src/test/java/org" ), repository );
> > >
> > > I can write some fairly elaborate code to have mercurial-provider-hg
> > > "lie" about the addition, but I am worried about potential side
> > effects
> > > here.
> > >
> > > Is it really the intention of maven-scm to enforce this behaviour, or
> > > can we have a per-SCM-provider configuration which declares whether to
> > > test this behaviour?
> > >
> > > Thanks, Ryan
> > >
> > > --
> > > Ryan Daum
> > > rdaum@informiam.com <ma...@informiam.com>
> > > Senior Developer, Toronto
> > > 647.724.5232 x 2073
> >
> >
>
>
> --
> Ryan Daum
> rdaum@informiam.com
> Senior Developer, Toronto
> 647.724.5232 x 2073
>



-- 
Ryan Daum
rdaum@informiam.com
Senior Developer, Toronto
647.724.5232 x 2073

Re: Question re: StatusCommandTckTest

Posted by Ryan Daum <rd...@informiam.com>.
On 4/12/07, Emmanuel Venisse <em...@venisse.net> wrote:
>
> If it ignore the addition, it doesn't generate an error, right?
> So the result of the add command should return true.


Actually the code in addToWorkingTree expects that for this addition there
should be one file added.

Wouldn't a better place for the "isAllowEmptyDirectoryAdd" be on the
AbstractScmProvider?

Ryan


But we can add a "isAllowToAddEmptyDirectory()" method in the AddCommand and
> use it in ScmTestCase
>
> Emmanuel
>
> Ryan Daum a écrit :
> > Many revision control systems (Mercurial included) ignore the addition
> > of empty directories to a repository. But the following code in
> > StatusCommandTckTest requires that the SCM provider "pretend" to have
> > added the directory:
> >
> >         // /src/test/java/org
> >         ScmTestCase.makeDirectory( getUpdatingCopy(),
> > "/src/test/java/org" );
> >
> >         addToWorkingTree( getUpdatingCopy(), new File(
> > "src/test/java/org" ), repository );
> >
> > I can write some fairly elaborate code to have mercurial-provider-hg
> > "lie" about the addition, but I am worried about potential side effects
> > here.
> >
> > Is it really the intention of maven-scm to enforce this behaviour, or
> > can we have a per-SCM-provider configuration which declares whether to
> > test this behaviour?
> >
> > Thanks, Ryan
> >
> > --
> > Ryan Daum
> > rdaum@informiam.com <ma...@informiam.com>
> > Senior Developer, Toronto
> > 647.724.5232 x 2073
>
>


-- 
Ryan Daum
rdaum@informiam.com
Senior Developer, Toronto
647.724.5232 x 2073

Re: Question re: StatusCommandTckTest

Posted by Emmanuel Venisse <em...@venisse.net>.
If it ignore the addition, it doesn't generate an error, right?
So the result of the add command should return true.

But we can add a "isAllowToAddEmptyDirectory()" method in the AddCommand and use it in ScmTestCase

Emmanuel

Ryan Daum a écrit :
> Many revision control systems (Mercurial included) ignore the addition 
> of empty directories to a repository. But the following code in 
> StatusCommandTckTest requires that the SCM provider "pretend" to have 
> added the directory:
> 
>         // /src/test/java/org
>         ScmTestCase.makeDirectory( getUpdatingCopy(), 
> "/src/test/java/org" );
> 
>         addToWorkingTree( getUpdatingCopy(), new File( 
> "src/test/java/org" ), repository );
> 
> I can write some fairly elaborate code to have mercurial-provider-hg 
> "lie" about the addition, but I am worried about potential side effects 
> here.
> 
> Is it really the intention of maven-scm to enforce this behaviour, or 
> can we have a per-SCM-provider configuration which declares whether to 
> test this behaviour?
> 
> Thanks, Ryan
> 
> -- 
> Ryan Daum
> rdaum@informiam.com <ma...@informiam.com>
> Senior Developer, Toronto
> 647.724.5232 x 2073