Re: Using ignore file extensions on post-review

2008-11-12 Thread Chris Clark

Russell Bryant wrote:
> On Wed, Nov 5, 2008 at 6:54 AM, Dave Hocker <[EMAIL PROTECTED] 
> > wrote:
>
>
> You can use the Perforce "p4 files" command to determine if Perforce
> thinks the file is text or binary. The last token of the output will
> be something like (text) or (binary+l). Note that for a binary file
> the character after the + is the letter L in lower case. We've had
> this issue and I plan to modify our post-review script to make this
> check.
>
>
> You could do something with subversion, as well, by checking the 
> "svn:mime-type" property on files to see if they are text/plain or not.

Subversion won't try and diff binary files so there should be no need to 
put this logic in post-review. Where "should" maybe famous last words, 
I'm not using subversion with reviewboard so I've not actually sat down 
and tested this.

Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-05 Thread Russell Bryant
On Wed, Nov 5, 2008 at 6:54 AM, Dave Hocker <[EMAIL PROTECTED]> wrote:

>
> You can use the Perforce "p4 files" command to determine if Perforce
> thinks the file is text or binary. The last token of the output will
> be something like (text) or (binary+l). Note that for a binary file
> the character after the + is the letter L in lower case. We've had
> this issue and I plan to modify our post-review script to make this
> check.
>

You could do something with subversion, as well, by checking the
"svn:mime-type" property on files to see if they are text/plain or not.

--
Russell Bryant

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-05 Thread Dave Hocker

You can use the Perforce "p4 files" command to determine if Perforce
thinks the file is text or binary. The last token of the output will
be something like (text) or (binary+l). Note that for a binary file
the character after the + is the letter L in lower case. We've had
this issue and I plan to modify our post-review script to make this
check.

On Oct 8, 6:20 pm, Chris Clark <[EMAIL PROTECTED]> wrote:
> On 10/8/2008 1:38 AM, Marcos wrote:
>
> > I am using Perforce.
> > The error is with tga files.
>
> I'm not a Perforce user so dumb question coming.
>
> Does Perforce have the concept of binary files? Can this information be
> picked up from Perforce (I notice a describe is done before the diffs
> are started)? This would be more robust as you wouldn't have to maintain
> a list of binary extensions.
>
> Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-05 Thread Marcos

It seems some already answered you, thanks Russel.

On Nov 4, 9:14 pm, 13Strider <[EMAIL PROTECTED]> wrote:
> I got it thanks, i put it right before Diff
>
> On Nov 4, 2:14 pm, 13Strider <[EMAIL PROTECTED]> wrote:
>
> > Thanks Russell,
> > Now if i know where to put it i'll be set, im going to try to find it
>
> > Thanks again
>
> > On Nov 4, 2:07 pm, "Russell Bryant" <[EMAIL PROTECTED]> wrote:
>
> > > On Tue, Nov 4, 2008 at 9:16 AM, 13Strider <[EMAIL PROTECTED]> wrote:
>
> > > > hey , thanks for the code you but out
> > > > but i cant seem to make it work it keeps telling me ignore_extensions
> > > > is not defined
> > > > do i have to define it else where, and can you tell me what line did
> > > > you but this in?
>
> > > Based on the code below, you would define ignore_extensions like this:
>
> > > # Make a list of extensions to ignore ...
> > > ignore_extensions = [ ".bin", ".jpg", ".mp3" ]
>
> > > You could put it with the quoted code, or just at the top of the file
> > > somewhere.
>
> > > I don't know where the code below was inserted, though; I haven't looked.
> > > :)
>
> > > >             ignore_extension_found = False
> > > > >             for extension in ignore_extensions:
> > > > >                 find_return = depot_path.find(extension)
> > > > >                 if find_return != -1:
> > > > >                     debug("Ignored file %s" % depot_path)
> > > > >                     ignore_extension_found = True
> > > > >                     break
> > > > >             if ignore_extension_found:
> > > > >                 continue
>
> > > --
> > > Russell Bryant
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-04 Thread 13Strider

I got it thanks, i put it right before Diff

