Opened 15 years ago
Closed 15 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)
Change History (5)
Changed 15 years ago by hippo
comment:1 follow-up: ↓ 2 Changed 15 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 19 19 args = ['pull', '-u'] 20 20 if revision: 21 21 args += ['-r', revision.split(':')[0]] 22 args += [dir_]23 22 24 23 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_) 26 25 if returncode != 0: 27 26 ctxt.error('hg pull -u failed (%s)' % returncode) 28 27
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 15 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 15 years ago by osimons
- Owner set to osimons
OK, I've committed the latest patch in [807].
comment:4 Changed 15 years ago by osimons
- Resolution set to fixed
- Status changed from new to closed
... and closing.
proposed fix