Command to get svn diff of current and previous revision number

69,126

Solution 1

As per your comments you'd like to see differences between the current and previous versions of an item that is not in your working copy. For that you need to know the item's URL (e.g. svn://[repo_root]/[path]/[item]) which I assume you do. Then you do the following:

svn info <item-URL>

will contain (among other things) the last change revision. With that revision number R you run:

svn diff -c <R> <item-URL>

and it will give you the last commit diff.

Solution 2

svn diff -r HEAD <item> if you want to get the difference between your working copy and the last committed revision.

svn diff -r PREV:COMMITTED <item> if you want to see what the last commit did.

You should take look at Revision Keywords.

svn info <item> will give you (among other things) the last change revision for the item.

Share:
69,126
Pavan Tiwari
Author by

Pavan Tiwari

Updated on July 13, 2022

Comments

  • Pavan Tiwari
    Pavan Tiwari almost 2 years

    How can I get diff in file content of current and previous revision number by command line?

    And how can I get previous revision number?

  • Konerak
    Konerak almost 12 years
    svn diff -r COMMITTED:PREV then.
  • malenkiy_scot
    malenkiy_scot almost 12 years
    I deleted my comment because I wanted to edit it. So please update your answer.
  • Konerak
    Konerak almost 12 years
    Go ahead and edit it, or post your own answer. I don't think I fully understand what the OP wants. If you do, please edit or answer :]
  • malenkiy_scot
    malenkiy_scot almost 12 years
    I posted my own, but then deleted it as yours is better. I'll edit it.
  • Pavan Tiwari
    Pavan Tiwari almost 12 years
    Actually i wanted to get diff of last two svn revision number not from my current working working directroy
  • malenkiy_scot
    malenkiy_scot almost 12 years
    Ok, then I'll resurrect my answer.