On Nov 4, 2:14 pm, 13Strider <[EMAIL PROTECTED]> wrote:
> Thanks Russell,
> Now if i know where to put it i'll be set, im going to try to find it
>
> Thanks again
>
> On Nov 4, 2:07 pm, "Russell Bryant" <[EMAIL PROTECTED]> wrote:
>
> > On Tue, Nov 4, 2008 at 9:16 AM, 13Strider <[EMAIL PROTECTED]> wrote:
>
> > > hey , thanks for the code you but out
> > > but i cant seem to make it work it keeps telling me ignore_extensions
> > > is not defined
> > > do i have to define it else where, and can you tell me what line did
> > > you but this in?
>
> > Based on the code below, you would define ignore_extensions like this:
>
> > # Make a list of extensions to ignore ...
> > ignore_extensions = [ ".bin", ".jpg", ".mp3" ]
>
> > You could put it with the quoted code, or just at the top of the file
> > somewhere.
>
> > I don't know where the code below was inserted, though; I haven't looked.
> > :)
>
> > >             ignore_extension_found = False
> > > >             for extension in ignore_extensions:
> > > >                 find_return = depot_path.find(extension)
> > > >                 if find_return != -1:
> > > >                     debug("Ignored file %s" % depot_path)
> > > >                     ignore_extension_found = True
> > > >                     break
> > > >             if ignore_extension_found:
> > > >                 continue
>
> > --
> > Russell Bryant
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-04 Thread 13Strider

Thanks Russell,
Now if i know where to put it i'll be set, im going to try to find it

Thanks again

On Nov 4, 2:07 pm, "Russell Bryant" <[EMAIL PROTECTED]> wrote:
> On Tue, Nov 4, 2008 at 9:16 AM, 13Strider <[EMAIL PROTECTED]> wrote:
>
> > hey , thanks for the code you but out
> > but i cant seem to make it work it keeps telling me ignore_extensions
> > is not defined
> > do i have to define it else where, and can you tell me what line did
> > you but this in?
>
> Based on the code below, you would define ignore_extensions like this:
>
> # Make a list of extensions to ignore ...
> ignore_extensions = [ ".bin", ".jpg", ".mp3" ]
>
> You could put it with the quoted code, or just at the top of the file
> somewhere.
>
> I don't know where the code below was inserted, though; I haven't looked.
> :)
>
> >             ignore_extension_found = False
> > >             for extension in ignore_extensions:
> > >                 find_return = depot_path.find(extension)
> > >                 if find_return != -1:
> > >                     debug("Ignored file %s" % depot_path)
> > >                     ignore_extension_found = True
> > >                     break
> > >             if ignore_extension_found:
> > >                 continue
>
> --
> Russell Bryant
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-04 Thread Russell Bryant
On Tue, Nov 4, 2008 at 9:16 AM, 13Strider <[EMAIL PROTECTED]> wrote:

>
> hey , thanks for the code you but out
> but i cant seem to make it work it keeps telling me ignore_extensions
> is not defined
> do i have to define it else where, and can you tell me what line did
> you but this in?


Based on the code below, you would define ignore_extensions like this:

# Make a list of extensions to ignore ...
ignore_extensions = [ ".bin", ".jpg", ".mp3" ]

You could put it with the quoted code, or just at the top of the file
somewhere.

I don't know where the code below was inserted, though; I haven't looked.
:)

> ignore_extension_found = False
> > for extension in ignore_extensions:
> > find_return = depot_path.find(extension)
> > if find_return != -1:
> > debug("Ignored file %s" % depot_path)
> > ignore_extension_found = True
> > break
> > if ignore_extension_found:
> > continue
>

--
Russell Bryant

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-11-04 Thread 13Strider

hey , thanks for the code you but out
but i cant seem to make it work it keeps telling me ignore_extensions
is not defined
do i have to define it else where, and can you tell me what line did
you but this in?

Thanks

On Oct 7, 11:24 am, Marcos <[EMAIL PROTECTED]> wrote:
> Post-review does not seem to like diffs in binary files, I was
> wondering why even try do diff them.
> So I did some changes on post-review to use a ignore_extensions.
> So before processing a file, I did this:
>
>             ignore_extension_found = False
>             for extension in ignore_extensions:
>                 find_return = depot_path.find(extension)
>                 if find_return != -1:
>                     debug("Ignored file %s" % depot_path)
>                     ignore_extension_found = True
>                     break
>             if ignore_extension_found:
>                 continue
>
> Just thought on posting it here, in case someone else needs it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-10-08 Thread Chris Clark

