tests/test-diffdir.t
author Martin Geisler <mg@aragost.com>
Mon, 09 May 2011 17:15:44 +0200
changeset 14281 ccb7240acf32
parent 12617 2063d36b406e
child 27901 29c8e35d3283
permissions -rw-r--r--
subrepo: create subrepos using clone instead of pull Subrepositories used to be created empty and then filled with data using pull. This is wasteful when you do a clone from a local source since it means that no hardlinks are created for the subrepos. This patch make the hgsubrepo._get method check for an empty subrepo and in that case do a clone instead of a pull. This brings in the same data as before, but creates hardlinks when possible.

  $ hg init
  $ touch a
  $ hg add a
  $ hg ci -m "a"

  $ echo 123 > b
  $ hg add b
  $ hg diff --nodates
  diff -r 3903775176ed b
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +123

  $ hg diff --nodates -r tip
  diff -r 3903775176ed b
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +123

  $ echo foo > a
  $ hg diff --nodates
  diff -r 3903775176ed a
  --- a/a
  +++ b/a
  @@ -0,0 +1,1 @@
  +foo
  diff -r 3903775176ed b
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +123

  $ hg diff -r ""
  hg: parse error: empty query
  [255]
  $ hg diff -r tip -r ""
  hg: parse error: empty query
  [255]