![]() Note that while one could imagine using some kind of binary searching to find the first revision in which the regex appears (or doesn't), this won't work in the general case because code sometimes is added, then deleted, then re-added, then deleted again (this happens when refactoring or when reverting problematic commits). It basically goes over all revisions of the file starting with the most recent one and looks for the pattern. Print( '%s: %s' % (ver, 'found' if re.search(s, contents) Log = run_command( 'svn log ' + filename)įor ver in re.findall( 'r\d+', log, flags=re.MULTILINE):Ĭmd = 'svn cat -r %s %s' % (ver.rstrip( 'r'), filename) Now we’ll focus on the easiest option to implement displaying issue number in commit message and open it in browser. """ Go over all revisions of filename, checking if s can be found in them. Only highlight the issue in your revision details and allow quickly open it in browser Connect to your JIRA and show the list of issues with all filters, view details and pick issues to include in your commit. ![]() """ return subprocess.check_output(cmd.split(), universal_newlines= True) """ Run shell command, return its stdout output. Import re, sys, subprocess def run_command(cmd): That said, if you're willing to tolerate the slowness (and sometimes there's no choice!), then the following script - svnrevgrep - makes it as simple as with Git or Mercurial: Moreover, SVN's design makes this task inherently slow because no revisions past the last one are actually kept on your machine (unless the repository is local) and you have to ask the server for each revision. What about Subversion, though? SVN, to the best of my knowledge, does not have this functionality built-in. With Git, you can either use git grep in conjunction with git rev-list, or git log -S (more details in this SO thread). hgignore TortoiseHg suggests it be included in the commit dialog. With any other file that is not specifically filtered by my. NET projects and one thing that happens consistently is that the nfig files get ignored for commit unless I explicitly add them. hghgrc file I was able to get a link to show up.by adding: tortoisehg issue. I use NuGet for package management on my. Well, if you're using Mercurial or Git, you're lucky because both provide built-in methods for doing this. 8,154 8 49 62 asked at 15:37 Ash 789 1 9 24 3 Ok, so in the repo. Information Integration with many SCM systems requires the Professional Edition of Merge to enable the comparison of two. Note that the goal is not to search in the commit log (which is trivial), but rather in the code itself. In other words, we want to grep over all revisions of some file to know which revisions contain a certain pattern. Maybe a drop down is too fancy, but is there something similar to the TortoiseSVN Integration with Bug Tracking Systems / Issue Trackers available at least, i.e. ![]() A problem that sometimes comes up with source-controlled code is to find a revision in which some line was deleted, or otherwise modified in a way that blame can't decipher. For example, show a drop down when committing from TortoiseHg with all active JIRA issues assigned to the current user (similar to the TortoiseSVN Plugin for JIRA).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |