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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:27:20+00:00 2026-05-26T20:27:20+00:00

Currently in my practice I use VERSION file to store: major=2 minor=0 fix=1 which

  • 0

Currently in my practice I use VERSION file to store:

major=2
minor=0
fix=1

which mean that sources for product version v2.0.1 or newer.

Before each release I must commit update to this file so tag with name tag2.0.1 or release-2.0.1 cover above content (and not previous version!).

I think that it is possible to avoid this job by automatically generating VERSION file from build script.

Look to rev history:

  +--+-----+----------------------+-YY--+----+------+------+-HH-->
  dev|     |            ^     ^   |     |    |      |      |
     |     |            |     |   |     |    v      v      v
     |     |            |     |   |     |    +--+------+-ZZ---+-->
     |     |            |     |   |     |    b2 |      |      |
     |     |            |     |   |     |       v      v      v
     |     |            |     |   |     |      t2.0.0 t2.0.1 t2.1.0
     v     v            |     |   v     v
    t0.1.0 +---+--XX--+-+---+-+-----+------+------+------+------+--->
           b1  |      |     |       |      |      |      |      |
               v      v     v       v      v      v      v      v
              t1.0.0 t1.0.1 t1.0.2 t1.1.0 t1.2.0 t1.2.1 t1.2.2 t1.2.3

At point XX version is 1.0.0, at point YY version is 1.0.2, at point ZZ version is 2.0.1.

For point HH is don’t know how set version. I think it must be 1.0.2, because we does not merge dev branch with release branch b2.

I read:

  $ hg help revsets

but don’t see how can I find nearest tag to given revision. With Git and Bzr I have less experience…

Or if this s not possible I look for arguments. Also I like to hear how avoid manually maintain VERSION file if this possible (or arguments why this is not possible).

PS. VERSION file needed to maintain package dependency and to identify product source state in feedback from users.

PSS. nearest tag to given revision term can look something fuzzy but every developer can say on which version of product it works. Why this can not do machine?

  • 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-26T20:27:21+00:00Added an answer on May 26, 2026 at 8:27 pm

    You could use something like this:

    hg log --template "{latesttag}-{latesttagdistance}-{node|short}\n" --rev <REV>
    

    Which returns a string like:

    2.1.4-2-12eeab7a8073

    This tells us that:

    • The most recent tag before this commit was 2.1.4
    • The current revision is 2 commits past that tag
    • The changeset id is 12eeab7a8073

    Read about templates for more information.

    Git has a built-in describe command that provides the same information. However, you must understand that by default it only works with annotated tags (see the man page for details).

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

Sidebar

Related Questions

Is there a way in Cocoa that is currently considered best practice for creating
For version control we currently use Visual Source Safe and are thinking of migrating
What strategy do you use to avoid storing passwords in version control? Currently, I
I'm just getting into the practice of version control (I'd like to use Eclipse
We have many projects that use a common base of shared components (dlls). Currently
Currently, our organization does not practice Continuous Integration. In order for us to get
I am currently in a job where we practice serious pair programming on windows
I'm currently studying computer science and looking for a good way to practice and
I am trying to modify a batch script that installs a simple script file
Possible Duplicate: Storing third-party libraries in source control I'm currently starting a project which

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.