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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:32:58+00:00 2026-05-21T00:32:58+00:00

I’ve been using a lovely mercurial repo for a while now, but have recently

  • 0

I’ve been using a lovely mercurial repo for a while now, but have recently realized that I really should have created the original repo one level higher in the file structure, as there are files up there that I also want to be version-controlled. Is there a way to “promote” a Mercurial repo up one level so that it also tracks files contained in that folder?

So, the current structure is:

-superFolder (not under VC)
    -someFolder (not under VC)
    -someFolder (repo root, under VC)
        -subFolder (under VC)

I want:

-superFolder (repo root, under VC)
    -someFolder (under VC)
    -someFolder (under VC)
        -subFolder (under VC)

I can always just create a new repo, but I’d like to retain my old deltas…

(bonus points if you know how to do it in MacHg, but command-line is also great)

  • 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-05-21T00:32:59+00:00Added an answer on May 21, 2026 at 12:32 am

    If we imagine you created it like:

    #!/bin/sh
    mkdir superFolder     
    cd superFolder 
    mkdir someFolder1
    touch someFolder1/file
    hg init someFolder2
    cd someFolder2
    mkdir subFolder
    touch subFolder/file
    hg add subFolder/file
    hg commit -m subFolder
    

     
    hg status -A:

    C subFolder/file
    

    we can move it like:

    mv ../someFolder1 . # Move the uncontrolled directory in
    hg add someFolder1/ # Add uncontrolled directory
    mkdir someFolder2 # Re-create *this* directory inside the root.
    hg mv subFolder someFolder2 # Move sub-directory of old root to new subdirectory of root
    hg commit -m 'Change repo level' # Commit
    

     
    hg status -A:

    C someFolder1/file
    C someFolder2/subFolder/file 
    

     

    cd ../..
    mv superFolder superFolder_old # Move old unmanaged top-level out of way
    mv superFolder_old/someFolder2 superFolder # Move root to new name
    rmdir superFolder_old # Remove old top-level
    

    As you can see, it requires some finagling. But this preserves history, unlike drharris’s solution, which rewrites every commit with a new id. It depends whether you actually care about the current commit ids (does anyone have them?). If not, his is easier.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a French site that I want to parse, but am running into
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.