darcs

Patch 197 reuse is_tag

Title reuse is_tag
Superseder Nosy List darcs-users, gh, kowey, mornfall
Related Issues
Status obsoleted Assigned To
Milestone

Created on 2010-03-21.14:00:23 by gh, last changed 2011-05-10.22:06:32 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
reuse-is_tag.dpatch gh, 2010-03-21.14:00:23 text/x-darcs-patch
reuse-is_tag.dpatch gh, 2010-03-21.14:33:13 text/x-darcs-patch
reuse-is_tag.dpatch gh, 2010-03-21.14:43:41 text/x-darcs-patch
unnamed gh, 2010-03-21.14:00:23 text/plain
unnamed gh, 2010-03-21.14:33:13 text/plain
unnamed gh, 2010-03-21.14:43:41 text/plain
unnamed gh, 2010-03-21.14:53:29 text/plain
use-isprefixof-instead-of-take-x-y-__-_string_-in-some-places.dpatch gh, 2010-03-21.14:53:29 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg10372 (view) Author: gh Date: 2010-03-21.14:00:23
1 patch for repository http://darcs.net:

Sun Mar 21 14:54:31 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * reuse is_tag
Attachments
msg10384 (view) Author: gh Date: 2010-03-21.14:33:13
2 patches for repository http://darcs.net:

Sun Mar 21 14:54:31 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * reuse is_tag

Sun Mar 21 15:27:58 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * use isPrefixOf instead of take x y == "string" in some places
Attachments
msg10387 (view) Author: gh Date: 2010-03-21.14:43:41
Amended version of the isPrefixOf patch.

2 patches for repository http://darcs.net:

Sun Mar 21 14:54:31 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * reuse is_tag

Sun Mar 21 15:42:55 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * use isPrefixOf instead of take x y == "string" in some places
Attachments
msg10389 (view) Author: mornfall Date: 2010-03-21.14:44:52
gh <bugs@darcs.net> writes:
> Sun Mar 21 14:54:31 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
>   * reuse is_tag
could you also rename that one to isTag, pretty please? : - )

Thanks.
msg10390 (view) Author: kowey Date: 2010-03-21.14:46:32
On Sun, Mar 21, 2010 at 15:44:30 +0100, Petr Rockai wrote:
> gh <bugs@darcs.net> writes:
> > Sun Mar 21 14:54:31 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
> >   * reuse is_tag
> could you also rename that one to isTag, pretty please? : - )

There's a better answer:
use the camelCase tool in darcs get http://patch-tag.com/r/kowey/snippets


-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
msg10392 (view) Author: gh Date: 2010-03-21.14:53:29
Now with renaming to isTag.

2 patches for repository http://darcs.net:

Sun Mar 21 15:42:55 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * use isPrefixOf instead of take x y == "string" in some places

Sun Mar 21 15:52:16 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
  * rename is_tag to isTag and use it more
Attachments
msg10429 (view) Author: kowey Date: 2010-03-23.01:16:13
On Sun, Mar 21, 2010 at 14:53:29 +0000, gh wrote:
> Sun Mar 21 15:42:55 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
>   * use isPrefixOf instead of take x y == "string" in some places

I'll push this

> Sun Mar 21 15:52:16 CET 2010  Guillaume Hoffmann <guillaumh@gmail.com>
>   * rename is_tag to isTag and use it more

If I may be annoying, I'll request an amend of this to favour darcs
replace.  It's not a big deal either way.

use isPrefixOf instead of take x y == "string" in some places
-------------------------------------------------------------
Pretty straightforward cleanup.  Thanks!

> Guillaume Hoffmann <guillaumh@gmail.com>**20100321144255
> -          patchname_helper (PatchName n:_) | take 4 n == "TAG " = FlagPatchName $ '.':n
> -                                           | otherwise          = FlagPatchName n
> +          patchname_helper (PatchName n:_) | "TAG " `isPrefixOf` n = FlagPatchName $ '.':n
> +                                           | otherwise             = FlagPatchName n

> -               if n == "" || take 4 n == "TAG "
> +               if n == "" || "TAG " `isPrefixOf` n

> -              take 4 n == "TAG " && isJust (matchRegex (mkRegex r) $ drop 4 n)
> +              "TAG " `isPrefixOf` n && isJust (matchRegex (mkRegex r) $ drop 4 n)

Perhaps there's another refactor to try here?

> -cleanrepourl zzz | take (length dd) zzz == dd = ""
> +cleanrepourl zzz | dd `isPrefixOf` zzz = ""

Oh, that is cleaner

> -                hint = if take 1 path == "~"
> +                hint = if "~" `isPrefixOf` path

rename is_tag to isTag and use it more
--------------------------------------
> -import Darcs.Patch.Info ( pi_rename, pi_tag, is_tag, PatchInfo )
> +import Darcs.Patch.Info ( pi_rename, pi_tag, isTag, PatchInfo )

> -              where oot t = if is_tag (info t) && not (info t `elem` inOrderTags)
> +              where oot t = if isTag (info t) && not (info t `elem` inOrderTags)

... more like this.

This sort of minor token replace should be done using darcs replace for
easier commutation. (Try my camelCase tool).  Would it be any trouble to
amend that?

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
msg10953 (view) Author: kowey Date: 2010-05-05.18:31:41
Sorry, I forgot about this patch.  Anyway, it's been obsoleted by some
of my camel work, I think
History
Date User Action Args
2010-03-21 14:00:25ghcreate
2010-03-21 14:01:28darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-56687baf9747ed7d1198b737464d946a51741772
2010-03-21 14:33:14ghsetfiles: + reuse-is_tag.dpatch, unnamed
messages: + msg10384
2010-03-21 14:34:17darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-56687baf9747ed7d1198b737464d946a51741772 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-90fdecc7f494e1ab76e166e916122f7564f6ddf8
2010-03-21 14:43:42ghsetfiles: + reuse-is_tag.dpatch, unnamed
messages: + msg10387
2010-03-21 14:44:50darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-90fdecc7f494e1ab76e166e916122f7564f6ddf8 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3147628098ac4fca634e29450aebe7fe61f4315d
2010-03-21 14:44:52mornfallsetnosy: + mornfall
messages: + msg10389
2010-03-21 14:46:33koweysetnosy: + kowey
messages: + msg10390
2010-03-21 14:53:29ghsetfiles: + use-isprefixof-instead-of-take-x-y-__-_string_-in-some-places.dpatch, unnamed
messages: + msg10392
2010-03-21 14:54:32darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3147628098ac4fca634e29450aebe7fe61f4315d -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-fcf96584606dce510b136fa583d025124c0d9e9e
2010-03-23 01:16:14koweysetstatus: needs-review -> followup-requested
messages: + msg10429
2010-03-23 09:57:30koweysetassignedto: gh
2010-05-05 18:31:41koweysetstatus: followup-requested -> obsoleted
assignedto: gh ->
messages: + msg10953
2011-05-10 18:36:46darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-fcf96584606dce510b136fa583d025124c0d9e9e -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-fcf96584606dce510b136fa583d025124c0d9e9e
2011-05-10 19:37:27darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-fcf96584606dce510b136fa583d025124c0d9e9e -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-56687baf9747ed7d1198b737464d946a51741772
2011-05-10 20:36:46darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-56687baf9747ed7d1198b737464d946a51741772 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3147628098ac4fca634e29450aebe7fe61f4315d
2011-05-10 22:06:32darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3147628098ac4fca634e29450aebe7fe61f4315d -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-90fdecc7f494e1ab76e166e916122f7564f6ddf8