[svk-commit] r2970 - trunk/lib/SVK/Merge

nobody at bestpractical.com nobody at bestpractical.com
Sun Jul 6 04:17:19 EDT 2008


Author: ruz
Date: Sun Jul  6 04:17:18 2008
New Revision: 2970

Modified:
   trunk/lib/SVK/Merge/Info.pm

Log:
* add is_equal method in SVK::Merge::Info

Modified: trunk/lib/SVK/Merge/Info.pm
==============================================================================
--- trunk/lib/SVK/Merge/Info.pm	(original)
+++ trunk/lib/SVK/Merge/Info.pm	Sun Jul  6 04:17:18 2008
@@ -156,6 +156,25 @@
     return 1;
 }
 
+=item is_equal
+
+Takes a single L<SVK::Merge::Info> object as an argument.  Returns true if
+our set of merge tickets is equal to argument's. Otherwise, returns false.
+
+=cut
+
+sub is_equal {
+    my ( $self, $other ) = @_;
+    my $subset = 1;
+    for ( keys %$self, keys %$other ) {
+        return 0 unless
+            exists $other->{$_}
+            && exists $self->{$_}
+            && $self->{$_}{rev} == $other->{$_}{rev};
+    }
+    return 1;
+}
+
 =item union
 
 Return a new L<SVK::Merge::Info> object representing the union of ourself and


More information about the svk-commit mailing list