[darcs-users] Issue with darcs diff in darcs2
Dan Pascu
dan at ag-projects.com
Tue Jul 22 13:38:02 UTC 2008
Hi,
After upgrading from darcs 1.0.9 to darcs 2, I noticed a problem with
getting diffs from the repository. The repository is in version 1 format,
but I also converted it to version 2 format and the problem persists.
Also the same is true with newly created repositories.
What happens that a command like:
darcs diff --patch "patch description"
only works for patches that are still listed in _darcs/inventory
Once I run darcs optimize and they are moved to _darcs/inventories/, the
command above only shows the title for the record and the diff is empty.
To give an example to make things clear:
-----------------------------------------------------------------
dawn:~/work$ mkdir test; cd test
dawn:~/work/test$ darcs initialize
dawn:~/work/test$ echo "aaa" > file
dawn:~/work/test$ darcs add file
dawn:~/work/test$ darcs record -a -m "aaa"
Finished recording patch 'aaa'
dawn:~/work/test$ echo "bbb" >> file
dawn:~/work/test$ darcs record -a -m "bbb"
Finished recording patch 'bbb'
dawn:~/work/test$ darcs diff --patch "aaa"
Tue Jul 22 16:14:41 EEST 2008 Dan Pascu <dan at ag-projects.com>
* aaa
diff -rN -u old-test/file new-test/file
--- old-test/file 1970-01-01 02:00:00.000000000 +0200
+++ new-test/file 2008-07-22 16:14:54.000000000 +0300
@@ -0,0 +1 @@
+aaa
dawn:~/work/test$ darcs diff --patch "bbb"
Tue Jul 22 16:14:49 EEST 2008 Dan Pascu <dan at ag-projects.com>
* bbb
diff -rN -u old-test/file new-test/file
--- old-test/file 2008-07-22 16:14:57.000000000 +0300
+++ new-test/file 2008-07-22 16:14:57.000000000 +0300
@@ -1 +1,2 @@
aaa
+bbb
dawn:~/work/test$ darcs tag release-1
Finished tagging patch 'TAG release-1'
dawn:~/work/test$ darcs optimize
Done optimizing!
dawn:~/work/test$ echo "ccc" >> file
dawn:~/work/test$ darcs record -a -m "ccc"
Finished recording patch 'ccc'
dawn:~/work/test$ darcs diff --patch "ccc"
Tue Jul 22 16:15:48 EEST 2008 Dan Pascu <dan at ag-projects.com>
* ccc
diff -rN -u old-test/file new-test/file
--- old-test/file 2008-07-22 16:15:53.000000000 +0300
+++ new-test/file 2008-07-22 16:15:53.000000000 +0300
@@ -1,2 +1,3 @@
aaa
bbb
+ccc
dawn:~/work/test$ darcs diff --patch "aaa"
Tue Jul 22 16:14:41 EEST 2008 Dan Pascu <dan at ag-projects.com>
* aaa
dawn:~/work/test$ darcs diff --patch "bbb"
Tue Jul 22 16:14:49 EEST 2008 Dan Pascu <dan at ag-projects.com>
* bbb
dawn:~/work/test$
-------------------------------------------------------------
As it can be seen from the example above, the aaa and bbb diffs show up
just fine before the tree is optimized (using the release-1 tag). After
that only the ccc record (which was created after the optimization) shows
the diff correctly, while the aaa and bbb records only show thir title,
but not the actual diff.
This happens with darcs 2.0.0 and darcs 2.0.2 on a debian unstable system.
Reverting to darcs 1.0.9 fixes the problem.
Is this a known issue, or is it the new intended behavior? In the later
case how can I still get older diffs for which the inventory was already
archived to _darcs/inventorties/ after an optimization?
P.S.
trying darcs diff --from-patch "bbb" --to-patch "bbb" has the same problem
dawn:~/work/test$ darcs diff --from-patch "bbb" --to-patch "bbb"
Tue Jul 22 16:14:49 EEST 2008 Dan Pascu <dan at ag-projects.com>
* bbb
dawn:~/work/test$
but it seems that darcs diff --last N works correctly:
dawn:~/work/test$ darcs diff --last 4
Tue Jul 22 16:15:48 EEST 2008 Dan Pascu <dan at ag-projects.com>
* ccc
Tue Jul 22 16:15:23 EEST 2008 Dan Pascu <dan at ag-projects.com>
tagged release-1
Tue Jul 22 16:14:49 EEST 2008 Dan Pascu <dan at ag-projects.com>
* bbb
Tue Jul 22 16:14:41 EEST 2008 Dan Pascu <dan at ag-projects.com>
* aaa
diff -rN -u old-test/file new-test/file
--- old-test/file 1970-01-01 02:00:00.000000000 +0200
+++ new-test/file 2008-07-22 16:28:45.000000000 +0300
@@ -0,0 +1,3 @@
+aaa
+bbb
+ccc
dawn:~/work/test$
--
Dan
More information about the darcs-users
mailing list