darcs

Patch 311 remove duplicate code, readPatchIds

Title remove duplicate code, readPatchIds
Superseder Nosy List dagit, kowey
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-07-22.07:02:47 by dagit, last changed 2011-05-10.20:05:54 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
remove-duplicate-code_-readpatchids.dpatch dagit, 2010-07-22.07:02:47 text/x-darcs-patch
remove-duplicate-code_-readpatchids.dpatch dagit, 2010-07-23.06:37:44 text/x-darcs-patch
remove-duplicate-code_-readpatchids.dpatch dagit, 2010-07-23.06:50:54 text/x-darcs-patch
unnamed dagit, 2010-07-22.07:02:47
unnamed dagit, 2010-07-23.06:37:44
unnamed dagit, 2010-07-23.06:50:54
See mailing list archives for discussion on individual patches.
Messages
msg11817 (view) Author: dagit Date: 2010-07-22.07:02:47
Just a bit of clean up.  It seems that somehow this function was
defined twice.

Jason


1 patch for repository http://darcs.net:

Thu Jul 22 00:03:42 PDT 2010  Jason Dagit <dagit@codersbase.com>
  * remove duplicate code, readPatchIds
Attachments
msg11818 (view) Author: kowey Date: 2010-07-22.10:11:07
On Thu, Jul 22, 2010 at 07:02:47 +0000, Jason Dagit wrote:
> Thu Jul 22 00:03:42 PDT 2010  Jason Dagit <dagit@codersbase.com>
>   * remove duplicate code, readPatchIds

I think you may have forgotten to export readPatchIds from
Darcs.Repository.DarcsRepo

But then here's a situation I don't know how to handle:

1) Is it appropriate for DarcsRepo to export a readPatchIds function?
2) If not, which is the lesser evil?  The inappropriate export or the
   code duplication? (or I suppose some third solution, like moving
   the function to a more appropriate place)

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
msg11832 (view) Author: dagit Date: 2010-07-23.06:37:44
It's always a bad idea to have duplicate code like this.  Whether it's
bad or not for darcs to export things from DarcsRepo is another story.

I don't even know why that function is defined in DarcsRepo.  Nothing
about the type makes it specific to repositories.  It takes a string
and returns the patch infos.  It probably belongs in Darcs.Patch.Read
or so.  At the moment, I just want to remove the duplicate.  Finding a
home for it can come later.

Jason

1 patch for repository http://darcs.net:

Thu Jul 22 23:35:26 PDT 2010  Jason Dagit <dagit@codersbase.com>
  * remove duplicate code, readPatchIds
Attachments
msg11833 (view) Author: dagit Date: 2010-07-23.06:50:54
I think readPatchInfos should leave in Darcs.Patch.Info.

I see that HashedRepo defines a similar function that also parses out
hashes.  Perhaps someone should rename that to
readPatchInfosAndPatches, but I think "patch ids" might actually be a
nice name for "infos and patches".  Perhaps that function should
be moved to Darcs.Patch.Info also.

Jason

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

Thu Jul 22 23:35:26 PDT 2010  Jason Dagit <dagit@codersbase.com>
  * remove duplicate code, readPatchIds

Thu Jul 22 23:45:11 PDT 2010  Jason Dagit <dagit@codersbase.com>
  * move readPatchIds to Darcs.Patch.Info

Thu Jul 22 23:48:32 PDT 2010  Jason Dagit <dagit@codersbase.com>
  * rename readPatchIds to better describe what it does
Attachments
msg11834 (view) Author: kowey Date: 2010-07-23.11:01:27
Looks good.  Thanks!
msg11841 (view) Author: darcswatch Date: 2010-07-23.13:02:10
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-9c4b0e7ff3375995de89426407eccf577e8f3b92
msg11843 (view) Author: darcswatch Date: 2010-07-23.13:02:25
This patch bundle (with 3 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-0d7f52a1d2b1186ee63ee3fd3dcb85a85e38e671
msg14029 (view) Author: darcswatch Date: 2011-05-10.17:15:52
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-9c4b0e7ff3375995de89426407eccf577e8f3b92
msg14236 (view) Author: darcswatch Date: 2011-05-10.20:05:54
This patch bundle (with 3 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-0d7f52a1d2b1186ee63ee3fd3dcb85a85e38e671
History
Date User Action Args
2010-07-22 07:02:47dagitcreate
2010-07-22 07:06:13darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-add21156fdc450bcc9fc25928881232570f247f6
2010-07-22 10:11:07koweysetstatus: needs-review -> followup-requested
nosy: + kowey
messages: + msg11818
2010-07-23 06:37:44dagitsetfiles: + remove-duplicate-code_-readpatchids.dpatch, unnamed
messages: + msg11832
2010-07-23 06:39:47darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-add21156fdc450bcc9fc25928881232570f247f6 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-9c4b0e7ff3375995de89426407eccf577e8f3b92
2010-07-23 06:50:54dagitsetfiles: + remove-duplicate-code_-readpatchids.dpatch, unnamed
messages: + msg11833
2010-07-23 06:52:11darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-9c4b0e7ff3375995de89426407eccf577e8f3b92 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-0d7f52a1d2b1186ee63ee3fd3dcb85a85e38e671
2010-07-23 11:01:27koweysetstatus: followup-requested -> accepted-pending-tests
messages: + msg11834
2010-07-23 13:02:10darcswatchsetstatus: accepted-pending-tests -> accepted
messages: + msg11841
2010-07-23 13:02:25darcswatchsetmessages: + msg11843
2011-05-10 17:15:52darcswatchsetmessages: + msg14029
2011-05-10 18:05:33darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-0d7f52a1d2b1186ee63ee3fd3dcb85a85e38e671 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-add21156fdc450bcc9fc25928881232570f247f6
2011-05-10 20:05:54darcswatchsetmessages: + msg14236