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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:49:32+00:00 2026-06-04T18:49:32+00:00

I need to remove a specific version of a versioned file in my repo,

  • 0

I need to remove a specific version of a versioned file in my repo, but I do not know how to do it.

I can view the file using hg cat –rev [version] [file-name], but I do not know to remove it.

Anyone know how to remove a specific file version?

  • 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-04T18:49:34+00:00Added an answer on June 4, 2026 at 6:49 pm

    Short answer: If your repo is public, it’s very hard. If it’s private, easier.


    Long answer: Mercurial, being a changeset-oriented CVS, does not actually store file revisions. Instead, it stores changes between revisions (diffs).

    In addition to that, every changeset id is calculated as a cryptographic hash based on the content of the revision. This means that if you altered a single changeset, every descendant changeset of it would be changed. This is the price of rewriting history in Mercurial.

    Private repo

    If the changeset you need to change was not pushed anywhere (or the repo itself is private), then you can alter history as you like.

    • If the changeset is a recent one, consider using Mercurial Queues: you can import the changesets into the queue, go to the changeset in question, undo the change to one particular file, then reapply the rest of the queue.

    • If the changeset was committed a long time ago, you might probably update to its parent, graft the offending changeset (you’ll probably have to stick in a dummy changeset to make it work), import it to MQ, modify it, then rebase --detach the rest of the ancestors on top of it.

    Public repo

    You can do the same with the private repo, but remember the copy of the lineage will be created:

    -- 1 -- 2 -- A -- B -- C -- D    original A and its descendants
             \
              A' -- B' -- C' -- D'   modified A' and its descendants
    

    Even after you replace A–D with A'–D', everyone who pulled from your repo will still have A–D! You’ll have to find a way to make them strip this lineage.

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

Sidebar

Related Questions

I need to remove break from a specific div , i know how to
I'm using this code to remove all duplicates, but I have a need to
I need to remove whitespaces after the word in the string. Can this be
I've got a fairly complex XML document, where I need to remove specific nodes
I need to compile a jar file using ant (1.7.0) to run under a
I need to remove elements with specific value from std::list. With the list<int> I
I need to be able to remove a specific certificate from each PC in
I need to remove the specific class attribute from all the element in the
I need to remove certain images with a specific src : http://ukn.cs-mtc.com/wp-content/plugins/download-monitor/page-addon/thumbnail.gif Is there
I need to remove the border-top: 1px solid #202020; from .contact on my contact

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.