Ticket #5 (closed defect: fixed)
browser (possibly core) gets confused by moved directories
| Reported by: | Massimiliano Mirra <itevak602@…> | Owned by: | lele |
|---|---|---|---|
| Priority: | minor | Component: | darcs backend |
| Version: | Keywords: | directory move | |
| Cc: |
Description
Trac+darcs seems not to sync well with repositories where non-empty directories have been moved.
Software versions and steps to reproduce the problem follow (addresses made less spammer-friendly ;-)).
Desktop> cd ~/Desktop/trac
trac> svn info
Path: .
URL: http://svn.edgewall.com/repos/trac/trunk
Repository UUID: af82e41b-90c4-0310-8c96-b1721e28e2e2
Revision: 2938
Node Kind: directory
Schedule: normal
Last Changed Author: mgood
Last Changed Rev: 2938
Last Changed Date: 2006-02-24 20:34:51 +0100 (Fri, 24 Feb 2006)
Properties Last Updated: 2006-02-25 03:54:41 +0100 (Sat, 25 Feb 2006)
trac> cd ~/Desktop/tracdarcs
tracdarcs> darcs cha --last 1
Sun Feb 19 13:57:10 CET 2006 lele [at] metapensiero [dot] it
* Postpone computation of ancestors
As one can see in
$ darcs changes --xml --summary -p "zurich workshop" \
--repo http://zwizwa.goto10.org/darcs/libpf
the hunks are out of order (move "demo/hda" preceeds its add). For
this reason, first collect all changes of a single patch and build
the concrete list of nodes, computing "kind" and ancestor information,
only at changeset creation time.
tracdarcs> darcs --version
1.0.5 (release)
tracdarcs> cd /tmp
tmp> mkdir repo
tmp> cd repo
repo> darcs init
repo> mkdir foo bar
repo> touch foo/hello.txt
repo> darcs add foo bar foo/hello.txt
repo> darcs rec -a -m 'patch1'
Darcs needs to know what name (conventionally an email address) to use as the
patch author, e.g. 'Fred Bloggs <fred@bloggs.invalid>'. If you provide one
now it will be stored in the file '_darcs/prefs/author' and used as a default
in the future. To change your preferred author address, simply delete or edit
this file.
What is your email address? foo@bar.com
Finished recording patch 'patch1'
repo> l
total 0
drwxr-xr-x 2 bard bard 40 2006-02-25 15:21 bar/
drwxr-xr-x 6 bard bard 140 2006-02-25 15:22 _darcs/
drwxr-xr-x 2 bard bard 60 2006-02-25 15:21 foo/
repo> l foo
total 0
-rw-r--r-- 1 bard bard 0 2006-02-25 15:21 hello.txt
At this point, everything looks fine in tracs browser.
repo> darcs mv foo bar repo> find bar -ls 18439 0 drwxr-xr-x 3 bard bard 60 Feb 25 15:24 bar 18438 0 drwxr-xr-x 2 bard bard 60 Feb 25 15:21 bar/foo 18440 0 -rw-r--r-- 1 bard bard 0 Feb 25 15:21 bar/foo/hello.txt repo> darcs rec -a -m 'patch2' Finished recording patch 'patch2'
foo disappears from top level as expected, and appears under bar/, but no hello.txt appears under foo.
repo> cd bar/foo foo> echo hello, world! >hello.txt foo> darcs rec -a -m 'patch3' Finished recording patch 'patch3'
Now trac browser complains: No node at u'bar/foo/hello.txt' in revision 3
Change History
Note: See
TracTickets for help on using
tickets.
Yes, I see what's going on. It's in _getNodeEntries(), that should recurse over itself in case of moved directories.