You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/06/29 21:52:13 UTC

svn commit: r1498004 - in /subversion/branches/fsfs-format7/subversion/libsvn_fs_fs: id.c id.h

Author: stefan2
Date: Sat Jun 29 19:04:19 2013
New Revision: 1498004

URL: http://svn.apache.org/r1498004
Log:
On the fsfs-format7 branch: Provide a comparator function for ID parts.

* subversion/libsvn_fs_fs/id.h
  (svn_fs_fs__id_compare): declare new private API

* subversion/libsvn_fs_fs/id.c
  (svn_fs_fs__id_compare): implement it

Modified:
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c
    subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c?rev=1498004&r1=1498003&r2=1498004&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.c Sat Jun 29 19:04:19 2013
@@ -322,6 +322,18 @@ svn_fs_fs__id_compare(const svn_fs_id_t 
   return (svn_fs_fs__id_check_related(a, b) ? 1 : -1);
 }
 
+int
+svn_fs_fs__id_part_compare(const svn_fs_fs__id_part_t *a,
+                           const svn_fs_fs__id_part_t *b)
+{
+  if (a->revision < b->revision)
+    return -1;
+  if (a->revision > b->revision)
+    return 1;
+
+  return a->number < b->number ? -1 : a->number == b->number ? 0 : 1;
+}
+
 
 
 /* Creating ID's.  */

Modified: subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h
URL: http://svn.apache.org/viewvc/subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h?rev=1498004&r1=1498003&r2=1498004&view=diff
==============================================================================
--- subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h (original)
+++ subversion/branches/fsfs-format7/subversion/libsvn_fs_fs/id.h Sat Jun 29 19:04:19 2013
@@ -112,6 +112,10 @@ svn_boolean_t svn_fs_fs__id_check_relate
 int svn_fs_fs__id_compare(const svn_fs_id_t *a,
                           const svn_fs_id_t *b);
 
+/* Return 0 if A and B are equal, 1 if A is "greater than" B, -1 otherwise. */
+int svn_fs_fs__id_part_compare(const svn_fs_fs__id_part_t *a,
+                               const svn_fs_fs__id_part_t *b);
+
 /* Create the txn root ID for transaction TXN_ID.  Allocate it in POOL. */
 svn_fs_id_t *svn_fs_fs__id_txn_create_root(const svn_fs_fs__id_part_t *txn_id,
                                            apr_pool_t *pool);