[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread Mohamed Mansour
Very nice, no longer I have to put crbug.com/#.  Whoever did that autolink,
can you support multiple bugs as well? The format bugdroid uses is BUG=1, 2,
3
- Mohamed Mansour


On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. wrote:

> I just noticed that BUG=1234 lines are autolinked to the correct bug when
> viewed in Rietveld (codereview.chromium.org). This is very useful, thanks!
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread John Abd-El-Malek
Thanks, glad you enjoy it :)
This was a side distraction to fix the annoying issue of having to manually
copying and pasting the bug ids.  It severely tested my regex-fu and since
the multiple bugs case should be rare, I'll hide behind the excuse that if
they're duplicates they should be marked as such and only end up with one,
and if they're different bugs there should be separate changelists ;)  The
rietveld change is at http://code.google.com/p/rietveld/source/detail?r=455,
if anyone sends me a patch to make it work with multiple bug ids, I'd be
happy to push it.

On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour  wrote:

> Very nice, no longer I have to put crbug.com/#.  Whoever did that
> autolink, can you support multiple bugs as well? The format bugdroid uses is
> BUG=1, 2, 3
> - Mohamed Mansour
>
>
>
> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. 
> wrote:
>
>> I just noticed that BUG=1234 lines are autolinked to the correct bug when
>> viewed in Rietveld (codereview.chromium.org). This is very useful,
>> thanks!
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread Jeremy Orlow
I don't have a rietveld dev environment set up, so I wrote a quick script to
test the general algorithm.  It's not as pythony as I'd like, but it seems
to be fairly robust:
#!/usr/bin/python
import re

description = """\
Blah blah blah.
Blaaa

TEST=none
BUG=123,456, 798,0
BUG=888
BUG=none
 BUG = none, 2349,2,asdf
BUG = http://crbug.com/123
BUG = crbug.com/234 crbug/82
"""

LINK = "%s"
def rewrite_bug_numbers(string):
  if ',' in string:
right, left = string.split(',', 1)
return rewrite_bug_numbers(right) + ',' + rewrite_bug_numbers(left)
  if ' ' in string:
right, left = string.split(' ', 1)
return rewrite_bug_numbers(right) + ' ' + rewrite_bug_numbers(left)

  # Base cases:
  if string.isdigit():
return LINK % (string, string)
  match = re.search(r'^(http://|)crbug.com/(\d+)', string)
  if match:
return LINK % (match.group(2), string)
  return string

output = []
for line in description.splitlines():
  match = re.search(r'^(\s*BUG\s*=)(.*)$', line)
  if match:
line = match.group(1) + rewrite_bug_numbers(match.group(2))
  output.append(line)
print "\n".join(output)



Prints out

Blah blah blah.
Blaaa

TEST=none
BUG=123,456, 798,0
BUG=888
BUG=none
 BUG = none, 2349,2,asdf
BUG = 
http://crbug.com/123
BUG = 
crbug.com/234 crbug/82


If we weren't concerned about preserving formatting, you could do it with
replace and split:

line = "1234, 23 , 2"
bugs = line.replace(",", " ").split()


But it's not t much more work to keep in all the formatting.


On Thu, Sep 10, 2009 at 11:01 AM, John Abd-El-Malek wrote:

> Thanks, glad you enjoy it :)
> This was a side distraction to fix the annoying issue of having to manually
> copying and pasting the bug ids.  It severely tested my regex-fu and since
> the multiple bugs case should be rare, I'll hide behind the excuse that if
> they're duplicates they should be marked as such and only end up with one,
> and if they're different bugs there should be separate changelists ;)  The
> rietveld change is at
> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends me
> a patch to make it work with multiple bug ids, I'd be happy to push it.
>
>
> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour  wrote:
>
>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>> autolink, can you support multiple bugs as well? The format bugdroid uses is
>> BUG=1, 2, 3
>> - Mohamed Mansour
>>
>>
>>
>> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. > > wrote:
>>
>>> I just noticed that BUG=1234 lines are autolinked to the correct bug when
>>> viewed in Rietveld (codereview.chromium.org). This is very useful,
>>> thanks!
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread Mohamed Mansour
How about just this:
def repl(m):
issues = m.group(1).split(', ')
return ", ".join("%s" % (s, s) for
s in issues)

if __name__ == '__main__':
description = "\nBUG=2, 3"
description = re.sub("\nBUG=(\d+[, \d+]*)", repl, description)
print description


Works great!

- Mohamed Mansour


On Wed, Sep 9, 2009 at 11:25 PM, Jeremy Orlow  wrote:

