Edgewall Software
Modify

Opened 12 years ago

Closed 11 years ago

#530 closed defect (fixed)

wrong "dir" parameter description and logic for hg pull

Reported by: hippo Owned by: osimons
Priority: minor Milestone: 0.6
Component: Recipe commands Version: dev
Keywords: Cc:
Operating System:

Description

Parameter dir_ is described as "the name of a local subdirectory containing the working copy". This is wrong, because "hg pull" doesn't have such a parameter. Instead, it has "hg pull [SOURCE]", so I propose to change parameter "dir" to "repository".

Attachments (1)

hg_pull_param.patch (921 bytes) - added by hippo 12 years ago.
proposed fix

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by hippo

proposed fix

comment:1 follow-up: Changed 12 years ago by osimons

You are right - the way that command is made it does not work. You can't call hg with a path to a directory to update (pull -u). To avoid changing the command though, the proper fix is to use dir_ as input to shtools.execute() as named argument dir_=dir_ - ie. so that the command-line execution will use the inside of the repos as current working directory (the command-line runner changes before running command, and resets afterwards). Could you try this alternative patch, please:

  • bitten/build/hgtools.py

    a b  
    1919    args = ['pull', '-u']
    2020    if revision:
    2121        args += ['-r', revision.split(':')[0]]
    22     args += [dir_]
    2322
    2423    from bitten.build import shtools
    25     returncode = shtools.execute(ctxt, file_='hg', args=args)
     24    returncode = shtools.execute(ctxt, file_='hg', args=args, dir_=dir_)
    2625    if returncode != 0:
    2726        ctxt.error('hg pull -u failed (%s)' % returncode)
    2827

The command presumes a clone is already done, with a default path configured that points to the repository from where to fetch updates. A command to point to new/arbitrary repositories should really be a new command - typically a 'clone' command.

comment:2 in reply to: ↑ 1 Changed 11 years ago by hippo

Replying to osimons:

You are right - the way that command is made it does not work. You can't call hg with a path to a directory to update (pull -u). To avoid changing the command though, the proper fix is to use dir_ as input to shtools.execute() as named argument dir_=dir_ - ie. so that the command-line execution will use the inside of the repos as current working directory (the command-line runner changes before running command, and resets afterwards). Could you try this alternative patch, please:

The command presumes a clone is already done, with a default path configured that points to the repository from where to fetch updates.

Sorry for the late reply -- had no time to look in here. Currently I don't have the ability to check your patch on a live installation, but it seems to be correct and I support merging it.

A command to point to new/arbitrary repositories should really be a new command - typically a 'clone' command.

Yes, generally this will be enough.

comment:3 Changed 11 years ago by osimons

  • Owner set to osimons

OK, I've committed the latest patch in [807].

comment:4 Changed 11 years ago by osimons

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

... and closing.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
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.