Summary: | fix svn revision number finding when creating git patches | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ojan Vafai <ojan> | ||||
Component: | New Bugs | Assignee: | Ojan Vafai <ojan> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | abarth, aroben, eric, evan, kalman | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Other | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Ojan Vafai
2011-02-22 23:34:35 PST
Created attachment 83452 [details]
Patch
Obligatory deferring to evmar. :) Comment on attachment 83452 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=83452&action=review > Tools/Scripts/webkitpy/common/checkout/scm.py:752 > + git_log = self.run(['git', 'log', '-10']) > + match = re.search("^\s*git-svn-id:.*@(?P<svn_revision>\d+)\ .*$", git_log, re.MULTILINE) > + if not match: I think you can just use "git svn info". It seems to work at least in simple cases. I haven't tried it with a merge commit, though. Here's how this is done within git-svn (as translated into my python). git-svn doesn't have the -100 limit. http://neugierig.org/software/git/?url=git-cl/tree/git-cl#n143 142 # The -100 is an arbitrary limit so we don't search forever. 143 cmd = ['git', 'log', '-100', '--pretty=medium'] 144 proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) 145 for line in proc.stdout: 146 match = git_svn_re.match(line) 147 if match: 148 url = match.group(1) 151 proc.stdout.close() # Cut pipe. 152 break I think Ojan's is probably fine too though. "git svn info" will fail if you have a git checkout that isn't a git-svn checkout. Not sure if that applies here. Comment on attachment 83452 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=83452&action=review This or evan's version looks fine. > Tools/Scripts/webkitpy/common/checkout/scm.py:751 > + match = re.search("^\s*git-svn-id:.*@(?P<svn_revision>\d+)\ .*$", git_log, re.MULTILINE) Nit: I'm not sure the .*$ gives you anything (aren't you always going to have something before the end of the line?) (In reply to comment #4) > 142 # The -100 is an arbitrary limit so we don't search forever. > 143 cmd = ['git', 'log', '-100', '--pretty=medium'] I wasn't sure what limit to set. 10 is probably too small. I'll make it 25 for now. > "git svn info" will fail if you have a git checkout that isn't a git-svn checkout. Right. Committed r79520: <http://trac.webkit.org/changeset/79520> |