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

The Archive Base Latest Questions

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

I need to combine the functionality of two classes into one, but I am

  • 0

I need to combine the functionality of two classes into one, but I am wondering can I combine their change history as well?

Both classes contains lots of previous changes, so I want to keep their change history in one place for reference. I can make a comment in the combined class, but in an IDE, it’s not very easy to get the history of a deleted file.

  • 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-04T08:49:44+00:00Added an answer on June 4, 2026 at 8:49 am

    To do this, you need to record the file merging as a merge changeset.

    Say changeset 0 is your current head with files A and B which you want to merge into file C. To do this, rename your file A to C and commit as changeset 1, then update back to changeset 0, rename file B to C and commit this as changeset 2. Next, you merge these two changesets, combining their content and removing the remaining files A and B. This causes the file history of C to be registered as descending from both A and B. Finally you can rename file C back to A.

    The resulting tree looks as follows:

    0 [A, B] --- 1 [A, C] \
              \            \
               \ 2 [C, B] --- 3 [C] --- 4 [A] 
    

    Example command line flow:

    $ hg init
    $ echo a > a
    $ echo b > b
    $ hg add a b
    $ hg commit -m "add files a and b"
    $ hg mv a c
    $ hg commit -m "rename a to c"
    $ hg update 0
    1 files updated, 0 files merged, 1 files removed, 0 files unresolved
    $ hg mv b c
    $ hg commit -m "rename b to c"
    created new head
    $ hg merge
    merging c
    warning: conflicts during merge.
    merging c incomplete! (edit conflicts, then use 'hg resolve --mark')
    0 files updated, 0 files merged, 1 files removed, 1 files unresolved
    use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
    $ ls
    c      c.orig
    $ cat c
    <<<<<<< local
    b
    =======
    a
    >>>>>>> other
    $ echo ab > c
    $ hg resolve --mark c
    $ hg commit -m "merge a and b into c"
    $ hg mv c a
    $ hg commit -m "rename c back to a"
    

    And if you now type hg log -f a you will notice that the history of both files is shown.

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

Sidebar

Related Questions

I need to combine/merge two php functions, but I can't get the syntax right.
I need to combine rows from two Excel worksheets into one long row, based
I have two .htaccess files that I need to combine into one. The first
I need to combine two mod_rewrite rules into one. 1) In CMS, there is
I need to create and combine several expressions for child entity into one to
I need to combine two URL's that both contain .Path information. I would like
I need to combine a folder full of pdfs into one file. However they
I need to combine the two queries if possible or make them process one
I need to combine one Header Table and six Detail Tables into a single
I need to combine a bunch of files to one file. But I also

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.