Question re: StatusCommandTckTest

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Question re: StatusCommandTckTest

Ryan Daum-2
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
[hidden email]
Senior Developer, Toronto
647.724.5232 x 2073
Reply | Threaded
Open this post in threaded view
|

Re: Question re: StatusCommandTckTest

Emmanuel Venisse-2
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
> [hidden email] <mailto:[hidden email]>
> Senior Developer, Toronto
> 647.724.5232 x 2073

Reply | Threaded
Open this post in threaded view
|

Re: Question re: StatusCommandTckTest

Ryan Daum-2


On 4/12/07, Emmanuel Venisse <[hidden email]> 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
> [hidden email] <mailto:[hidden email]>
> Senior Developer, Toronto
> 647.724.5232 x 2073




--
Ryan Daum
[hidden email]
Senior Developer, Toronto
647.724.5232 x 2073
Reply | Threaded
Open this post in threaded view
|

Re: Question re: StatusCommandTckTest

Ryan Daum-2
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 <[hidden email]> wrote:


On 4/12/07, Emmanuel Venisse <[hidden email]> 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
> [hidden email] <mailto:[hidden email]>
> Senior Developer, Toronto
> 647.724.5232 x 2073




--
Ryan Daum
[hidden email]
Senior Developer, Toronto
647.724.5232 x 2073



--
Ryan Daum
[hidden email]
Senior Developer, Toronto
647.724.5232 x 2073
Reply | Threaded
Open this post in threaded view
|

Re: Question re: StatusCommandTckTest

Emmanuel Venisse-2
In reply to this post by Ryan Daum-2


Ryan Daum a écrit :

>
>
> On 4/12/07, *Emmanuel Venisse* <[hidden email]
> <mailto:[hidden email]>> 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
>      > [hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>
>      > Senior Developer, Toronto
>      > 647.724.5232 x 2073
>
>
>
>
> --
> Ryan Daum
> [hidden email] <mailto:[hidden email]>
> Senior Developer, Toronto
> 647.724.5232 x 2073

Reply | Threaded
Open this post in threaded view
|

Re: Re: Question re: StatusCommandTckTest

Emmanuel Venisse-2
In reply to this post by Ryan Daum-2
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* <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>
>     On 4/12/07, *Emmanuel Venisse* < [hidden email]
>     <mailto:[hidden email]>> 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
>         >  [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         >  Senior Developer, Toronto
>         >  647.724.5232 x 2073
>
>
>
>
>     --
>     Ryan Daum
>     [hidden email] <mailto:[hidden email]>
>     Senior Developer, Toronto
>     647.724.5232 x 2073
>
>
>
>
> --
> Ryan Daum
> [hidden email] <mailto:[hidden email]>
> Senior Developer, Toronto
> 647.724.5232 x 2073

Reply | Threaded
Open this post in threaded view
|

Re: Re: Question re: StatusCommandTckTest

Ryan Daum-2
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 <[hidden email]> 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* < [hidden email]
> <mailto:[hidden email]>> wrote:
>
>
>
>     On 4/12/07, *Emmanuel Venisse* < [hidden email]
>     <mailto:[hidden email]>> 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
>         >  [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         >  Senior Developer, Toronto
>         >  647.724.5232 x 2073
>
>
>
>
>     --
>     Ryan Daum
>     [hidden email] <mailto:[hidden email]>
>     Senior Developer, Toronto
>     647.724.5232 x 2073
>
>
>
>
> --
> Ryan Daum
> [hidden email] <mailto:[hidden email]>
> Senior Developer, Toronto
> 647.724.5232 x 2073




--
Ryan Daum
[hidden email]
Senior Developer, Toronto
647.724.5232 x 2073