On 10/8/2008 1:38 AM, Marcos wrote:
> I am using Perforce.
> The error is with tga files.
>   

I'm not a Perforce user so dumb question coming.

Does Perforce have the concept of binary files? Can this information be 
picked up from Perforce (I notice a describe is done before the diffs 
are started)? This would be more robust as you wouldn't have to maintain 
a list of binary extensions.

Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-10-08 Thread Marcos

I am using Perforce.
The error is with tga files.

Here goes the

>>> diff -urNp c:\docume~1\marcosp\locals~1\temp\tmpixwwab 
>>> c:\docume~1\marcosp\locals~1\temp\tmpsanrqb
Traceback (most recent call last):
  File "C:\project\branches\post-review.py", line 1601, in ?
main(sys.argv[1:])
  File "C:\project\branches\post-review.py", line 1572, in main
diff, parent_diff = tool.diff(args)
  File "C:\project\branches\post-review.py", line 935, in diff
m = re.search(r'(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)', dl[1])
IndexError: list index out of range:


On Oct 7, 8:35 pm, Chris Clark <[EMAIL PROTECTED]> wrote:
> On 10/7/2008 8:24 AM, Marcos wrote:
>
>
>
> > Post-review does not seem to like diffs in binary files, I was
> > wondering why even try do diff them.
> > So I did some changes on post-review to use a ignore_extensions.
> > So before processing a file, I did this:
>
> >             ignore_extension_found = False
> >             for extension in ignore_extensions:
> >                 find_return = depot_path.find(extension)
> >                 if find_return != -1:
> >                     debug("Ignored file %s" % depot_path)
> >                     ignore_extension_found = True
> >                     break
> >             if ignore_extension_found:
> >                 continue
>
> > Just thought on posting it here, in case someone else needs it.
>
> Could you post the error(s) you get without the change? I'm successfully
> using post review with binary files (in that they are marked as binary
> and they are not diff'd in the diffviewer). I suspect it depends on the
> SCM in use.
>
> Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Re: Using ignore file extensions on post-review

2008-10-07 Thread Chris Clark

On 10/7/2008 8:24 AM, Marcos wrote:
> Post-review does not seem to like diffs in binary files, I was
> wondering why even try do diff them.
> So I did some changes on post-review to use a ignore_extensions.
> So before processing a file, I did this:
>
> ignore_extension_found = False
> for extension in ignore_extensions:
> find_return = depot_path.find(extension)
> if find_return != -1:
> debug("Ignored file %s" % depot_path)
> ignore_extension_found = True
> break
> if ignore_extension_found:
> continue
>
> Just thought on posting it here, in case someone else needs it.
>   

Could you post the error(s) you get without the change? I'm successfully 
using post review with binary files (in that they are marked as binary 
and they are not diff'd in the diffviewer). I suspect it depends on the 
SCM in use.

Chris


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Using ignore file extensions on post-review

2008-10-07 Thread Marcos

Post-review does not seem to like diffs in binary files, I was
wondering why even try do diff them.
So I did some changes on post-review to use a ignore_extensions.
So before processing a file, I did this:

ignore_extension_found = False
for extension in ignore_extensions:
find_return = depot_path.find(extension)
if find_return != -1:
debug("Ignored file %s" % depot_path)
ignore_extension_found = True
break
if ignore_extension_found:
continue

Just thought on posting it here, in case someone else needs it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---



Using ignore file extensions on post-review

2008-10-07 Thread Marcos

Post-review does not seem to like diffs in binary files, I was
wondering why even try do diff them.

So I did some changes on post-review to use a ignore_extensions.

So before processing a file, I did this:

ignore_extension_found = False
for extension in ignore_extensions:
find_return = depot_path.find(extension)
if find_return:
debug("Ignored file %s" % depot_path)
ignore_extension_found = True
break
if ignore_extension_found:
continue

Just thought on posting it here, in case someone else needs it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To post to this group, send email to reviewboard@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
-~--~~~~--~~--~--~---