Change set fileout

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Change set fileout

Gary Chambers-4
Has anyone else noticed that, very recently, when filing out change sets from the change sorter the filename is rather odd
(at least on Windows)?
 
 
Instead of the expected "OngoingFixes.2.cs" I'm getting
"C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"
 
saved where expected (in Contents\Resources).

Regards, Gary

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Change set fileout

Stéphane Ducasse
Yes I integrated a "fix" of eliot so that you can fileout category containing / but this is not a so great idea. :)

http://code.google.com/p/pharo/issues/detail?id=2661


writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml

       | extension converter f fileName |
       aStream contents isAsciiString ifTrue: [
               stOrCsFlag ifTrue: [
                       extension := (FileDirectory dot, FileStream st).
               ] ifFalse: [
                       extension := (FileDirectory dot, FileStream cs).
               ].
               converter := MacRomanTextConverter new.
       ] ifFalse: [
               stOrCsFlag ifTrue: [
                       extension := (FileDirectory dot, FileStream st "multiSt").
               ] ifFalse: [
                       extension := (FileDirectory dot, FileStream cs "multiCs").
               ].
               converter := UTF8TextConverter new.
       ].
       fileName := useHtml ifTrue: [baseName, '.html'] ifFalse: [baseName, extension].
+       fileName := FileDirectory default checkName: fileName fixErrors: true.
       f := FileStream newFileNamed: fileName.
       f ifNil: [^ self error: 'Cannot open file'].
       (converter isMemberOf: UTF8TextConverter)
               ifTrue: [f binary.
                       UTF8TextConverter writeBOMOn: f].
       f text.
       f converter: converter.
       f nextPutAll: aStream contents.
       f close.
 !


checkName: aFileName fixErrors: fixing
+       "Check if the file name contains any invalid characters"
+       | fName |
+       fName := super checkName: aFileName fixErrors: fixing.
+       (fName includes: self class pathNameDelimiter) ifFalse:
+               [^fName].
+       ^fixing
+               ifTrue: [fName copyReplaceAll: (String with: self class pathNameDelimiter) with: '#']
+               ifFalse: [self error:'Invalid file name']




Stef

On Aug 10, 2010, at 4:23 PM, Gary Chambers wrote:

> Has anyone else noticed that, very recently, when filing out change sets from the change sorter the filename is rather odd
> (at least on Windows)?
>  
>  
> Instead of the expected "OngoingFixes.2.cs" I'm getting
> "C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"
>  
> saved where expected (in Contents\Resources).
>
> Regards, Gary
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Change set fileout

Stéphane Ducasse
In reply to this post by Gary Chambers-4
http://code.google.com/p/pharo/issues/list?thanks=2779


>
> Instead of the expected "OngoingFixes.2.cs" I'm getting
> "C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Change set fileout

Eliot Miranda-2
In reply to this post by Stéphane Ducasse


On Tue, Aug 10, 2010 at 11:32 AM, Stéphane Ducasse <[hidden email]> wrote:
Yes I integrated a "fix" of eliot so that you can fileout category containing / but this is not a so great idea. :)

It's not such a bad idea.  Try filing-out a category that contains / (e.g. fileIn/out :) ) without it.  But you need to fix other places as well.  Andreas fixed this yesterday in trunk by not passing the full path to checkName:fixErrors:.  This isn't necessary.  One only needs the local name since "FileStream newFileNamed: fileName" will construct a file in the current directory.


http://code.google.com/p/pharo/issues/detail?id=2661


writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml

      | extension converter f fileName |
      aStream contents isAsciiString ifTrue: [
              stOrCsFlag ifTrue: [
                      extension := (FileDirectory dot, FileStream st).
              ] ifFalse: [
                      extension := (FileDirectory dot, FileStream cs).
              ].
              converter := MacRomanTextConverter new.
      ] ifFalse: [
              stOrCsFlag ifTrue: [
                      extension := (FileDirectory dot, FileStream st "multiSt").
              ] ifFalse: [
                      extension := (FileDirectory dot, FileStream cs "multiCs").
              ].
              converter := UTF8TextConverter new.
      ].
      fileName := useHtml ifTrue: [baseName, '.html'] ifFalse: [baseName, extension].
