Best practices for publishing extensions

Adrian Buehlmann adrian at cadifra.com
Sat Apr 2 18:37:38 CDT 2011


On 2011-04-03 00:22, Adrian Buehlmann wrote:
> On 2011-04-02 23:56, Adrian Buehlmann wrote:
>> On 2011-04-02 23:26, Greg Ward wrote:
>>> Hi all --
>>>
>>> In order to make life easier for my "allextensions" scrape-to-subrepos
>>> project, I've just finished the glamorous and thrilling job of
>>> updating many many *Extension pages in the Mercurial wiki to use more
>>> consistent terminology.  allextensions now tracks 65 extensions, up
>>> from 37 when I first announced it the other night.
>>
>> Oh dear. Sounds like a invitation to move from Distributed Version
>> Control to Distributed Denial of Service :-)
>>
>> N users doing 65 repo pulls.
>>
>> And no one will be looking at the code in those 65 subrepos anyway...
> 
> Luckily it's not exactly that bad :-). The Windows pullers will stall on the
> Artemis extension, which tries to create a directory named "aux", which is not
> allowed on Windows:
> 
>   $ hg clone http://hg.gerg.ca/allextensions
>   destination directory: allextensions
>   requesting all changes
>   adding changesets
>   adding manifests
>   adding file changes
>   added 10 changesets with 20 changes to 6 files
>   updating to branch default
> 
>   <snipping pulling of ~40 subrepos>
> 
>   pulling subrepo Artemis from http://hg.mrzv.org/Artemis
>   requesting all changes
>   adding changesets
>   adding manifests
>   adding file changes
>   added 55 changesets with 108 changes to 47 files
>   abort: The directory name is invalid: C:\Users\adi\hgrepos\allextensions\Artemis\aux

Which leads to the interesting question why the subrepos are pulled in
that order...

I can optimize that with

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -144,7 +144,7 @@
                 debug(s, "prompt remove")
                 wctx.sub(s).remove()

-    for s, r in s2.items():
+    for s, r in sorted(s2.items()):
         if s in s1:
             continue
         elif s not in sa:

It will then go like this on Windows:

  $ hg clone http://hg.gerg.ca/allextensions
  destination directory: allextensions
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 10 changesets with 20 changes to 6 files
  updating to branch default
  pulling subrepo Artemis from http://hg.mrzv.org/Artemis
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 55 changesets with 108 changes to 47 files
  abort: The directory name is invalid: C:\Users\adi\hgrepos\allextensions\Artemis\aux

(Ok. Purpose #2 accomplished: I started playing with subrepos :-)


More information about the Mercurial-devel mailing list