Issue30

Title hg log -p doesn't show file deletions
Priority bug Status resolved
Superseder Nosy List mpm, tksoh, tonfa
Assigned To Topics

Created on 2005-10-25.00:09:52 by mpm, last changed 2005-12-15.15:56:53 by ThomasAH.

Messages
msg298 (view) Author: ThomasAH Date: 2005-12-15.15:56:53
Works fine and pushed to main repo by mpm.
msg292 (view) Author: tonfa Date: 2005-12-12.14:03:39
# HG changeset patch
# User Benoit Boissinot <benoit.boissinot@ens-lyon.org>
# Node ID 6194c345b4736dc66a2928ab64f5917a5611f584
# Parent  b3e94785ab698e77ca22b467fc3ac58c7de57c3e
hg log -p should show file deletions

diff -r b3e94785ab69 -r 6194c345b473 mercurial/commands.py
--- a/mercurial/commands.py	Sun Dec 11 15:38:42 2005 -0800
+++ b/mercurial/commands.py	Mon Dec 12 14:54:52 2005 +0100
@@ -66,7 +66,7 @@
     window, we first walk forwards to gather data, then in the desired
     order (usually backwards) to display it.

-    This function returns an (iterator, getchange) pair.  The
+    This function returns an (iterator, getchange, matchfn) tuple.  The
     getchange function returns the changelog entry for a numeric
     revision.  The iterator yields 3-tuples.  They will be of one of
     the following forms:
@@ -82,10 +82,11 @@
     "iter", rev, None: in-order traversal of the revs earlier iterated
     over with "add" - use to display data'''

+    files, matchfn, anypats, cwd = matchpats(repo, pats, opts)
+
     if repo.changelog.count() == 0:
-        return [], False
-
-    files, matchfn, anypats, cwd = matchpats(repo, pats, opts)
+        return [], False, matchfn
+
     revs = map(int, revrange(ui, repo, opts['rev'] or ['tip:0']))
     wanted = {}
     slowpath = anypats
@@ -153,7 +154,7 @@
                 yield 'add', rev, fns
             for rev in nrevs:
                 yield 'iter', rev, None
-    return iterate(), getchange
+    return iterate(), getchange, matchfn

 revrangesep = ':'

@@ -1281,7 +1282,7 @@

     fstate = {}
     skip = {}
-    changeiter, getchange = walkchangerevs(ui, repo, pats, opts)
+    changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts)
     count = 0
     incrementing = False
     for st, rev, fns in changeiter:
@@ -1544,7 +1545,7 @@
                 self.write(*args)
         def __getattr__(self, key):
             return getattr(self.ui, key)
-    changeiter, getchange = walkchangerevs(ui, repo, pats, opts)
+    changeiter, getchange, matchfn = walkchangerevs(ui, repo, pats, opts)
     for st, rev, fns in changeiter:
         if st == 'window':
             du = dui(ui)
@@ -1560,7 +1561,7 @@

             br = None
             if opts['keyword']:
-                changes = repo.changelog.read(repo.changelog.node(rev))
+                changes = getchange(rev)
                 miss = 0
                 for k in [kw.lower() for kw in opts['keyword']]:
                     if not (k in changes[1].lower() or
@@ -1577,7 +1578,7 @@
             show_changeset(du, repo, rev, brinfo=br)
             if opts['patch']:
                 prev = (parents and parents[0]) or nullid
-                dodiff(du, du, repo, prev, changenode, fns)
+                dodiff(du, du, repo, prev, changenode, match=matchfn)
                 du.write("\n\n")
         elif st == 'iter':
             for args in du.hunk[rev]:
diff -r b3e94785ab69 -r 6194c345b473 tests/test-remove
--- a/tests/test-remove	Sun Dec 11 15:38:42 2005 -0800
+++ b/tests/test-remove	Mon Dec 12 14:54:52 2005 +0100
@@ -8,6 +8,10 @@
 rm foo
 hg remove foo
 hg commit -m 2 -d "0 0"
+hg export 0
+hg export 1
+hg log -p -r 0
+hg log -p -r 1

 cd ..
 hg clone a b
diff -r b3e94785ab69 -r 6194c345b473 tests/test-remove.out
--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
+++ b/tests/test-remove.out	Mon Dec 12 14:54:52 2005 +0100
@@ -0,0 +1,47 @@
+# HG changeset patch
+# User test
+# Node ID b51ca55c20354097ca299529d18b5cd356976ba2
+# Parent  0000000000000000000000000000000000000000
+1
+
+diff -r 000000000000 -r b51ca55c2035 foo
+--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
++++ b/foo	Thu Jan  1 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++a
+# HG changeset patch
+# User test
+# Node ID 1e555b9b85c52e1e9e8175446f1ede507b2d1ebb
+# Parent  b51ca55c20354097ca299529d18b5cd356976ba2
+2
+
+diff -r b51ca55c2035 -r 1e555b9b85c5 foo
+--- a/foo	Thu Jan  1 00:00:00 1970 +0000
++++ /dev/null	Thu Jan  1 00:00:00 1970 +0000
+@@ -1,1 +0,0 @@
+-a
+changeset:   0:b51ca55c2035
+user:        test
+date:        Thu Jan  1 00:00:00 1970 +0000
+summary:     1
+
+diff -r 000000000000 -r b51ca55c2035 foo
+--- /dev/null	Thu Jan  1 00:00:00 1970 +0000
++++ b/foo	Thu Jan  1 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++a
+
+
+changeset:   1:1e555b9b85c5
+tag:         tip
+user:        test
+date:        Thu Jan  1 00:00:00 1970 +0000
+summary:     2
+
+diff -r b51ca55c2035 -r 1e555b9b85c5 foo
+--- a/foo	Thu Jan  1 00:00:00 1970 +0000
++++ /dev/null	Thu Jan  1 00:00:00 1970 +0000
+@@ -1,1 +0,0 @@
+-a
+
+
History
Date User Action Args
2005-12-15 17:10:17tonfaunlinkissue91 superseder
2005-12-15 15:56:53ThomasAHsetstatus: in-progress -> resolved
nosy: mpm, tonfa, tksoh
messages: + msg298
2005-12-12 14:04:28tonfasetnosy: mpm, tonfa, tksoh
2005-12-12 14:04:19tonfasetstatus: chatting -> in-progress
nosy: mpm, tonfa, tksoh
2005-12-12 14:03:44tonfasetstatus: unread -> chatting
nosy: mpm, tonfa, tksoh
messages: + msg292
2005-12-12 14:01:58tonfasetnosy: + tonfa, tksoh
2005-12-08 11:18:09tonfalinkissue91 superseder
2005-10-25 00:09:52mpmcreate