Source

mercurial/extensions/rdiff / test-rdiff.t

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "rdiff=" >> $HGRCPATH

  $ hg init base
  $ cd base
  $ echo foo > foo
  $ hg ci -Amfoo
  adding foo

  $ hg clone . ../b1
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ../b1
  $ echo bar >> foo
  $ echo % working directory diff
  % working directory diff
  $ hg diff --git --reverse ../base
  comparing with ../base
  searching for changes
  diff --git a/foo b/foo
  --- a/foo
  +++ b/foo
  @@ -1,1 +1,2 @@
   foo
  +bar
  $ hg ci -mbar
  $ hg diff --git ../base
  comparing with ../base
  searching for changes
  diff --git a/foo b/foo
  --- a/foo
  +++ b/foo
  @@ -1,2 +1,1 @@
   foo
  -bar

  $ cd ../base
  $ hg diff --git ../b1
  comparing with ../b1
  searching for changes
  diff --git a/foo b/foo
  --- a/foo
  +++ b/foo
  @@ -1,1 +1,2 @@
   foo
  +bar
  $ hg diff --git --reverse ../b1
  comparing with ../b1
  searching for changes
  diff --git a/foo b/foo
  --- a/foo
  +++ b/foo
  @@ -1,2 +1,1 @@
   foo
  -bar
  $ echo '% remote revision'
  % remote revision
  $ hg diff --git -r . -r tip ../b1
  comparing with ../b1
  searching for changes
  diff --git a/foo b/foo
  --- a/foo
  +++ b/foo
  @@ -1,1 +1,2 @@
   foo
  +bar

cross-branch diff

  $ mkdir d1
  $ echo foo > d1/foo
  $ hg ci -Amb2
  adding d1/foo
  $ hg diff --git ../b1
  comparing with ../b1
  searching for changes
  diff --git a/d1/foo b/d1/foo
  deleted file mode 100644
  --- a/d1/foo
  +++ /dev/null
  @@ -1,1 +0,0 @@
  -foo
  diff --git a/foo b/foo
  --- a/foo
  +++ b/foo
  @@ -1,1 +1,2 @@
   foo
  +bar

pattern matching
  $ hg diff --git ../b1 d1
  comparing with ../b1
  searching for changes
  diff --git a/d1/foo b/d1/foo
  deleted file mode 100644
  --- a/d1/foo
  +++ /dev/null
  @@ -1,1 +0,0 @@
  -foo
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.