Eric Kow <[email protected]> added the comment:

Same as before but with 'Resolve issue1290' amended as requested.

6 patches for repository http://darcs.net/releases/branch-2.5:

Thu Aug  5 13:45:59 BST 2010  Eric Kow <[email protected]>
  * Accept issue1290: darcs diff --index support.

Fri Aug 13 18:50:23 BST 2010  Eric Kow <[email protected]>
  * Fix issue1290 test.
  I forgot that we count backwards.  I also try to introduce some asymmetry here
  to make it a bit clearer we're not accidentally passing.

Fri Aug 13 19:10:25 BST 2010  Eric Kow <[email protected]>
  * Resolve issue1290: support diff --index.
  
  While the matching code knew how to identify the context and
  fluff patches matchFirstPatchset and matchSecondPatchset),
  it did not actually know how to unapply them (getFirstMatch
  and getPartialSecondMatch).

Fri Aug 13 17:47:59 BST 2010  Eric Kow <[email protected]>
  * Move Darcs.Match module-specific haddock to module level.
  Also correct last_match to secondMatch.

Fri Aug 13 18:10:53 BST 2010  Eric Kow <[email protected]>
  * Improve module-level documentation for Darcs.Match.

Fri Aug 13 18:22:44 BST 2010  Eric Kow <[email protected]>
  * Reframe Darcs.Match.matchFirstPatchset documentation.
  This says the same thing but hopefully makes it easier to grasp.


___________________________________________________________
This email has been scanned by MessageLabs' Email Security
System on behalf of the University of Brighton.
For more information see http://www.brighton.ac.uk/is/spam/
___________________________________________________________

__________________________________
Darcs bug tracker <[email protected]>
<http://bugs.darcs.net/patch347>
__________________________________
New patches:

[Accept issue1290: darcs diff --index support.
Eric Kow <[email protected]>**20100805124559
 Ignore-this: 560bf7125a441de79f0939e5851b95ed
] addfile ./tests/failing-issue1290-diff-index.sh
hunk ./tests/failing-issue1290-diff-index.sh 1
+#!/usr/bin/env bash
+## Test for issue1290 - darcs diff --index
+##
+## Public domain - 2010 Eric Kow
+
+. lib                           # Load some portability helpers.
+rm -rf R                        # Another script may have left a mess.
+darcs init      --repo R        # Create our test repos.
+
+cd R
+ echo '1' > f
+ darcs record -lam 'one'
+ echo '2' > f
+ darcs record -lam 'two'
+ echo '3' > f
+ darcs record -lam 'three'
+ darcs diff --from-patch one --to-patch two > d1
+ darcs diff --index=1-2 > d2
+ diff -q d1 d2
+cd ..
[Fix issue1290 test.
Eric Kow <[email protected]>**20100813175023
 Ignore-this: f39af18caec1b640eccfce1d67f40e8a
 I forgot that we count backwards.  I also try to introduce some asymmetry here
 to make it a bit clearer we're not accidentally passing.
] hunk ./tests/failing-issue1290-diff-index.sh 17
  darcs record -lam 'two'
  echo '3' > f
  darcs record -lam 'three'
+ echo '4' > f
+ darcs record -lam 'four'
  darcs diff --from-patch one --to-patch two > d1
hunk ./tests/failing-issue1290-diff-index.sh 20
- darcs diff --index=1-2 > d2
+ darcs diff --index=3-4 > d2 # the numbers go backwards
  diff -q d1 d2
 cd ..
[Resolve issue1290: support diff --index.
Eric Kow <[email protected]>**20100813181025
 Ignore-this: 1b663983c67a17f09298c74dc5f2c803
 
 While the matching code knew how to identify the context and
 fluff patches matchFirstPatchset and matchSecondPatchset),
 it did not actually know how to unapply them (getFirstMatch
 and getPartialSecondMatch).
] move ./tests/failing-issue1290-diff-index.sh ./tests/issue1290-diff-index.sh
hunk ./src/Darcs/Match.lhs 167
                      [DarcsFlag] -> PatchSet p C(Origin x) -> IO ()
 getFirstMatchS fs repo =
     case hasLastn fs of
-    Just n -> applyInvRL `unsealFlipped` (safetake n $ newset2RL repo)
-    Nothing -> case firstMatcher fs of
+    Just n -> unpullLastN repo n
+    Nothing ->
+     case hasIndexRange fs of
+     Just (_,b) -> unpullLastN repo b -- b is chronologically earlier than a
+     Nothing    ->
+      case firstMatcher fs of
                Nothing -> fail "Pattern not specified in getFirstMatch."
                Just m -> if firstMatcherIsTag fs
                          then getTagS m repo
