[Cl-darcs-cvs] r178 - cl-darcs/trunk
Author: mhenoch Date: Sun Mar 23 19:08:39 2008 New Revision: 178 Modified: cl-darcs/trunk/repo.lisp Log: GET-COMMON-AND-UNCOMMON returns patchinfo in correct order Modified: cl-darcs/trunk/repo.lisp ============================================================================== --- cl-darcs/trunk/repo.lisp (original) +++ cl-darcs/trunk/repo.lisp Sun Mar 23 19:08:39 2008 @@ -167,8 +167,16 @@ THEIRS." ;; Of course, there are possible optimizations here, in particular ;; regarding tags, but this will do for now. - (let ((ours-list (apply #'append (reverse ours))) - (theirs-list (apply #'append (reverse theirs)))) - (values (intersection ours-list theirs-list :test #'equalp) - (set-difference ours-list theirs-list :test #'equalp) - (set-difference theirs-list ours-list :test #'equalp)))) + (setf ours (apply #'append (reverse ours))) + (setf theirs (apply #'append (reverse theirs))) + (let (common-patches our-patches their-patches) + (loop + for ou on ours and th on theirs + while (equalp (car ou) (car th)) + collect (car ou) into common + finally + (setf common-patches common + our-patches ou + their-patches th)) + (values common-patches our-patches their-patches))) +
participants (1)
-
mhenoch@common-lisp.net