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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:29:26+00:00 2026-05-29T05:29:26+00:00

I have a single-person single-folder mercurial repository. The directory structure is simple: P104 lecture_notes

  • 0

I have a single-person single-folder mercurial repository. The directory structure is simple:

P104
  lecture_notes
    files under version control live here  

After a while I realize I want to have two directories within the repository, like this

P104
  lecture_notes
    files under version control live here  (.hg is here)
  homework
    more files under version control

Now, if I’m just trying to add files to the repository, it fails:

br@ymir:~/P104/lecture_notes$ ll ..
total 16
drwxr-xr-x 4 br br 4096 2012-02-02 18:05 ./
drwxr-xr-x 4 br br 4096 2012-02-01 20:46 ../
drwxr-xr-x 2 br br 4096 2012-02-02 17:44 homework/
drwxr-xr-x 4 br br 4096 2012-02-02 18:06 lecture_notes/
br@ymir:~/P104/lecture_notes$ hg add ../homework/hw1_P104.tex 
abort: ../homework/hw1_P104.tex not under root

My first idea was to clone the repo one level up in the directory structure, add files to the clone, and delete the original repo. But even cloning fails:

br@ymir:~/P104/2011/lecture_notes$ hg clone . ..
abort: destination '..' is not empty

So the question is whether there’s a Mercurial-ish way of doing this other than creating a clean repository somewhere else and copying files manually?

  • 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-29T05:29:27+00:00Added an answer on May 29, 2026 at 5:29 am

    If the root directory of your Mercurial repo is under ~/P104/lecture_notes, I would rather:

    1. rename lecture_notes into P104
    2. make a subdirectory lecture_notes
    3. move all the existing files in that new sub-directory
    4. add homework and its files in the renamed P104 directory
    5. hg add everything

    The idea is to keep the .hg repo where it is (~/P104/lecture_notes renamed into ~/P104/P104) and reorganize the files within that renamed directory.
    No need to clone.

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

Sidebar

Related Questions

I have a Bitmap (in C#) which contains a silhouette of a single person
I have inherited a single project in svn: 30Gb in over 300 000 files.
I have a simple hierarchic model whit a Person and RunningScore as child. this
I have implemented single table inheritance for a person class class Person < ActiveRecord::Base
I have been trying to learn and get used to version control, more specifically
Say I have the following double-quoted string in Ruby: Person's name Does the single
I have currently collected a large part of my work under a single and
I have an single threaded, embedded application that allocates and deallocates lots and lots
I have a single user java program that I would like to have store
I have a single line CEikLabel in my application that needs to scroll text.

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.