darcs

Patch 118 Resolve issue1712: darcs over-reports number of patches to pull

Title Resolve issue1712: darcs over-reports number of patches to pull
Superseder Nosy List dagit, darcs-users, ganesh, kowey, volothamp
Related Issues
Status accepted Assigned To volothamp
Milestone

Created on 2009-12-14.22:29:43 by volothamp, last changed 2011-05-10.20:35:37 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
_issue1712_-darcs-over_reports-number-of-patches-to-pull.dpatch volothamp, 2009-12-14.22:29:41 text/x-darcs-patch
resolve-issue1712_-darcs-over_reports-number-of-patches-to-pull.dpatch volothamp, 2009-12-16.23:08:45 text/x-darcs-patch
unnamed volothamp, 2009-12-14.22:29:41 text/plain
unnamed volothamp, 2009-12-16.23:08:45 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg9631 (view) Author: volothamp Date: 2009-12-14.22:29:41
Mon Dec 14 23:04:59 CET 2009  Luca Molteni <volothamp@gmail.com>
  * [issue1712] darcs over-reports number of patches to pull
Attachments
msg9632 (view) Author: kowey Date: 2009-12-14.22:49:30
On Mon, Dec 14, 2009 at 22:29:43 +0000, Luca Molteni wrote:
> Mon Dec 14 23:04:59 CET 2009  Luca Molteni <volothamp@gmail.com>
>   * [issue1712] darcs over-reports number of patches to pull

The patch looks good to me : rather than reporting the total number of
patches retrieved from the remote repository (perhaps since the last
shared inventory?), we report the number of patches they have that we
don't.

Small request, Luca: please

 1. darcs amend --edit the patch and change the title to

     'Resolve issue1712: darcs over-reports number of patches to pull'

 2. darcs send --subject '[patch118]'

I know the patch tracker has been a real pain for you.  Sorry for that!

We're aiming for a tracker that works without patch submitters having to
think about what they're doing.  Mostly, we've got what we want; it's
just that you managed to hit another corner case with your patch name
:-(

I'm pretty sure that it's just you being unlucky recently, first with
the not-yet-refined tracker during the sprint and now with this patch
subject that confused the tracker.

I hope you'll stay on and keep sending patches to see what we mean.
It's normally not so tricky! 

[issue1712] darcs over-reports number of patches to pull
--------------------------------------------------------
> Luca Molteni <volothamp@gmail.com>**20091214220459
>  Ignore-this: cc850a480e916e230d2873d927de1947
> ] hunk ./src/Darcs/Commands/Push.lhs 126
>         in  putInfo opts $ text $ pushing++" to "++formatPath repodir++"..."
>    us <- read_repo repository
>    case get_common_and_uncommon (us, them) of
> -    (common, us' :\/: _) -> do
> -      prePushChatter opts common us us' them
> +    (common, us' :\/: them') -> do
> +      prePushChatter opts common us us' them them'
>        with_selected_changes "push" opts Nothing (reverseRL us') $ bundlePatches opts common
>  
>  prePushChatter :: forall p a C(x y z t) . (ShowPatch a) =>
> hunk ./src/Darcs/Commands/Push.lhs 132
>                   [DarcsFlag] -> [PatchInfo] -> PatchSet p C(x) ->
> -                 RL a C(y z) -> PatchSet p C(t) -> IO ()
> -prePushChatter opts common us us' them = do
> +                 RL a C(y z) -> PatchSet p C(t) -> RL a C(x y) -> IO ()
> +prePushChatter opts common us us' them them' = do
>    checkUnrelatedRepos opts common us them
> hunk ./src/Darcs/Commands/Push.lhs 135
> -  let num_to_pull = lengthRL them
> +  let num_to_pull = lengthRL them'
>    let pull_reminder = if num_to_pull > 0
>                        then text $ "The remote repository has " ++ show num_to_pull 
>                        ++ " " ++ englishNum num_to_pull (Noun "patch") " to pull."
> 

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
msg9642 (view) Author: volothamp Date: 2009-12-16.23:08:45
Thu Dec 17 00:07:45 CET 2009  Luca Molteni <volothamp@gmail.com>
  * Resolve issue1712: darcs over-reports number of patches to pull
Attachments
msg9645 (view) Author: kowey Date: 2009-12-17.09:25:50
Whoops!  I confess that I tried to push this without paying close attention to 
the witness types (bad reviewer! no cookie for me!)

src/Darcs/Commands/Push.lhs:127:45:
    Couldn't match expected type `r' against inferred type `z'
      `r' is a rigid type variable bound by
          the type signature for `prepareBundle'
            at src/Darcs/Commands/Push.lhs:115:26
      `z' is a rigid type variable bound by
          the constructor `:\/:' at src/Darcs/Commands/Push.lhs:126:13
      Expected type: RL (PatchInfoAnd p) r z
      Inferred type: RL (PatchInfoAnd p) z r
    In the sixth argument of `prePushChatter', namely `them''
    In the expression: prePushChatter opts common us us' them them'

I think this is a straightforward issue that only requires thinking about what 
the witnesses mean.

Ganesh or Jason, depending on who gets to this first.  Could you help Luca out 
since you two have more experience with this?  Luca: in the meantime, it may be 
good if you tried to study this as well.

Ah, and one day the witness stuff will be turned on everywhere and we can avoid 
this back and forth stuff.
msg9648 (view) Author: ganesh Date: 2009-12-19.16:53:55
I've fixed the witnesses and pushed without further review, as (a) it was quite
simple and obvious, and (b) the whole point of witnesses is that the type
checker does the work for us :-)

I think the type error was fairly self-explanatory once you look at the types of
the inputs to prePushChatter, which are themselves generated by
get_command_and_uncommon. I just had to change the witness types in
prePushChatter to match up with that appropriately. In theory prePushChatter
could have a more general type than I gave it, but there seems no point.
msg9649 (view) Author: darcswatch Date: 2009-12-19.17:05:33
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-5f24512f8eb515d3b4bb5e9fe8cc1417ee77d503
msg14183 (view) Author: darcswatch Date: 2011-05-10.19:36:23
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-5f24512f8eb515d3b4bb5e9fe8cc1417ee77d503
History
Date User Action Args
2009-12-14 22:29:43volothampcreate
2009-12-14 22:31:11darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3f0cbdbe310ba694eaed71d66e2e81057c14046a
2009-12-14 22:49:31koweysetstatus: needs-review -> followup-requested
nosy: + kowey
messages: + msg9632
2009-12-15 11:27:39koweysetassignedto: volothamp
2009-12-16 23:08:47volothampsetfiles: + resolve-issue1712_-darcs-over_reports-number-of-patches-to-pull.dpatch, unnamed
messages: + msg9642
2009-12-16 23:10:05darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3f0cbdbe310ba694eaed71d66e2e81057c14046a -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-5f24512f8eb515d3b4bb5e9fe8cc1417ee77d503
2009-12-17 09:25:51koweysetnosy: + dagit, ganesh
messages: + msg9645
2009-12-19 16:53:56ganeshsetmessages: + msg9648
2009-12-19 17:05:35darcswatchsetstatus: followup-requested -> accepted
messages: + msg9649
2011-05-10 19:36:23darcswatchsetmessages: + msg14183
2011-05-10 20:35:37darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-5f24512f8eb515d3b4bb5e9fe8cc1417ee77d503 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3f0cbdbe310ba694eaed71d66e2e81057c14046a