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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:25:05+00:00 2026-06-12T17:25:05+00:00

I’m setting up a Mercurial repository to track third-party code, roughly following the vendor-default

  • 0

I’m setting up a Mercurial repository to track third-party code, roughly following the vendor-default branch scheme described in Rudi’s answer to this question. In order to quickly retrieve a particular version, I create tags for each vendor and default version.

I initialize the repo by committing an empty .hgtags to establish the default branch, then I hg branch vendor and import the first version. The process to add a new version looks like this:

hg up -C vendor
... load new version ...
hg commit -A -m "Adding version x.y.x"
hg tag vendor-x.y.z
hg up -C default
hg merge vendor
hg commit -m "Merging version x.y.z"
hg tag x.y.z

During the merge I always keep the local copy of .hgtags, so the result is that the vendor branch has .hgtags containing all the vendor-x.y.z tags while the default branch .hgtags has only the x.y.z tags.

It’s my understanding that Mercurial considers .hgtags from all heads when working with tags. Yet when I run hg tags the result contains only tip and the x.y.z tags. This is the same regardless of which branch my working directory is updated to; it’s always the tags from the default branch .hgtags file.

I can update to the vendor-x.y.z tags, so Mercurial does see their existence, but the update appears to give me code from the vendor branch tip. The x.y.z tags work fine.

I’ve worked mainly with Git and SVN/CVS in the past, so I assume that this is a problem of understanding, not a technical issue. I did try it, just in case, on two versions of Mercurial (2.0.2 and 2.3.2) and got the same results.

  • 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-12T17:25:06+00:00Added an answer on June 12, 2026 at 5:25 pm

    I’m not in front of my Mercurial system to verify, but I think the issue is Mercurial only considers .hgtags from topological heads, not branch heads. Example:

    [1]---[2]---[5]---[6]    Default
            \         /
             [3]---[4]       Vendor
    

    [6] is a topological head, [4] and [6] are branch heads. The solution is to keep all changes to .hgtags on a merge.

    Edit

    Here’s my test. Directly after the merge I accepted the local .hgtags and hg tags only displays the tag on default. I can’t update to the vendor tag, which differs from what you are seeing. I’m using Mercurial 2.3.1. After creating another changeset on vendor and making a second topological head, the missing tag reappears.

    hg init test
    cd test
    echo >a
    hg ci -Am 1
    hg branch vendor
    echo >b
    hg ci -Am 2
    hg tag v1
    hg update default
    hg tag d1
    hg merge vendor --tool internal:local
    hg ci -m Merge
    
    @REM This only shows 'tip' and 'd1'
    hg tags
    
    hg update vendor
    hg tags
    hg update d1
    
    @REM This fails to update.
    hg update v1
    
    @ Add another topological head by committing to vendor
    hg update vendor
    echo >c
    hg ci -Am 3
    
    @ Now all tags are visible and work.
    hg tags
    hg update v1
    hg update d1
    

    And the output:

    C:\>hg init test
    C:\>cd test
    C:\test>echo  1>a
    C:\test>hg ci -Am 1
    adding a
    C:\test>hg branch vendor
    marked working directory as branch vendor
    (branches are permanent and global, did you want a bookmark?)
    C:\test>echo  1>b
    C:\test>hg ci -Am 2
    adding b
    C:\test>hg tag v1
    C:\test>hg update default
    0 files updated, 0 files merged, 2 files removed, 0 files unresolved
    C:\test>hg tag d1
    C:\test>hg merge vendor --tool internal:local
    1 files updated, 1 files merged, 0 files removed, 0 files unresolved
    (branch merge, don't forget to commit)
    C:\test>hg ci -m Merge
    C:\test>hg tags
    tip                                4:80759c41b3cc
    d1                                 0:17b05ed457d1
    C:\test>hg update vendor
    1 files updated, 0 files merged, 0 files removed, 0 files unresolved
    C:\test>hg tags
    tip                                4:80759c41b3cc
    d1                                 0:17b05ed457d1
    C:\test>hg update d1
    0 files updated, 0 files merged, 2 files removed, 0 files unresolved
    C:\test>hg update v1
    abort: unknown revision 'v1'!
    C:\test>hg update vendor
    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    C:\test>echo  1>c
    C:\test>hg ci -Am 3
    adding c
    C:\test>hg tags
    tip                                5:a2c0fe73a9f1
    v1                                 1:3168d0f4e5e5
    d1                                 0:17b05ed457d1
    C:\test>hg update v1
    0 files updated, 0 files merged, 2 files removed, 0 files unresolved
    C:\test>hg update d1
    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.