hunk ./src/Darcs/Match.lhs 177
                          else getMatcherS Inclusive m repo
-
 
 -- | @secondMatch fs@ tells whether @fs@ implies a "second match", that
 -- is if we match against patches up to a point in the past on, rather
hunk ./src/Darcs/Match.lhs 189
 getPartialSecondMatch r fs _ =
     withRecordedMatch r $ \repo ->
     case secondMatcher fs of
-    Nothing -> fail "Two patterns not specified in get_second_match."
+    Nothing -> case hasIndexRange fs of
+                Just (a,_) -> unpullLastN repo (a-1)
+                Nothing    -> fail "Two patterns not specified in get_second_match."
     Just m -> if secondMatcherIsTag fs
               then getTagS m repo
               else getMatcherS Exclusive m repo
hunk ./src/Darcs/Match.lhs 195
+
+unpullLastN :: Patchy p => PatchSet p C(x y) -> Int -> IO ()
+unpullLastN repo n = applyInvRL `unsealFlipped` (safetake n $ newset2RL repo)
 
 checkMatchSyntax :: [DarcsFlag] -> IO ()
 checkMatchSyntax opts = do
[Move Darcs.Match module-specific haddock to module level.
Eric Kow <[email protected]>**20100813164759
 Ignore-this: fad00c742590d0775a57bc3ec4878efe
 Also correct last_match to secondMatch.
] hunk ./src/Darcs/Match.lhs 24
 
 #include "gadts.h"
 
