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 8788827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:14:04+00:00 2026-06-13T22:14:04+00:00

I have a situation where I’m writing for a system that handles lots of

  • 0

I have a situation where I’m writing for a system that handles lots of repository, configuration, build and running stuff. There’s a task which might as well be called sync-repository which the user should be able to call to ensure that the latest version of the repository gets to the client.

It’s possible that the repo is already present, in which case I’d like to do a hg update. It’s also possible that the repo isn’t present, in which case I’d like to do a hg clone. The user shouldn’t have to care which is the case. Oh, and the repository is big, so just wiping the directory and cloneing every time isn’t an option.

Does hg provide a single command that clones or updates under the hood, depending on which is appropriate? Or am I going to have to do it with bash?

  • 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-13T22:14:05+00:00Added an answer on June 13, 2026 at 10:14 pm

    The user shouldn’t have to care which is the case.

    Yes, but YOU must care and know, does you have clone or no. How you want to manage it?

    If you have someconfig-file in form, f.e

    Reponame = /full/path/to/clone

    you can detect, if clone exist or not and use if-then-else logic. If you haven’t information, you can’t make decision

    Add-on

    No, the are not such “combined” command in Mercurial core (I hope, they never appear in it), because Mercurial doesn’t go git-way “one command for different unrelated tasks” and follow Unix-way (“Mind your own business!”) more strictly

    But, from other side, it give you freedom do what you want – you can define own Mercurial commands (if you asked this), which may be a hodgepodge of unrelated original commands (see Aliases extension (wiki page is slightly outdated) and [alias] section in .hgrc – up to date) and even use shell commands in Mercurial aliases

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

Sidebar

Related Questions

I have situation, where running a query that filters by an indexed column in
I have situation. I have to create a Sports Club system in JAVA. There
I have a situation where I need to ensure that there is only one
We have situation where say we have four engineers that are working on software
I have situation like this: I have commited files a,b,c,d.Now i found that by
I have a situation that I have not found an answer to when looking
i have situation in here and i am running out of idea,when i upload
Current situation: Have a timesheet that allows the user to enter their leave, TOIL,
I have this situation where I declare inside my main class a function that
is there any limit of POST arguments? I have situation where on dev server

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.