History of changes to a particular line of code in Subversion

前端 未结 11 2019
轮回少年
轮回少年 2020-12-02 22:05

Is it possible to see the history of changes to a particular line of code in a Subversion repository?

I\'d like, for instance, to be able to see when a particular st

相关标签:
11条回答
  • 2020-12-02 22:35

    I don't know a method for tracking statements through time in Subversion.

    It is simple however to see when any particular line in a file was last changed using svn blame. Check the SVNBook: svn blame reference:

    Synopsis

    svn blame TARGET[@REV]...
    

    Description

    Show author and revision information in-line for the specified files or URLs. Each line of text is annotated at the beginning with the author (username) and the revision number for the last change to that line.

    0 讨论(0)
  • 2020-12-02 22:38

    In Eclipse you can know when each line of your code has been committed using the SVN annotate view, or right click on the file → TeamShow annotation....

    0 讨论(0)
  • 2020-12-02 22:42

    svn blame shows you which checkin modified any line in a file the last time.

    This works on old revisions too.

    0 讨论(0)
  • 2020-12-02 22:42

    The command you're looking for is svn blame.

    0 讨论(0)
  • 2020-12-02 22:48

    This can be done in two stages:

    1. svn blame /path/to/your/file > blame.tmp
    2. grep "your_line_of_text" blame.tmp

    You can delete blame.tmp file afterwards if you don't need it.

    In principle, a simple script can be written in any scripting language that does roughly the same.

    0 讨论(0)
提交回复
热议问题