> I don't have a rietveld dev environment set up, so I wrote a quick script
> to test the general algorithm.  It's not as pythony as I'd like, but it
> seems to be fairly robust:
> #!/usr/bin/python
> import re
>
> description = """\
> Blah blah blah.
> Blaaa
>
> TEST=none
> BUG=123,456, 798,0
> BUG=888
> BUG=none
>  BUG = none, 2349,2,asdf
> BUG = http://crbug.com/123
> BUG = crbug.com/234 crbug/82
> """
>
> LINK = "%s"
> def rewrite_bug_numbers(string):
>   if ',' in string:
> right, left = string.split(',', 1)
> return rewrite_bug_numbers(right) + ',' + rewrite_bug_numbers(left)
>   if ' ' in string:
> right, left = string.split(' ', 1)
> return rewrite_bug_numbers(right) + ' ' + rewrite_bug_numbers(left)
>
>   # Base cases:
>   if string.isdigit():
> return LINK % (string, string)
>   match = re.search(r'^(http://|)crbug.com/(\d+)', string)
>   if match:
> return LINK % (match.group(2), string)
>   return string
>
> output = []
> for line in description.splitlines():
>   match = re.search(r'^(\s*BUG\s*=)(.*)$', line)
>   if match:
> line = match.group(1) + rewrite_bug_numbers(match.group(2))
>   output.append(line)
> print "\n".join(output)
>
>
>
> Prints out
>
> Blah blah blah.
> Blaaa
> 
> TEST=none
> BUG= href='http://code.google.com/p/chromium/issues/detail?id=123'>123, href='http://code.google.com/p/chromium/issues/detail?id=456'>456,  href='http://code.google.com/p/chromium/issues/detail?id=798'>798, href='http://code.google.com/p/chromium/issues/detail?id=0'>0
> BUG=888
> BUG=none
>   BUG = none, 2349, href='http://code.google.com/p/chromium/issues/detail?id=2'>2,asdf
> BUG = 
> http://crbug.com/123
> BUG = 
> crbug.com/234 crbug/82
>
>
> If we weren't concerned about preserving formatting, you could do it with
> replace and split:
>
> line = "1234, 23 , 2"
> bugs = line.replace(",", " ").split()
>
>
> But it's not t much more work to keep in all the formatting.
>
>
> On Thu, Sep 10, 2009 at 11:01 AM, John Abd-El-Malek wrote:
>
>> Thanks, glad you enjoy it :)
>> This was a side distraction to fix the annoying issue of having to
>> manually copying and pasting the bug ids.  It severely tested my regex-fu
>> and since the multiple bugs case should be rare, I'll hide behind the excuse
>> that if they're duplicates they should be marked as such and only end up
>> with one, and if they're different bugs there should be separate changelists
>> ;)  The rietveld change is at
>> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends me
>> a patch to make it work with multiple bug ids, I'd be happy to push it.
>>
>>
>> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour  wrote:
>>
>>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>>> autolink, can you support multiple bugs as well? The format bugdroid uses is
>>> BUG=1, 2, 3
>>> - Mohamed Mansour
>>>
>>>
>>>
>>> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
>>> phajdan...@chromium.org> wrote:
>>>
 I just noticed that BUG=1234 lines are autolinked to the correct bug
 when viewed in Rietveld (codereview.chromium.org). This is very useful,
 thanks!


>>>
>>>
>>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread Jeremy Orlow
Would be nice if it still handled http://crbug.com/ and crbug.com/ since
people probably will continue using them for a while.
Also split(', ') ONLY works for when you do 'blah, blah'.  Not 'blah,blah'.
 Not 'blah blah'.  Or any other crazy things people might do.

I didn't know that you could give re.sub a callback to format the replace
text though.  That's cool and could probably make my code simpler.

J


On Thu, Sep 10, 2009 at 12:27 PM, Mohamed Mansour  wrote:

> How about just this:
> def repl(m):
> issues = m.group(1).split(', ')
> return ", ".join("%s" % (s, s)
> for s in issues)
>
> if __name__ == '__main__':
> description = "\nBUG=2, 3"
> description = re.sub("\nBUG=(\d+[, \d+]*)", repl, description)
> print description
>
>
> Works great!
>
> - Mohamed Mansour
>
>
>
> On Wed, Sep 9, 2009 at 11:25 PM, Jeremy Orlow  wrote:
>
>> I don't have a rietveld dev environment set up, so I wrote a quick script
>> to test the general algorithm.  It's not as pythony as I'd like, but it
>> seems to be fairly robust:
>> #!/usr/bin/python
>> import re
>>
>> description = """\
>> Blah blah blah.
>> Blaaa
>>
>> TEST=none
>> BUG=123,456, 798,0
>> BUG=888
>> BUG=none
>>  BUG = none, 2349,2,asdf
>> BUG = http://crbug.com/123
>> BUG = crbug.com/234 crbug/82
>> """
>>
>> LINK = "%s"
>> def rewrite_bug_numbers(string):
>>   if ',' in string:
>> right, left = string.split(',', 1)
>> return rewrite_bug_numbers(right) + ',' + rewrite_bug_numbers(left)
>>   if ' ' in string:
>> right, left = string.split(' ', 1)
>> return rewrite_bug_numbers(right) + ' ' + rewrite_bug_numbers(left)
>>
>>   # Base cases:
>>   if string.isdigit():
>> return LINK % (string, string)
>>   match = re.search(r'^(http://|)crbug.com/(\d+)', string)
>>   if match:
>> return LINK % (match.group(2), string)
>>   return string
>>
>> output = []
>> for line in description.splitlines():
>>   match = re.search(r'^(\s*BUG\s*=)(.*)$', line)
>>   if match:
>> line = match.group(1) + rewrite_bug_numbers(match.group(2))
>>   output.append(line)
>> print "\n".join(output)
>>
>>
>>
>> Prints out
>>
>> Blah blah blah.
>> Blaaa
>> 
>> TEST=none
>> BUG=> href='http://code.google.com/p/chromium/issues/detail?id=123'>123,> href='http://code.google.com/p/chromium/issues/detail?id=456'>456, > href='http://code.google.com/p/chromium/issues/detail?id=798'>798,> href='http://code.google.com/p/chromium/issues/detail?id=0'>0
>> BUG=888
>> BUG=none
>>   BUG = none, 2349,> href='http://code.google.com/p/chromium/issues/detail?id=2
>> '>2,asdf
>> BUG = 
>> http://crbug.com/123
>> BUG = 
>> crbug.com/234 crbug/82
>>
>>
>> If we weren't concerned about preserving formatting, you could do it with
>> replace and split:
>>
>> line = "1234, 23 , 2"
>> bugs = line.replace(",", " ").split()
>>
>>
>> But it's not t much more work to keep in all the formatting.
>>
>>
>> On Thu, Sep 10, 2009 at 11:01 AM, John Abd-El-Malek wrote:
>>
>>> Thanks, glad you enjoy it :)
>>> This was a side distraction to fix the annoying issue of having to
>>> manually copying and pasting the bug ids.  It severely tested my regex-fu
>>> and since the multiple bugs case should be rare, I'll hide behind the excuse
>>> that if they're duplicates they should be marked as such and only end up
>>> with one, and if they're different bugs there should be separate changelists
>>> ;)  The rietveld change is at
>>> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends
>>> me a patch to make it work with multiple bug ids, I'd be happy to push it.
>>>
>>>
>>> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:
>>>
 Very nice, no longer I have to put crbug.com/#.  Whoever did that
 autolink, can you support multiple bugs as well? The format bugdroid uses 
 is
 BUG=1, 2, 3
 - Mohamed Mansour



 On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
 phajdan...@chromium.org> wrote:

> I just noticed that BUG=1234 lines are autolinked to the correct bug
> when viewed in Rietveld (codereview.chromium.org). This is very
> useful, thanks!
>
>



>>>
>>> >>>
>>>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread Mohamed Mansour
Then it would just be a simple regular expression:

> def repl(m):

issues = re.split('\,|\s', m.group(1))

return ", ".join("%s" % (s, s)
> for s in issues)


> if __name__ == '__main__':

description = "\nBUG=1,2, 3,4"

description = re.sub("\nBUG=(\d+[\,\s?\d+]*)", repl, description)

 print description


- Mohamed Mansour


On Wed, Sep 9, 2009 at 11:32 PM, Jeremy Orlow  wrote:

