Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:47:50+00:00 2026-06-01T23:47:50+00:00

When cloning a repository in Mercurial, is there a way to create a target

  • 0

When cloning a repository in Mercurial, is there a way to create a target folder based on the latest changeset? Example:

$ hg clone http://hg.repo.com:8000/myrepo 'myrepo-$VERSION'

The folder should be named after the version of the project, e.g., myrepo-1.3.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:47:52+00:00Added an answer on June 1, 2026 at 11:47 pm

    If you are okay with using the changeset hash, then you can start with

    $ hg identify -i http://hg.repo.com:8000/myrepo
    

    to get the ID of the tip changeset. You can combine this with clone like this in a Unix shell:

    $ hg clone http://hg.repo.com:8000/myrepo \
               "myrepo-$(hg -i identify http://hg.repo.com:8000/myrepo)"
    

    To make it more convenient to use, I would create an alias for this:

    [alias]
    vclone = !DEST=$(basename "$1")-$($HG identify -i "$1");
              echo "destination directory: $DEST";
              $HG clone "$1" "$DEST"
    

    This let’s you do hg vclone foo to get a foo-<ID> clone.

    In the alias I took care of computing a suitable basename from the clone URL and to print the destination in the same way that hg clone normally does when you don’t give an explicit destination. Finally, I took care to quote the arguments so that you can clone a directory with spaces in the name. (If you also have characters like " in your names, well then you’re out of luck without better support for quoting in Mercurial shell aliases.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When cloning a repository with mercurial you can pass the -U/--noupdate flag to create
I started cloning an SVN repository using the git-svn's clone operation. After about 6
I'm trying to clone a unix-hosted Mercurial repository to a Windows computer. I'm hoping
After cloning a git repository, How can I get the repository file? for example)
I'm having some difficulty cloning my mercurial repository over ssh. Here's what I have
I've noticed that cloning repo via ssh is much slower than through http regardless
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
Is there a way to fork a file from a foreign Git repository without
I have a single-person single-folder mercurial repository. The directory structure is simple: P104 lecture_notes
When cloning my repository, which works from the directory I am developing it in,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.