You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Madan U Sreenivasan <ma...@collab.net> on 2005/11/03 06:20:53 UTC
[PATCH] Issue #2419: 'svn rm' of schedule add leaves working props
file
Hi,
Pl. find attached a patch for issue #2419.
Regards,
Madan.
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Madan U Sreenivasan <ma...@collab.net>.
On Fri, 2005-11-04 at 02:20, Philip Martin wrote:
> Madan U Sreenivasan <ma...@collab.net> writes:
>
> > +#----------------------------------------------------------------------
> > +def removal_schedule_added_props(sbox):
> > + "removal of schedule added file with properties"
> > +
> > + sbox.build()
> > +
> > + wc_dir = sbox.wc_dir
> > + newfile_path = os.path.join(wc_dir, 'newfile')
> >
> > + # create new fs file
> > + touch_command = "touch " + newfile_path
> > + os.system(touch_command)
>
> Don't use os.system, use file_append.
>
> > + svntest.main.run_svn(None, 'add', newfile_path)
>
> Please try to avoid run_svn, run_and_verify_svn is better.
>
> > + svntest.main.run_svn(None, 'propset', 'newprop', 'newvalue', newfile_path)
>
> It would be good to run a proplist command to verify that the property
> has been set successfully. Perhaps use run_and_verify_status as well.
Okay, as I understand, the test has to be more robust, in terms of
checking if the preconditions are created properly. I will have to
rewrite the test. Will do that.
Thanks for the review.
Regards,
Madan.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Philip Martin <ph...@codematters.co.uk>.
Madan U Sreenivasan <ma...@collab.net> writes:
> +#----------------------------------------------------------------------
> +def removal_schedule_added_props(sbox):
> + "removal of schedule added file with properties"
> +
> + sbox.build()
> +
> + wc_dir = sbox.wc_dir
> + newfile_path = os.path.join(wc_dir, 'newfile')
>
> + # create new fs file
> + touch_command = "touch " + newfile_path
> + os.system(touch_command)
Don't use os.system, use file_append.
> + svntest.main.run_svn(None, 'add', newfile_path)
Please try to avoid run_svn, run_and_verify_svn is better.
> + svntest.main.run_svn(None, 'propset', 'newprop', 'newvalue', newfile_path)
It would be good to run a proplist command to verify that the property
has been set successfully. Perhaps use run_and_verify_status as well.
> + svntest.main.run_svn(None, 'rm', '--force', newfile_path)
> + # recreate the file and add it again
> + os.system(touch_command)
> + svntest.main.run_svn(None, 'add', newfile_path)
> +
> + # check the properties
> + svntest.actions.run_and_verify_svn(None, [], [],
> + 'proplist', '-v', newfile_path)
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Madan U Sreenivasan <ma...@collab.net>.
On Fri, 2005-11-04 at 05:54, David James wrote:
> On 11/3/05, Branko Čibej <br...@xbc.nu> wrote:
> > Madan U Sreenivasan wrote:
> > > On Fri, 2005-11-04 at 02:25, Daniel Rall wrote:
> > >
> > >> On Fri, 04 Nov 2005, Madan S. wrote:
> > >>
> > >>
> > >>> On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
> > >>>
> > >>>> On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> > >>>>
> > >>>>> Hi,
> > >>>>> Pl. find attached a patch for issue #2419.
> > >>>>>
> > >>>> The fix seems reasonable to me, but the test should be written in pure
> > >>>> python, without shelling out to the "touch" command. It's not like
> > >>>> it's a lot of python code, and it makes things more portable (does
> > >>>> 'touch' even exist on windows?).
> > >>>>
> > >>> You are right... will change that...
> > >>>
> > >> The equivalent Python I usually use is to open a file for write, then
> > >> close it (or let Python close it for you).
> > >>
> > > I was thinking of os.mknod ... what do you think?
> > >
> > I think you need to read the Python docs more closely.
> >
> > For one thing, mknod is again unix-specific. For another, it requires
> > Python 2.3.
>
> Madan, here's how to create an empty file using Python:
> open("file.txt","w").close()
>
> Hope this helps!
Sure, it does, David. Thank you.
I was thinking of using main.file_append(), but your suggestion is
crispier and more apt for creating empty files. I will use this...
Thanks,
Madan.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working props file
Posted by David James <ja...@gmail.com>.
On 11/3/05, Branko Čibej <br...@xbc.nu> wrote:
> Madan U Sreenivasan wrote:
> > On Fri, 2005-11-04 at 02:25, Daniel Rall wrote:
> >
> >> On Fri, 04 Nov 2005, Madan S. wrote:
> >>
> >>
> >>> On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
> >>>
> >>>> On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> >>>>
> >>>>> Hi,
> >>>>> Pl. find attached a patch for issue #2419.
> >>>>>
> >>>> The fix seems reasonable to me, but the test should be written in pure
> >>>> python, without shelling out to the "touch" command. It's not like
> >>>> it's a lot of python code, and it makes things more portable (does
> >>>> 'touch' even exist on windows?).
> >>>>
> >>> You are right... will change that...
> >>>
> >> The equivalent Python I usually use is to open a file for write, then
> >> close it (or let Python close it for you).
> >>
> > I was thinking of os.mknod ... what do you think?
> >
> I think you need to read the Python docs more closely.
>
> For one thing, mknod is again unix-specific. For another, it requires
> Python 2.3.
Madan, here's how to create an empty file using Python:
open("file.txt","w").close()
Hope this helps!
David
--
David James -- http://www.cs.toronto.edu/~james
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Madan U Sreenivasan <ma...@collab.net>.
On Fri, 2005-11-04 at 05:53, Branko Čibej wrote:
> Madan U Sreenivasan wrote:
> > On Fri, 2005-11-04 at 02:25, Daniel Rall wrote:
> >
> >> On Fri, 04 Nov 2005, Madan S. wrote:
> >>
> >>
> >>> On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
> >>>
> >>>> On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> >>>>
> >>>>> Hi,
> >>>>> Pl. find attached a patch for issue #2419.
> >>>>>
> >>>> The fix seems reasonable to me, but the test should be written in pure
> >>>> python, without shelling out to the "touch" command. It's not like
> >>>> it's a lot of python code, and it makes things more portable (does
> >>>> 'touch' even exist on windows?).
> >>>>
> >>> You are right... will change that...
> >>>
> >> The equivalent Python I usually use is to open a file for write, then
> >> close it (or let Python close it for you).
> >>
> > I was thinking of os.mknod ... what do you think?
> >
> I think you need to read the Python docs more closely.
yeah, you are right. :)
> For one thing, mknod is again unix-specific. For another, it requires
> Python 2.3.
its unix specific? oh yes i-node and all that stuff, I should have
noticed... sorry. Thanks for pointing out.
Regards,
Madan.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Branko Čibej <br...@xbc.nu>.
Madan U Sreenivasan wrote:
> On Fri, 2005-11-04 at 02:25, Daniel Rall wrote:
>
>> On Fri, 04 Nov 2005, Madan S. wrote:
>>
>>
>>> On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
>>>
>>>> On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
>>>>
>>>>> Hi,
>>>>> Pl. find attached a patch for issue #2419.
>>>>>
>>>> The fix seems reasonable to me, but the test should be written in pure
>>>> python, without shelling out to the "touch" command. It's not like
>>>> it's a lot of python code, and it makes things more portable (does
>>>> 'touch' even exist on windows?).
>>>>
>>> You are right... will change that...
>>>
>> The equivalent Python I usually use is to open a file for write, then
>> close it (or let Python close it for you).
>>
> I was thinking of os.mknod ... what do you think?
>
I think you need to read the Python docs more closely.
For one thing, mknod is again unix-specific. For another, it requires
Python 2.3.
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Philip Martin <ph...@codematters.co.uk>.
Madan U Sreenivasan <ma...@collab.net> writes:
> On Fri, 2005-11-04 at 02:25, Daniel Rall wrote:
>>
>> The equivalent Python I usually use is to open a file for write, then
>> close it (or let Python close it for you).
> I was thinking of os.mknod ... what do you think?
Look at some of the other tests, use file_append.
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Madan U Sreenivasan <ma...@collab.net>.
On Fri, 2005-11-04 at 02:25, Daniel Rall wrote:
> On Fri, 04 Nov 2005, Madan S. wrote:
>
> > On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
> > > On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> > > > Hi,
> > > > Pl. find attached a patch for issue #2419.
> > >
> > > The fix seems reasonable to me, but the test should be written in pure
> > > python, without shelling out to the "touch" command. It's not like
> > > it's a lot of python code, and it makes things more portable (does
> > > 'touch' even exist on windows?).
> > You are right... will change that...
>
> The equivalent Python I usually use is to open a file for write, then
> close it (or let Python close it for you).
I was thinking of os.mknod ... what do you think?
Regards,
Madan.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working props file
Posted by Daniel Rall <dl...@collab.net>.
On Fri, 04 Nov 2005, Madan S. wrote:
> On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
> > On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> > > Hi,
> > > Pl. find attached a patch for issue #2419.
> >
> > The fix seems reasonable to me, but the test should be written in pure
> > python, without shelling out to the "touch" command. It's not like
> > it's a lot of python code, and it makes things more portable (does
> > 'touch' even exist on windows?).
> You are right... will change that...
The equivalent Python I usually use is to open a file for write, then
close it (or let Python close it for you).
--
Daniel Rall
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working
props file
Posted by Madan U Sreenivasan <ma...@collab.net>.
On Thu, 2005-11-03 at 23:58, Garrett Rooney wrote:
> On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> > Hi,
> > Pl. find attached a patch for issue #2419.
>
> The fix seems reasonable to me, but the test should be written in pure
> python, without shelling out to the "touch" command. It's not like
> it's a lot of python code, and it makes things more portable (does
> 'touch' even exist on windows?).
You are right... will change that...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] Issue #2419: 'svn rm' of schedule add leaves working props file
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 11/2/05, Madan U Sreenivasan <ma...@collab.net> wrote:
> Hi,
> Pl. find attached a patch for issue #2419.
The fix seems reasonable to me, but the test should be written in pure
python, without shelling out to the "touch" command. It's not like
it's a lot of python code, and it makes things more portable (does
'touch' even exist on windows?).
-garrett
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org