> Would be nice if it still handled http://crbug.com/ and crbug.com/ since
> people probably will continue using them for a while.
> Also split(', ') ONLY works for when you do 'blah, blah'.  Not 'blah,blah'.
>  Not 'blah blah'.  Or any other crazy things people might do.
>
> I didn't know that you could give re.sub a callback to format the replace
> text though.  That's cool and could probably make my code simpler.
>
> J
>
>
> On Thu, Sep 10, 2009 at 12:27 PM, Mohamed Mansour wrote:
>
>> How about just this:
>> def repl(m):
>> issues = m.group(1).split(', ')
>> return ", ".join("%s" % (s, s)
>> for s in issues)
>>
>> if __name__ == '__main__':
>> description = "\nBUG=2, 3"
>> description = re.sub("\nBUG=(\d+[, \d+]*)", repl, description)
>> print description
>>
>>
>> Works great!
>>
>> - Mohamed Mansour
>>
>>
>>
>> On Wed, Sep 9, 2009 at 11:25 PM, Jeremy Orlow wrote:
>>
>>> I don't have a rietveld dev environment set up, so I wrote a quick script
>>> to test the general algorithm.  It's not as pythony as I'd like, but it
>>> seems to be fairly robust:
>>> #!/usr/bin/python
>>> import re
>>>
>>> description = """\
>>> Blah blah blah.
>>> Blaaa
>>>
>>> TEST=none
>>> BUG=123,456, 798,0
>>> BUG=888
>>> BUG=none
>>>  BUG = none, 2349,2,asdf
>>> BUG = http://crbug.com/123
>>> BUG = crbug.com/234 crbug/82
>>> """
>>>
>>> LINK = "%s"
>>> def rewrite_bug_numbers(string):
>>>   if ',' in string:
>>> right, left = string.split(',', 1)
>>> return rewrite_bug_numbers(right) + ',' + rewrite_bug_numbers(left)
>>>   if ' ' in string:
>>> right, left = string.split(' ', 1)
>>> return rewrite_bug_numbers(right) + ' ' + rewrite_bug_numbers(left)
>>>
>>>   # Base cases:
>>>   if string.isdigit():
>>> return LINK % (string, string)
>>>   match = re.search(r'^(http://|)crbug.com/(\d+)', string)
>>>   if match:
>>> return LINK % (match.group(2), string)
>>>   return string
>>>
>>> output = []
>>> for line in description.splitlines():
>>>   match = re.search(r'^(\s*BUG\s*=)(.*)$', line)
>>>   if match:
>>> line = match.group(1) + rewrite_bug_numbers(match.group(2))
>>>   output.append(line)
>>> print "\n".join(output)
>>>
>>>
>>>
>>> Prints out
>>>
>>> Blah blah blah.
>>> Blaaa
>>> 
>>> TEST=none
>>> BUG=>> href='http://code.google.com/p/chromium/issues/detail?id=123'>123,>> href='http://code.google.com/p/chromium/issues/detail?id=456'>456,
>>> 798,>> href='http://code.google.com/p/chromium/issues/detail?id=0'>0
>>> BUG=888
>>> BUG=none
>>>   BUG = none, 2349,>> href='http://code.google.com/p/chromium/issues/detail?id=2
>>> '>2,asdf
>>> BUG = 
>>> http://crbug.com/123
>>> BUG = 
>>> crbug.com/234 crbug/82
>>>
>>>
>>> If we weren't concerned about preserving formatting, you could do it with
>>> replace and split:
>>>
>>> line = "1234, 23 , 2"
>>> bugs = line.replace(",", " ").split()
>>>
>>>
>>> But it's not t much more work to keep in all the formatting.
>>>
>>>
>>> On Thu, Sep 10, 2009 at 11:01 AM, John Abd-El-Malek 
>>> wrote:
>>>
 Thanks, glad you enjoy it :)
 This was a side distraction to fix the annoying issue of having to
 manually copying and pasting the bug ids.  It severely tested my regex-fu
 and since the multiple bugs case should be rare, I'll hide behind the 
 excuse
 that if they're duplicates they should be marked as such and only end up
 with one, and if they're different bugs there should be separate 
 changelists
 ;)  The rietveld change is at
 http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends
 me a patch to make it work with multiple bug ids, I'd be happy to push it.


 On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:

> Very nice, no longer I have to put crbug.com/#.  Whoever did that
> autolink, can you support multiple bugs as well? The format bugdroid uses 
> is
> BUG=1, 2, 3
> - Mohamed Mansour
>
>
>
> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
> phajdan...@chromium.org> wrote:
>
>> I just noticed that BUG=1234 lines are autolinked to the correct bug
>> when viewed in Rietveld (codereview.chromium.org). This is very
>> useful, thanks!
>>
>>
>
>
>

 

>>>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread Mohamed Mansour
Hmm I was looking at my code, and its flawed (the usage of brackets). This
one should work better:

import re


def replace_bug(m):

bugs = re.split(r"[\s,]+", m.group(1))

