[darcs-users] darcs patch: Add get_unrecorded_in_files_unsorted fun... (and 6 more)

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Sun Mar 22 22:49:18 UTC 2009


Hi Eric, Reinier.

Patches look good to me except for minor comments below.

Regards,
  Dmitry

Add get_unrecorded_in_files_unsorted function
---------------------------------------------
Reinier Lamers <tux_rocker at reinier.de>**20090320220829

hunk ./src/Darcs/Repository/Internal.hs 398
>  get_unrecorded_no_look_for_adds r paths = get_unrecorded_private (filter (/= LookForAdds)) r paths
>
>  get_unrecorded_unsorted :: RepoPatch p => Repository p C(r u t) -> IO (FL Prim C(r u))
> -get_unrecorded_unsorted r = get_unrecorded_private (AnyOrder:) r []
> +get_unrecorded_unsorted r = get_unrecorded_in_files_unsorted r []
>
>  get_unrecorded :: RepoPatch p => Repository p C(r u t) -> IO (FL Prim C(r u))
>  get_unrecorded r = get_unrecorded_private id r []

I think both get_unrecorded_unsorted and get_unrecorded should be
changed to use get_unrecorded_in_files_unsorted and
get_unrecorded_in_files. Or both left as is. Changing just one is a
bit misleading.

Make record look only at cmdline arg files, if any
--------------------------------------------------
Reinier Lamers <tux_rocker at reinier.de>**20090320221832

hunk ./src/Darcs/Commands/Record.lhs 38
>  import Darcs.Lock ( readBinFile, writeBinFile, world_readable_temp, appendToFile, removeFileMayNotExist )
>  import Darcs.Hopefully ( info, n2pia )
>  import Darcs.Repository ( Repository, amInRepository, withRepoLock, ($-),
> -                          get_unrecorded, get_unrecorded_unsorted, withGutsOf,
> +                          get_unrecorded_in_files,
> +                          get_unrecorded_in_files_unsorted, withGutsOf,
>                      sync_repo, read_repo,
>                      slurp_recorded,
>                      tentativelyAddPatch, finalizeRepositoryChanges,

Fix intentation while we are here? What is the policy on this?

Use get_unrecorded_in_files_unsorted in changes command
-------------------------------------------------------
Reinier Lamers <tux_rocker at reinier.de>**20090321152616

hunk ./src/Darcs/Commands/Changes.lhs 113
>    withRepositoryDirectory opts repodir $- \repository -> do
>    unless (Debug `elem` opts) $ setProgressMode False
>    files <- sort `fmap` fixSubPaths opts args
> -  unrec <- get_unrecorded_unsorted repository
> +  unrec <- get_unrecorded_in_files_unsorted repository (map (fp2fn . toFilePath) files)
>             `catch` \_ -> return identity -- this is triggered when repository is remote
>    let filez = map (fn2fp . norm_path . fp2fn) $ apply_to_filepaths (invert unrec) $ map toFilePath files
>        filtered_changes p = maybe_reverse $ get_changes_info opts filez p

Use sp2fn instead of (fp2fn . toFilePath) just like in record command.


More information about the darcs-users mailing list