Update mapping specs wrt revisions properties.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 25 Aug 2007 22:59:32 +0000 (00:59 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 25 Aug 2007 22:59:32 +0000 (00:59 +0200)
mapping.txt
repository.py

index 51eb5f4ce969beee645c3b447232cc6d02212d69..c0db011b3959e1d4536409705f5a36bdd2bd5113 100644 (file)
@@ -1,6 +1,6 @@
 This document specifies mapping between Subversion and Bazaar semantics.
 
-Revision: 3
+Revision: 4
 Written by Jelmer Vernooij <jelmer@samba.org>
 
 ============
@@ -62,12 +62,12 @@ stored in a revision property. To guarantee that the meaning of a revision id
 does not change, this revision id is only valid within a specific version 
 of the mappings.
 
-To override the revision id this way, set the revision property:
+To override the revision id this way, set the branch path file property:
 
 bzr:revision-id-v%d:%s (where %d is the current mapping version and %s is 
                                            the name of the branching scheme in use) 
 
-to the bzr revision number following by a space and the revision id. This o
+to the bzr revision number following by a space and the revision id. This 
 property should only be honored for the revision in which it was set, as 
 subversion will not erase the property for subsequent commits.
 
@@ -76,6 +76,11 @@ A (path,revnum) tuple is valid if:
 * either path,revnum or one of its children was touched in the particular 
   revision
 
+If possible, the Subversion revision property ``bzr:revision-id`` should be 
+set to the revision id. The revision property ``bzr:root`` should be set to 
+the root path of the revision and revision property ``bzr:scheme`` should be 
+set to the name of the branching scheme.
+
 ========
 File ids
 ========
@@ -94,8 +99,8 @@ The same rules apply to the roots of branches. This means there is no
 predefined file id for tree roots.
 
 Alternatively, these file ids can be mapped to more specific file ids. Such 
-a map should be stored in the 'bzr:file-ids' property that is set on the 
-branch path.
+a map should be stored in the 'bzr:file-ids' file property that is set on the 
+branch path and, if possible, as revision property ``bzr:file-ids``.
 
 The bzr:file-ids property should contain a list of mappings. Entries are 
 separated by newlines. The path in the branch and new file-id are separated 
@@ -149,8 +154,8 @@ Ancestry Information
 ====================
 
 Ancestry in Subversion is linear. Most revisions have just one parent. Files 
-can be copied, moved or merged from other branches, which can result in partial merges 
-that bzr doesn't support at the moment.
+can be copied, moved or merged from other branches, which can result in partial 
+merges that bzr doesn't support at the moment.
 
 Whenever a Bazaar commit to Subversion has more than one parent (merges two 
 revisions), it will add a line to the 'bzr:ancestry:vX-SCHEME' property set on 
@@ -158,6 +163,9 @@ the branch path. The format of these lines is:
 
 ([\tPARENT-REV-ID]+)\n
 
+If possible, the list of merges will also be stored in the Subversion revision 
+property ``bzr:merges``. 
+
 This property should be considered add-only. This way, it is 
 possible to know the parents of a revision when running checkout or 
 diff, because the Subversion API will mark the property as modified. The 
@@ -179,10 +187,19 @@ for this yet.
 Revision properties
 ===================
 
-Bazaar revision metadata is stored in a Subversion revision property 
+If possible, the Bazaar revision metadata should be stored in Subversion 
+revision properties. The names of the revision properties are:
+
+- committer: ``bzr:committer``
+- timestamp: ``svn:original-date``
+
+All custom revision properties are prefixed by ``bzr:revprop:``
+
+Bazaar revision metadata is also stored in a Subversion revision property 
 ``bzr:revision-info``. The format of this property is the same as used 
 by version 0.9 of the bundle format.
 
+
 ==========
 Signatures
 ==========
@@ -207,6 +224,8 @@ and added the bzr:revision-id-vX:YY property.
 Revision 3 uses real file ids for the tree root rather than the hardcoded 
 "TREE_ROOT" and adds the file id map.
 
+Revision 4 adds revision properties in addition to file properties.
+
 =======
 Authors
 =======
index ab94f1dd8f66be01ca70dce372ac6bd95acc6d8b..e1289d2fe236b3ba859f160038d7c30482345a4d 100644 (file)
@@ -53,10 +53,18 @@ SVN_PROP_BZR_FILEIDS = 'bzr:file-ids'
 SVN_PROP_BZR_MERGE = 'bzr:merge'
 SVN_PROP_SVK_MERGE = 'svk:merge'
 SVN_PROP_BZR_REVISION_INFO = 'bzr:revision-info'
-SVN_REVPROP_BZR_SIGNATURE = 'bzr:gpg-signature'
 SVN_PROP_BZR_REVISION_ID = 'bzr:revision-id:v%d-' % MAPPING_VERSION
 SVN_PROP_BZR_BRANCHING_SCHEME = 'bzr:branching-scheme'
 
+SVN_REVPROP_BZR_COMMITTER = 'bzr:committer'
+SVN_REVPROP_BZR_FILEIDS = 'bzr:file-ids'
+SVN_REVPROP_BZR_MERGE = 'bzr:merge'
+SVN_REVPROP_BZR_REVISION_ID = 'bzr:revision-id'
+SVN_REVPROP_BZR_REVPROP_PREFIX = 'bzr:revprop:'
+SVN_REVPROP_BZR_ROOT = 'bzr:root'
+SVN_REVPROP_BZR_SCHEME = 'bzr:scheme'
+SVN_REVPROP_BZR_SIGNATURE = 'bzr:gpg-signature'
+
 # The following two functions don't use day names (which can vary by 
 # locale) unlike the alternatives in bzrlib.timestamp
 
@@ -626,7 +634,8 @@ class SvnRepository(Repository):
                 self.branchprop_list.get_property(path, revnum, 
                      SVN_PROP_BZR_REVISION_INFO, ""), rev)
 
-        rev.inventory_sha1 = property(lambda: self.get_inventory_sha1(revision_id))
+        rev.inventory_sha1 = property(
+            lambda: self.get_inventory_sha1(revision_id))
 
         return rev