return ", ".join("%s" %
(i, i) for i in bugs if i != "")
bug_pattern = r"(?<=BUG=)(\s*\d+\s*(?:,\s*\d+\s*)*)"
result = re.sub(bug_pattern, replace_bug, "\nBUG=1 , 2, 3 ")
print result

 I submitted the patch to rietveld:
 http://codereview.appspot.com/115083

-- Mohamed Mansour


On Wed, Sep 9, 2009 at 11:44 PM, Mohamed Mansour  wrote:

> Then it would just be a simple regular expression:
>
>> def repl(m):
>
> issues = re.split('\,|\s', m.group(1))
>
> return ", ".join("%s" % (s, s)
>> for s in issues)
>
>
>> if __name__ == '__main__':
>
> description = "\nBUG=1,2, 3,4"
>
> description = re.sub("\nBUG=(\d+[\,\s?\d+]*)", repl, description)
>
>  print description
>
>
> - Mohamed Mansour
>
>
>
> On Wed, Sep 9, 2009 at 11:32 PM, Jeremy Orlow  wrote:
>
>> Would be nice if it still handled http://crbug.com/ and crbug.com/ since
>> people probably will continue using them for a while.
>> Also split(', ') ONLY works for when you do 'blah, blah'.  Not
>> 'blah,blah'.  Not 'blah blah'.  Or any other crazy things people might do.
>>
>> I didn't know that you could give re.sub a callback to format the replace
>> text though.  That's cool and could probably make my code simpler.
>>
>> J
>>
>>
>> On Thu, Sep 10, 2009 at 12:27 PM, Mohamed Mansour wrote:
>>
>>> How about just this:
>>> def repl(m):
>>> issues = m.group(1).split(', ')
>>> return ", ".join("%s" % (s, s)
>>> for s in issues)
>>>
>>> if __name__ == '__main__':
>>> description = "\nBUG=2, 3"
>>> description = re.sub("\nBUG=(\d+[, \d+]*)", repl, description)
>>> print description
>>>
>>>
>>> Works great!
>>>
>>> - Mohamed Mansour
>>>
>>>
>>>
>>> On Wed, Sep 9, 2009 at 11:25 PM, Jeremy Orlow wrote:
>>>
 I don't have a rietveld dev environment set up, so I wrote a quick
 script to test the general algorithm.  It's not as pythony as I'd like, but
 it seems to be fairly robust:
 #!/usr/bin/python
 import re

 description = """\
 Blah blah blah.
 Blaaa

 TEST=none
 BUG=123,456, 798,0
 BUG=888
 BUG=none
  BUG = none, 2349,2,asdf
 BUG = http://crbug.com/123
 BUG = crbug.com/234 crbug/82
 """

 LINK = "%s"
 def rewrite_bug_numbers(string):
   if ',' in string:
 right, left = string.split(',', 1)
 return rewrite_bug_numbers(right) + ',' + rewrite_bug_numbers(left)
   if ' ' in string:
 right, left = string.split(' ', 1)
 return rewrite_bug_numbers(right) + ' ' + rewrite_bug_numbers(left)

   # Base cases:
   if string.isdigit():
 return LINK % (string, string)
   match = re.search(r'^(http://|)crbug.com/(\d+)', string)
   if match:
 return LINK % (match.group(2), string)
   return string

 output = []
 for line in description.splitlines():
   match = re.search(r'^(\s*BUG\s*=)(.*)$', line)
   if match:
 line = match.group(1) + rewrite_bug_numbers(match.group(2))
   output.append(line)
 print "\n".join(output)



 Prints out

 Blah blah blah.
 Blaaa
 
 TEST=none
 BUG=>>> href='http://code.google.com/p/chromium/issues/detail?id=123'>123,>>> href='http://code.google.com/p/chromium/issues/detail?id=456'>456,
 798,>>> href='http://code.google.com/p/chromium/issues/detail?id=0'>0
 BUG=888
 BUG=none
   BUG = none, 2349,>>> href='http://code.google.com/p/chromium/issues/detail?id=2
 '>2,asdf
 BUG = 
 http://crbug.com/123
 BUG = 
 crbug.com/234 crbug/82


 If we weren't concerned about preserving formatting, you could do it
 with replace and split:

 line = "1234, 23 , 2"
 bugs = line.replace(",", " ").split()


 But it's not t much more work to keep in all the formatting.


 On Thu, Sep 10, 2009 at 11:01 AM, John Abd-El-Malek 
 wrote:

