Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

Last modified 12 years ago

#303 closed enhancement (fixed)

[PATCH] implement mercurial repository support, but failed.

Reported by: dlin@… Owned by: dfraser
Priority: major Milestone: 0.6
Component: Recipe commands Version: dev
Keywords: Cc: jerico.revote@…, osimons
Operating System: Linux

Description

I just written a dirty porting of mercurial tool (build/hgtools.py), here it is

import logging
import posixpath
import re

log = logging.getLogger('bitten.build.hgtools')
__docformat__ = 'restructuredtext en'
def pull(ctxt, revision=None, dir_='.'):
    """pull and update the local working copy from the Mercurial repository.
    
    :param ctxt: the build context
    :type ctxt: `Context`
    :param revision: the revision to check out
    :param dir_: the name of a local subdirectory containing the working copy
    """
    args = ['pull', '-u']
    if revision:
        args += ['-r', revision]
    args += [dir_]

    from bitten.build import shtools
    returncode = shtools.execute(ctxt, file_='hg', args=args)
    if returncode != 0:
        ctxt.error('hg pull -u failed (%s)' % returncode)

But, here is the error infomation, when I run 'bitten-slave -knvs

[ERROR   ] Internal error in build step 'pull'
Traceback (most recent call last):
  File "/home/dlin/mytrac/bitten/bitten/slave.py", line 259, in _execute_step
    step.execute(recipe.ctxt):
  File "/home/dlin/mytrac/bitten/bitten/recipe.py", line 191, in execute
    ctxt.run(self, child.namespace, child.name, child.attr)
  File "/home/dlin/mytrac/bitten/bitten/recipe.py", line 82, in run
    raise InvalidRecipeError('Unknown recipe command %s' % qname)
InvalidRecipeError: Unknown recipe command http://bitten.cmlenz.net/tools/hg#pull

Attachments (3)

hg_pull.patch (1.5 KB) - added by dlin@… 16 years ago.
patch for mercurial hg pull command
t303-hg_docs-r649.diff (1.7 KB) - added by osimons 15 years ago.
Mercurial documentation (hg:pull).
t303-hg_docs-r657.diff (3.6 KB) - added by osimons 15 years ago.
Updated docs for hg:pull + trivial test that just verifies arguments.

Download all attachments as: .zip

Change History (13)

Changed 16 years ago by dlin@…

patch for mercurial hg pull command

comment:1 Changed 16 years ago by dlin@…

Here is my patch, Tips: My recipe example

<hg:pull revision="${revision}"/>

My slave command

bitten-slave  <URL>/builds --build-dir=$HOME/<cloned_path>

comment:2 Changed 16 years ago by anonymous

  • Summary changed from implement mercurial repository support, but failed. to [PATCH] implement mercurial repository support, but failed.

comment:3 Changed 16 years ago by dfraser

I have applied the patch and I can manually verify that you have set up the hg pull command correctly.

I suspect that you didn't re-register the bitten egg properly - i.e. run setup.py develop or rebuild and reinstall. Can you verify this?

If anyone else who has a working mercurial project can test this and verify that it works as advertised I'll commit it...

comment:4 Changed 16 years ago by dfraser

  • Owner changed from cmlenz to dfraser
  • Status changed from new to assigned
  • Version changed from 0.5.3 to dev

PS It'll also need a patch to doc/commands.txt

comment:5 Changed 16 years ago by dfraser

Decided no point in waiting and I'd rather commit this and get feedback that way - in r630

comment:6 Changed 16 years ago by dfraser

  • Cc jerico.revote@… added

comment:7 Changed 16 years ago by morgan.goose@…

I was able to use this, and I think that perhaps the issue was that the slave didn't have the new bitten installed. I ran into the same error when I tried making a hg:ssh_clone command and forgot to have it installed on the bitten-slaves.

Changed 15 years ago by osimons

Mercurial documentation (hg:pull).

comment:8 Changed 15 years ago by osimons

  • Type changed from defect to enhancement

I've tested the command and wrote some docs for it - see attachment:t303-hg_docs-r649.diff

Does it look correct? If docs gets added, are there any remaining issues for this ticket? Any further Mercurial commands are best added as new tickets, so I'm hoping to commit docs and close this enhancement.

comment:9 Changed 15 years ago by osimons

  • Cc osimons added

Changed 15 years ago by osimons

Updated docs for hg:pull + trivial test that just verifies arguments.

comment:10 Changed 15 years ago by osimons

  • Resolution set to fixed
  • Status changed from assigned to closed

Last patch committed in [658]. I think that should be sufficient for now, and any new ideas for improving Mercurial support should be created as new tickets.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain dfraser.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.