+       fileName := FileDirectory default checkName: fileName fixErrors: true.
      f := FileStream newFileNamed: fileName.
      f ifNil: [^ self error: 'Cannot open file'].
      (converter isMemberOf: UTF8TextConverter)
              ifTrue: [f binary.
                      UTF8TextConverter writeBOMOn: f].
      f text.
      f converter: converter.
      f nextPutAll: aStream contents.
      f close.
 !


checkName: aFileName fixErrors: fixing
+       "Check if the file name contains any invalid characters"
+       | fName |
+       fName := super checkName: aFileName fixErrors: fixing.
+       (fName includes: self class pathNameDelimiter) ifFalse:
+               [^fName].
+       ^fixing
+               ifTrue: [fName copyReplaceAll: (String with: self class pathNameDelimiter) with: '#']
+               ifFalse: [self error:'Invalid file name']




Stef

On Aug 10, 2010, at 4:23 PM, Gary Chambers wrote:

> Has anyone else noticed that, very recently, when filing out change sets from the change sorter the filename is rather odd
> (at least on Windows)?
>
>
> Instead of the expected "OngoingFixes.2.cs" I'm getting
> "C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"
>
> saved where expected (in Contents\Resources).
>
> Regards, Gary
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Change set fileout

Stéphane Ducasse
The bad idea was for me to integrate it and not fix it after I realized the problem.
Thanks.
I was planning to do the same. but now I'm exhausted. ;(

Stef


On Aug 10, 2010, at 8:38 PM, Eliot Miranda wrote:

>
>
> On Tue, Aug 10, 2010 at 11:32 AM, Stéphane Ducasse <[hidden email]> wrote:
> Yes I integrated a "fix" of eliot so that you can fileout category containing / but this is not a so great idea. :)
>
> It's not such a bad idea.  Try filing-out a category that contains / (e.g. fileIn/out :) ) without it.  But you need to fix other places as well.  Andreas fixed this yesterday in trunk by not passing the full path to checkName:fixErrors:.  This isn't necessary.  One only needs the local name since "FileStream newFileNamed: fileName" will construct a file in the current directory.
>
>
> http://code.google.com/p/pharo/issues/detail?id=2661
>
>
> writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml
>
>       | extension converter f fileName |
>       aStream contents isAsciiString ifTrue: [
>               stOrCsFlag ifTrue: [
>                       extension := (FileDirectory dot, FileStream st).
>               ] ifFalse: [
>                       extension := (FileDirectory dot, FileStream cs).
>               ].
>               converter := MacRomanTextConverter new.
>       ] ifFalse: [
>               stOrCsFlag ifTrue: [
>                       extension := (FileDirectory dot, FileStream st "multiSt").
>               ] ifFalse: [
>                       extension := (FileDirectory dot, FileStream cs "multiCs").
>               ].
>               converter := UTF8TextConverter new.
>       ].
>       fileName := useHtml ifTrue: [baseName, '.html'] ifFalse: [baseName, extension].
> +       fileName := FileDirectory default checkName: fileName fixErrors: true.
>       f := FileStream newFileNamed: fileName.
>       f ifNil: [^ self error: 'Cannot open file'].
>       (converter isMemberOf: UTF8TextConverter)
>               ifTrue: [f binary.
>                       UTF8TextConverter writeBOMOn: f].
>       f text.
>       f converter: converter.
>       f nextPutAll: aStream contents.
>       f close.
>  !
>
>
> checkName: aFileName fixErrors: fixing
> +       "Check if the file name contains any invalid characters"
> +       | fName |
> +       fName := super checkName: aFileName fixErrors: fixing.
> +       (fName includes: self class pathNameDelimiter) ifFalse:
> +               [^fName].
> +       ^fixing
> +               ifTrue: [fName copyReplaceAll: (String with: self class pathNameDelimiter) with: '#']
> +               ifFalse: [self error:'Invalid file name']
>
>
>
>
> Stef
>
> On Aug 10, 2010, at 4:23 PM, Gary Chambers wrote:
>
> > Has anyone else noticed that, very recently, when filing out change sets from the change sorter the filename is rather odd
> > (at least on Windows)?
> >
> >
> > Instead of the expected "OngoingFixes.2.cs" I'm getting
> > "C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"
> >
> > saved where expected (in Contents\Resources).
> >
> > Regards, Gary
> > _______________________________________________
> > Pharo-project mailing list
> > [hidden email]
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Change set fileout