> Thanks, glad you enjoy it :)
> This was a side distraction to fix the annoying issue of having to
> manually copying and pasting the bug ids.  It severely tested my regex-fu
> and since the multiple bugs case should be rare, I'll hide behind the 
> excuse
> that if they're duplicates they should be marked as such and only end up
> with one, and if they're different bugs there should be separate 
> changelists
> ;)  The rietveld change is at
> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends
> me a patch to make it work with multiple bug ids, I'd be happy to push it.
>
>
> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:
>
>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>> autolink, can you support multiple 

[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-09 Thread PhistucK
Are we only talking about when it is viewed in Rietveld?What about when it
is actually committed, can the change log be tweaked that way,
automatically, too?
That would be nice when reading change logs.

Thank you!

☆PhistucK


On Thu, Sep 10, 2009 at 05:01, John Abd-El-Malek  wrote:

> Thanks, glad you enjoy it :)
> This was a side distraction to fix the annoying issue of having to manually
> copying and pasting the bug ids.  It severely tested my regex-fu and since
> the multiple bugs case should be rare, I'll hide behind the excuse that if
> they're duplicates they should be marked as such and only end up with one,
> and if they're different bugs there should be separate changelists ;)  The
> rietveld change is at
> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends me
> a patch to make it work with multiple bug ids, I'd be happy to push it.
>
>
> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour  wrote:
>
>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>> autolink, can you support multiple bugs as well? The format bugdroid uses is
>> BUG=1, 2, 3
>> - Mohamed Mansour
>>
>>
>>
>> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. > > wrote:
>>
>>> I just noticed that BUG=1234 lines are autolinked to the correct bug when
>>> viewed in Rietveld (codereview.chromium.org). This is very useful,
>>> thanks!
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-10 Thread John Abd-El-Malek
This is just for Rietveld issues.  We can possibly do the same to the commit
log in gcl/git scripts, again patches welcome :)
Thanks Mohamed for the patch, I committed it and made it live with two minor
changes.

On Wed, Sep 9, 2009 at 10:04 PM, PhistucK  wrote:

> Are we only talking about when it is viewed in Rietveld?What about when it
> is actually committed, can the change log be tweaked that way,
> automatically, too?
> That would be nice when reading change logs.
>
> Thank you!
>
> ☆PhistucK
>
>
>
> On Thu, Sep 10, 2009 at 05:01, John Abd-El-Malek  wrote:
>
>> Thanks, glad you enjoy it :)
>> This was a side distraction to fix the annoying issue of having to
>> manually copying and pasting the bug ids.  It severely tested my regex-fu
>> and since the multiple bugs case should be rare, I'll hide behind the excuse
>> that if they're duplicates they should be marked as such and only end up
>> with one, and if they're different bugs there should be separate changelists
>> ;)  The rietveld change is at
>> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends me
>> a patch to make it work with multiple bug ids, I'd be happy to push it.
>>
>>
>> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour  wrote:
>>
>>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>>> autolink, can you support multiple bugs as well? The format bugdroid uses is
>>> BUG=1, 2, 3
>>> - Mohamed Mansour
>>>
>>>
>>>
>>> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
>>> phajdan...@chromium.org> wrote:
>>>
 I just noticed that BUG=1234 lines are autolinked to the correct bug
 when viewed in Rietveld (codereview.chromium.org). This is very useful,
 thanks!


>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-10 Thread Mohamed Mansour
Np! I will do one for gcl.
-- Mohamed Mansour


On Thu, Sep 10, 2009 at 3:31 AM, John Abd-El-Malek  wrote:

> This is just for Rietveld issues.  We can possibly do the same to the
> commit log in gcl/git scripts, again patches welcome :)
> Thanks Mohamed for the patch, I committed it and made it live with two
> minor changes.
>
>
> On Wed, Sep 9, 2009 at 10:04 PM, PhistucK  wrote:
>
>> Are we only talking about when it is viewed in Rietveld?What about when
>> it is actually committed, can the change log be tweaked that way,
>> automatically, too?
>> That would be nice when reading change logs.
>>
>> Thank you!
>>
>> ☆PhistucK
>>
>>
>>
>> On Thu, Sep 10, 2009 at 05:01, John Abd-El-Malek wrote:
>>
>>> Thanks, glad you enjoy it :)
>>> This was a side distraction to fix the annoying issue of having to
>>> manually copying and pasting the bug ids.  It severely tested my regex-fu
>>> and since the multiple bugs case should be rare, I'll hide behind the excuse
>>> that if they're duplicates they should be marked as such and only end up
>>> with one, and if they're different bugs there should be separate changelists
>>> ;)  The rietveld change is at
>>> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends
>>> me a patch to make it work with multiple bug ids, I'd be happy to push it.
>>>
>>>
>>> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:
>>>
 Very nice, no longer I have to put crbug.com/#.  Whoever did that
 autolink, can you support multiple bugs as well? The format bugdroid uses 
 is
 BUG=1, 2, 3
 - Mohamed Mansour



 On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
 phajdan...@chromium.org> wrote:

