[PATCH 1 of 1] Add create option to push command

Shane Holloway shane.holloway at ieee.org
Thu Mar 1 17:07:59 UTC 2007


On Feb 28, 2007, at 2:21 PM, Thomas Arendsen Hein wrote:
> * Shane Holloway <shane.holloway at ieee.org> [20070228 18:31]:
>
>> We create a lot of branches in our use of mercurial, with heavy
>> use of the hgrc paths options.  To make our lives easier, we
>> desired a --create option for the push command so we could skip
>> the hg init for non-existent remote repos, as well as use the hgrc
>> paths.  If we wanted this feature, I figure others would as well.
>>
>
> hg clone . <target>
>

That's true, but it does not use the [paths] from the local hgrc, AFAICT


> should already do this.
>
> And what is the use case of using [paths]?
>

When creating a new remote target, I edit the local hgrc file for the  
repo, adding a nice short name, and then simply hg push to it.  As it  
stands without this patch, I have to::

	hg init ssh://scc.company.com:7272/hg/share/shane/project/myrepo
	vim `hg root`/.hg/hgrc
		<add ssh://scc.company.com:7272/hg/share/shane/project/myrepo  to  
[paths] section>
	hg push myrepo

Essentially typing in the repo path twice, introducing the  
opportunity for error.  In our environment, we have a directory  
hierarchy setup to support multiple users as well as multiple  
official project releases, each which get a repository snapshot.   
Hence pushing our repos to new repos has become a common operation.   
With hg clone, the operation is not a whole lot different::

	hg clone -U ssh://scc.company.com:7272/hg/share/shane/project/myrepo
	vim `hg root`/.hg/hgrc
		<add ssh://scc.company.com:7272/hg/share/shane/project/myrepo  to  
[paths] section>

Still having the duplication of the repo string.  But with the hg  
push -c addition, only one addition is needed, and from the context  
of an editor and existing [paths] entries::

	vim `hg root`/.hg/hgrc
		<add ssh://scc.company.com:7272/hg/share/shane/project/myrepo  to  
[paths] section>
	hg push -c myrepo


I did not think it would be appropriate for hg clone to add an entry  
to the hgrc for the path with an option, but that could be pursued.

Thanks for your time Thomas,
-Shane




More information about the Mercurial mailing list