Alexandre Bergel
> The bad idea was for me to integrate it and not fix it after I realized the problem.
> Thanks.
> I was planning to do the same. but now I'm exhausted. ;(

Stef, this kind of glitches are normal.
No worry.

Cheers,
Alexandre

>
>
> On Aug 10, 2010, at 8:38 PM, Eliot Miranda wrote:
>
>>
>>
>> On Tue, Aug 10, 2010 at 11:32 AM, Stéphane Ducasse <[hidden email]> wrote:
>> Yes I integrated a "fix" of eliot so that you can fileout category containing / but this is not a so great idea. :)
>>
>> It's not such a bad idea.  Try filing-out a category that contains / (e.g. fileIn/out :) ) without it.  But you need to fix other places as well.  Andreas fixed this yesterday in trunk by not passing the full path to checkName:fixErrors:.  This isn't necessary.  One only needs the local name since "FileStream newFileNamed: fileName" will construct a file in the current directory.
>>
>>
>> http://code.google.com/p/pharo/issues/detail?id=2661
>>
>>
>> writeSourceCodeFrom: aStream baseName: baseName isSt: stOrCsFlag useHtml: useHtml
>>
>>      | extension converter f fileName |
>>      aStream contents isAsciiString ifTrue: [
>>              stOrCsFlag ifTrue: [
>>                      extension := (FileDirectory dot, FileStream st).
>>              ] ifFalse: [
>>                      extension := (FileDirectory dot, FileStream cs).
>>              ].
>>              converter := MacRomanTextConverter new.
>>      ] ifFalse: [
>>              stOrCsFlag ifTrue: [
>>                      extension := (FileDirectory dot, FileStream st "multiSt").
>>              ] ifFalse: [
>>                      extension := (FileDirectory dot, FileStream cs "multiCs").
>>              ].
>>              converter := UTF8TextConverter new.
>>      ].
>>      fileName := useHtml ifTrue: [baseName, '.html'] ifFalse: [baseName, extension].
>> +       fileName := FileDirectory default checkName: fileName fixErrors: true.
>>      f := FileStream newFileNamed: fileName.
>>      f ifNil: [^ self error: 'Cannot open file'].
>>      (converter isMemberOf: UTF8TextConverter)
>>              ifTrue: [f binary.
>>                      UTF8TextConverter writeBOMOn: f].
>>      f text.
>>      f converter: converter.
>>      f nextPutAll: aStream contents.
>>      f close.
>> !
>>
>>
>> checkName: aFileName fixErrors: fixing
>> +       "Check if the file name contains any invalid characters"
>> +       | fName |
>> +       fName := super checkName: aFileName fixErrors: fixing.
>> +       (fName includes: self class pathNameDelimiter) ifFalse:
>> +               [^fName].
>> +       ^fixing
>> +               ifTrue: [fName copyReplaceAll: (String with: self class pathNameDelimiter) with: '#']
>> +               ifFalse: [self error:'Invalid file name']
>>
>>
>>
>>
>> Stef
>>
>> On Aug 10, 2010, at 4:23 PM, Gary Chambers wrote:
>>
>>> Has anyone else noticed that, very recently, when filing out change sets from the change sorter the filename is rather odd
>>> (at least on Windows)?
>>>
>>>
>>> Instead of the expected "OngoingFixes.2.cs" I'm getting
>>> "C##Users#Gazza#Desktop#Pharo#Contents#Resources#OngoingFixes.2.cs"
>>>
>>> saved where expected (in Contents\Resources).
>>>
>>> Regards, Gary
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project