> I just noticed that BUG=1234 lines are autolinked to the correct bug
> when viewed in Rietveld (codereview.chromium.org). This is very
> useful, thanks!
>
>



>>>
>>>
>>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-10 Thread Mohamed Mansour
I did the git and gcl patches, but it only does it when you "commit". What
ways do you guys like to use it? jam stated that he is opposed to changing
the commit log from what the person wrote.
- Mohamed Mansour


On Thu, Sep 10, 2009 at 5:29 PM, Mohamed Mansour  wrote:

> Np! I will do one for gcl.
> -- Mohamed Mansour
>
>
>
> On Thu, Sep 10, 2009 at 3:31 AM, John Abd-El-Malek wrote:
>
>> This is just for Rietveld issues.  We can possibly do the same to the
>> commit log in gcl/git scripts, again patches welcome :)
>> Thanks Mohamed for the patch, I committed it and made it live with two
>> minor changes.
>>
>>
>> On Wed, Sep 9, 2009 at 10:04 PM, PhistucK  wrote:
>>
>>> Are we only talking about when it is viewed in Rietveld?What about when
>>> it is actually committed, can the change log be tweaked that way,
>>> automatically, too?
>>> That would be nice when reading change logs.
>>>
>>> Thank you!
>>>
>>> ☆PhistucK
>>>
>>>
>>>
>>> On Thu, Sep 10, 2009 at 05:01, John Abd-El-Malek wrote:
>>>
 Thanks, glad you enjoy it :)
 This was a side distraction to fix the annoying issue of having to
 manually copying and pasting the bug ids.  It severely tested my regex-fu
 and since the multiple bugs case should be rare, I'll hide behind the 
 excuse
 that if they're duplicates they should be marked as such and only end up
 with one, and if they're different bugs there should be separate 
 changelists
 ;)  The rietveld change is at
 http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends
 me a patch to make it work with multiple bug ids, I'd be happy to push it.


 On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:

> Very nice, no longer I have to put crbug.com/#.  Whoever did that
> autolink, can you support multiple bugs as well? The format bugdroid uses 
> is
> BUG=1, 2, 3
> - Mohamed Mansour
>
>
>
> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
> phajdan...@chromium.org> wrote:
>
>> I just noticed that BUG=1234 lines are autolinked to the correct bug
>> when viewed in Rietveld (codereview.chromium.org). This is very
>> useful, thanks!
>>
>>
>
>
>



>>>
>>> >>>
>>>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-10 Thread Mohamed Mansour
Rewriting commit messages are always risky, but it has been tested to work,
it just searches for BUG=# and formats it to BUG=http://crbug.com/#
Maybe we should just do what you said and format the buildbot instead.

- Mohamed Mansour


On Thu, Sep 10, 2009 at 6:08 PM, Paweł Hajdan Jr.
wrote:

> Putting HTML in the commit message doesn't sound good to me (or does your
> patch work differently?). Plain text is good in this case. And rewriting the
> commit message is risky as well (at least I should get a chance to see the
> rewritten message before it gets committed).
> On the other hand, maybe it would make more sense to autolink the BUG line
> in other places: buildbot waterfall, viewvc, ...
>
>
> On Thu, Sep 10, 2009 at 15:03, Mohamed Mansour  wrote:
>
>> I did the git and gcl patches, but it only does it when you "commit". What
>> ways do you guys like to use it? jam stated that he is opposed to
>> changing the commit log from what the person wrote.
>> - Mohamed Mansour
>>
>>
>>
>> On Thu, Sep 10, 2009 at 5:29 PM, Mohamed Mansour wrote:
>>
>>> Np! I will do one for gcl.
>>> -- Mohamed Mansour
>>>
>>>
>>>
>>> On Thu, Sep 10, 2009 at 3:31 AM, John Abd-El-Malek wrote:
>>>
 This is just for Rietveld issues.  We can possibly do the same to the
 commit log in gcl/git scripts, again patches welcome :)
 Thanks Mohamed for the patch, I committed it and made it live with two
 minor changes.


 On Wed, Sep 9, 2009 at 10:04 PM, PhistucK  wrote:

