On 8/26/2009 18:12, Taylor R Campbell wrote:
Thanks.  I am glad to hear that there has been some thought put into
this.  I was thinking of sorting the output of `darcs changes --xml'
so that differences introduced by different pull orders, or by `darcs
optimize --reorder', would be ignored.

That sounds roughly like my idea for a naive context-comparison tool. With ``darcs changes --xml`` you can do it even faster: just build a set of the patch hashes for each repository and check that the sets match.

In very simple, untested Python 2.6 code against using my darcs wrapper module:

from darcsforge.darcs import DarcsRepository
import sys

if len(sys.argv) < 3:
  print "Usage: repoeq.py repo1dir repo2dir"
  sys.exit(1)

darcs = DarcsRepository(sys.argv[1])
r1patches = set(patch["hash"] for patch in darcs.changes())
darcs = DarcsRepository(sys.argv[2])
r2patches = set(patch["hash"] for patch in darcs.changes())
diff = r1patches.symmetric_difference(r2patches)

if len(diff) < 1:
  print "Repositories are equivalent."
else:
  print "Repositories are not equivalent. Differences:"
  print
  for hash in diff:
    print hash

But it does not appear that
any unique identifier for the structure of patches is included in the
output of `darcs changes --xml', so that it does not securely identify
the state of a repository; and intuitively I imagine that procuring
some such unique identifier may be tricky if patches are commuted.

That is indeed what most of the discussion is about.

--
--Max Battcher--
http://worldmaker.net
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to