+-- | /First matcher, Second matcher and Nonrange matcher/
+--
+-- When we match for patches, we have a PatchSet, of which we want a
+-- subset. This subset is formed by the patches in a given interval
+-- which match a given criterion. If we represent time going left to
+-- right (which means the 'PatchSet' is written right to left), then
+-- we have (up to) three 'Matcher's: the 'nonrangeMatcher' is the
+-- criterion we use to select among patches in the interval, the
+-- 'firstMatcher' is the left bound of the interval, and the
+-- 'secondMatcher' is the right bound. Each of these matchers can be
+-- present or not according to the options.
 module Darcs.Match ( matchFirstPatchset, matchSecondPatchset,
                matchPatch,
                matchAPatch, matchAPatchread,
hunk ./src/Darcs/Match.lhs 236
 -- | strictJust is a strict version of the Just constructor, used to ensure
 -- that if we claim we've got a pattern match, that the pattern will
 -- actually match (rathern than fail to compile properly).
---
--- /First matcher, Second matcher and Nonrange matcher/
---
--- When we match for patches, we have a PatchSet, of which we want a
--- subset. This subset is formed by the patches in a given interval
--- which match a given criterion. If we represent time going left to
--- right (which means the 'PatchSet' is written right to left), then
--- we have (up to) three 'Matcher's: the 'nonrangeMatcher' is the
--- criterion we use to select among patches in the interval, the
--- 'firstMatcher' is the left bound of the interval, and the
--- 'last_matcher' is the right bound. Each of these matchers can be
--- present or not according to the options.
 strictJust :: a -> Maybe a
 strictJust x = Just $! x
 
[Improve module-level documentation for Darcs.Match.
Eric Kow <[email protected]>**20100813171053
 Ignore-this: c58ea6edfd1e1a6f1e18d13c5dd70ff
] hunk ./src/Darcs/Match.lhs 29
 -- When we match for patches, we have a PatchSet, of which we want a
 -- subset. This subset is formed by the patches in a given interval
 -- which match a given criterion. If we represent time going left to
--- right (which means the 'PatchSet' is written right to left), then
--- we have (up to) three 'Matcher's: the 'nonrangeMatcher' is the
--- criterion we use to select among patches in the interval, the
--- 'firstMatcher' is the left bound of the interval, and the
--- 'secondMatcher' is the right bound. Each of these matchers can be
--- present or not according to the options.
+-- right, then we have (up to) three 'Matcher's:
+--
+-- * the 'firstMatcher' is the left bound of the interval,
+--
+-- * the 'secondMatcher' is the right bound, and
+--
+-- * the 'nonrangeMatcher' is the criterion we use to select among
+--   patches in the interval.
+---
+-- Each of these matchers can be present or not according to the
+-- options. The patches we want would then be the ones that all
+-- present matchers have in common.
+--
+-- (Implementation note: keep in mind that the PatchSet is written
+-- backwards with respect to the timeline, ie., from right to left)
 module Darcs.Match ( matchFirstPatchset, matchSecondPatchset,
                matchPatch,
                matchAPatch, matchAPatchread,
[Reframe Darcs.Match.matchFirstPatchset documentation.
Eric Kow <[email protected]>**20100813172244
 Ignore-this: b78a42d6dcc56a12eedebc31c6e82641
 This says the same thing but hopefully makes it easier to grasp.
] hunk ./src/Darcs/Match.lhs 357
 
 -- | @matchFirstPatchset fs ps@ returns the part of @ps@ before its
 -- first matcher, ie the one that comes first dependencywise. Hence,
--- patches in @matchFirstPatchset fs ps@ are the ones we don't want.
---
--- Question: are they really? Florent
+-- patches in @matchFirstPatchset fs ps@ are the context for the ones
+-- we don't want.
 matchFirstPatchset :: RepoPatch p => [DarcsFlag] -> PatchSet p C(start x)
                    -> SealedPatchSet p C(start)
 matchFirstPatchset fs patchset =

Context:

[Also set binary mode on stderr (duplicate for 2.5 branch)
Reinier Lamers <[email protected]>**20100810193256
 Ignore-this: 5f1ed1efaff91967b340cfc51afa6ac5
] 
[Export usageHelper
Joachim Breitner <[email protected]>**20100803173150
 Ignore-this: 763398f4ab6b99a59de7666940103daa
 usage is darcs-specific, while usageHelper is not. ipatch could use
 usageHelper.
] 
[Make Darcs.RunCommand independent of Darcs.Commands.Help
Joachim Breitner <[email protected]>**20100803165917
 Ignore-this: 744025a59cdd9ad52595b65d989a638a
 by passing commandControlList via main.hs. This allows re-use of
 Darcs.RunCommand by other binaries with a different set of commands.
] 
[Do not fail when there's debris in tests directory.
Petr Rockai <[email protected]>**20100807192133
 Ignore-this: d1fdf93fbed39e3a20bb8d4129dbd4d4
] 
[Restyle issue1873 test and make it run in darcs 2.4.
Eric Kow <[email protected]>**20100807171741
 Ignore-this: 32d1c90bbb45ab91fd3803dc513bc751
 Just to confirm the regression...
] 
[Add test for issue1873 (failed to read patch during apply).
Petr Rockai <[email protected]>**20100807163013
 Ignore-this: 2396ff7f429204f6f10079fb32799e32
] 
[Resolve issue1873: give nicer error when apply fails due to missing patches.
Petr Rockai <[email protected]>**20100804204010
 Ignore-this: b3ddfddeaa7e089717256aa2344ba78c
] 
[remove dead code
Ganesh Sittampalam <[email protected]>**20100708055640
 Ignore-this: 86104cf3f14952869be820f66f156fbb
] 
[Rename findCommonAndUncommon to findUncommon (it does not find common).
Petr Rockai <[email protected]>**20100804195738
 Ignore-this: 8257db493418179be45fad17ab6ffd8e
] 
[Resolve issue1892: Improve safety of makeBundle* and fix a couple of related bugs.
Petr Rockai <[email protected]>**20100715093842
 Ignore-this: 9eaa26edfdda09ac444f124130b9e74b
] 
[Remove [DarcsFlag] usage from Darcs.Patch.Bundle.
Petr Rockai <[email protected]>**20100715081908
 Ignore-this: 62297671dea56fdc0a1cac42f79d6d29
] 
[Remove unused imports in Darcs.Commands.Changes
Reinier Lamers <[email protected]>**20100802181249
 Ignore-this: 87d2c72fc74e4442f146d896296fb0db
] 
[Resolve issue1888: fix changes --context.
Petr Rockai <[email protected]>**20100729185143
 Ignore-this: eed1a926b468492198547c438a85e2c9
] 
[TAG 2.4.98.2
Reinier Lamers <[email protected]>**20100726184946
 Ignore-this: 43a9f17e811c2172be76fb1b19aa1497
] 
Patch bundle hash:
c9ac30a553573edcdde7d33eff02fd65da497aca

Attachment: unnamed
Description: Binary data

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

Reply via email to