> Are we only talking about when it is viewed in Rietveld?What about
> when it is actually committed, can the change log be tweaked that way,
> automatically, too?
> That would be nice when reading change logs.
>
> Thank you!
>
> ☆PhistucK
>
>
>
> On Thu, Sep 10, 2009 at 05:01, John Abd-El-Malek wrote:
>
>> Thanks, glad you enjoy it :)
>> This was a side distraction to fix the annoying issue of having to
>> manually copying and pasting the bug ids.  It severely tested my regex-fu
>> and since the multiple bugs case should be rare, I'll hide behind the 
>> excuse
>> that if they're duplicates they should be marked as such and only end up
>> with one, and if they're different bugs there should be separate 
>> changelists
>> ;)  The rietveld change is at
>> http://code.google.com/p/rietveld/source/detail?r=455, if anyone
>> sends me a patch to make it work with multiple bug ids, I'd be happy to 
>> push
>> it.
>>
>>
>> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:
>>
>>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>>> autolink, can you support multiple bugs as well? The format bugdroid 
>>> uses is
>>> BUG=1, 2, 3
>>> - Mohamed Mansour
>>>
>>>
>>>
>>> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
>>> phajdan...@chromium.org> wrote:
>>>
 I just noticed that BUG=1234 lines are autolinked to the correct bug
 when viewed in Rietveld (codereview.chromium.org). This is very
 useful, thanks!


>>>
>>>
>>>
>>
>>
>>
>
> >
>

>>>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---



[chromium-dev] Re: autolinking BUG= lines in Rietveld

2009-09-10 Thread Paweł Hajdan Jr .
Putting HTML in the commit message doesn't sound good to me (or does your
patch work differently?). Plain text is good in this case. And rewriting the
commit message is risky as well (at least I should get a chance to see the
rewritten message before it gets committed).
On the other hand, maybe it would make more sense to autolink the BUG line
in other places: buildbot waterfall, viewvc, ...

On Thu, Sep 10, 2009 at 15:03, Mohamed Mansour  wrote:

> I did the git and gcl patches, but it only does it when you "commit". What
> ways do you guys like to use it? jam stated that he is opposed to changing
> the commit log from what the person wrote.
> - Mohamed Mansour
>
>
>
> On Thu, Sep 10, 2009 at 5:29 PM, Mohamed Mansour  wrote:
>
>> Np! I will do one for gcl.
>> -- Mohamed Mansour
>>
>>
>>
>> On Thu, Sep 10, 2009 at 3:31 AM, John Abd-El-Malek wrote:
>>
>>> This is just for Rietveld issues.  We can possibly do the same to the
>>> commit log in gcl/git scripts, again patches welcome :)
>>> Thanks Mohamed for the patch, I committed it and made it live with two
>>> minor changes.
>>>
>>>
>>> On Wed, Sep 9, 2009 at 10:04 PM, PhistucK  wrote:
>>>
 Are we only talking about when it is viewed in Rietveld?What about when
 it is actually committed, can the change log be tweaked that way,
 automatically, too?
 That would be nice when reading change logs.

 Thank you!

 ☆PhistucK



 On Thu, Sep 10, 2009 at 05:01, John Abd-El-Malek wrote:

> Thanks, glad you enjoy it :)
> This was a side distraction to fix the annoying issue of having to
> manually copying and pasting the bug ids.  It severely tested my regex-fu
> and since the multiple bugs case should be rare, I'll hide behind the 
> excuse
> that if they're duplicates they should be marked as such and only end up
> with one, and if they're different bugs there should be separate 
> changelists
> ;)  The rietveld change is at
> http://code.google.com/p/rietveld/source/detail?r=455, if anyone sends
> me a patch to make it work with multiple bug ids, I'd be happy to push it.
>
>
> On Wed, Sep 9, 2009 at 6:15 PM, Mohamed Mansour wrote:
>
>> Very nice, no longer I have to put crbug.com/#.  Whoever did that
>> autolink, can you support multiple bugs as well? The format bugdroid 
>> uses is
>> BUG=1, 2, 3
>> - Mohamed Mansour
>>
>>
>>
>> On Wed, Sep 9, 2009 at 8:58 PM, Paweł Hajdan Jr. <
>> phajdan...@chromium.org> wrote:
>>
>>> I just noticed that BUG=1234 lines are autolinked to the correct bug
>>> when viewed in Rietveld (codereview.chromium.org). This is very
>>> useful, thanks!
>>>
>>>
>>
>>
>>
>
>
>

 

>>>
>>
>

--~--~-~--~~~---~--~~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
http://groups.google.com/group/chromium-dev
-~--~~~~--~~--~--~---