Mercurial > hg-stable
diff tests/test-glog.t @ 16186:af3e67354beb
graphlog: apply file filters --patch/--stat output
When passing --patch/--stat, file filters have to be applied to generate the
correct diff or stat output:
- Without --follow, the static match object can be reused
- With --follow, the files displayed at revision X are the ancestors of
selected files at parent revision. To do this, we reproduce the ancestry
calculations done by --follow, lazily.
test-glog.t changes show that --patch output is not satisfying because renames
are reported as copies. This can probably be fixed by:
- Without --follow: compute files to display, look for renames sources and
extend the matcher to include them.
- With --follow: detect .path() transitions between parent/child filectx,
filter them using the linked changectx .removed() field and extend fcache
with them.
author | Patrick Mezard <patrick@mezard.eu> |
---|---|
date | Sun, 26 Feb 2012 17:12:15 +0100 |
parents | 6863caf01daa |
children | f89284d72a61 |
line wrap: on
line diff
--- a/tests/test-glog.t Sun Feb 26 17:10:57 2012 +0100 +++ b/tests/test-glog.t Sun Feb 26 17:12:15 2012 +0100 @@ -90,7 +90,7 @@ > def uisetup(ui): > def printrevset(orig, ui, repo, *pats, **opts): > if opts.get('print_revset'): - > expr = graphlog.revset(repo, pats, opts) + > expr = graphlog.revset(repo, pats, opts)[0] > tree = revset.parse(expr)[0] > ui.write(tree, "\n") > return 0 @@ -1655,3 +1655,99 @@ abort: can only follow copies/renames for explicit filenames abort: can only follow copies/renames for explicit filenames abort: can only follow copies/renames for explicit filenames + +Test --patch and --stat with --follow and --follow-first + + $ hg up -q 3 + $ hg log -G --git --patch b + o changeset: 1:216d4c92cf98 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: copy a b + | + | diff --git a/a b/b + | copy from a + | copy to b + | + + $ hg log -G --git --stat b + o changeset: 1:216d4c92cf98 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: copy a b + | + | a | 0 + | 1 files changed, 0 insertions(+), 0 deletions(-) + | + + $ hg log -G --git --patch --follow b + o changeset: 1:216d4c92cf98 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: copy a b + | + | diff --git a/a b/b + | copy from a + | copy to b + | + o changeset: 0:f8035bb17114 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add a + + diff --git a/a b/a + new file mode 100644 + --- /dev/null + +++ b/a + @@ -0,0 +1,1 @@ + +a + + + $ hg log -G --git --stat --follow b + o changeset: 1:216d4c92cf98 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: copy a b + | + | a | 0 + | 1 files changed, 0 insertions(+), 0 deletions(-) + | + o changeset: 0:f8035bb17114 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: add a + + a | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + + + $ hg up -q 6 + $ hg log -G --git --patch --follow-first e + @ changeset: 6:fc281d8ff18d + |\ tag: tip + | | parent: 5:99b31f1c2782 + | | parent: 4:17d952250a9d + | | user: test + | | date: Thu Jan 01 00:00:00 1970 +0000 + | | summary: merge 5 and 4 + | | + | | diff --git a/e b/e + | | --- a/e + | | +++ b/e + | | @@ -1,1 +1,1 @@ + | | -ee + | | +merge + | | + o | changeset: 5:99b31f1c2782 + | | parent: 3:5918b8d165d1 + | | user: test + | | date: Thu Jan 01 00:00:00 1970 +0000 + | | summary: add another e + | | + | | diff --git a/e b/e + | | new file mode 100644 + | | --- /dev/null + | | +++ b/e + | | @@ -0,0 +1,1 @@ + | | +ee + | |