Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is it okay that .hgtags exists in default branch, but not in develop branch?

ralvy October 10, 2018

In one of my repos, when I check out my default branch, I see an .hgtags file there. But it disappears when I check out my develop branch. Is this a problem?

1 answer

0 votes
minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2018

Hi

.hgtags contains the global tag names. It is a version controlled file so it should be in your repository, but depending on when it was created vs the develop branch it is possible it is in one branch but not the other.

ralvy October 22, 2018

I imagine that if I add a tag to my develop branch, I will magically get a .hgtags file for that branch. I don't add tags to the develop branch, as a rule. Only to the default branch to track version numbers. But repositories where I *do* have an .hgtags file in develop, show it has only the initial commit version number tag in it, where the default branch .hgtags has all the tags I use for version numbers in default.

ralvy December 7, 2018

What would happen if I copy the .hgtags file I see in the default branch into my develop branch?

The reason I ask is that, because my develop branch lacks an .hgtags file, I always have to make sure that the last Push I do from my MacBook Pro is with a changeset in my develop branch. Otherwise when I do a Pull on my Mac Mini, I'm told that

hg cat' failed with code 1:'.hgtags: no such file in rev ...

Or should I just create a tag on my develop branch?

ralvy December 7, 2018

SourceTree_NoHgTagsFile.png

I see now why this happened, as you can see in the above image. I mistakenly created the develop branch BEFORE committing the initial tag creation. Will this Pull problem go away if I just add a tag to my most recent develop changeset?

minnsey
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 7, 2018

To be honest I don't know, it might be a question the Mercurial mailing lists can answer better. https://www.mercurial-scm.org/wiki/MailingLists

But I can't see any downside to trying.

Sorry its not a definitive answer.

ralvy December 7, 2018

Thanks for your time on this, Michael.

ralvy December 8, 2018

I checked out the tip of develop and then added a tag to the first develop changeset. So that tag now appears on the first develop changeset and in the left column of tags.

I then merged develop to default and resolved the conflict on .hgtags to keep "Mine". When I do this, however, the tag disappears on the first develop changeset and disappears from the left column of tags.

However, develop now has a .hgtags file with that single tag referencing the first develop changeset and I don't get the Pull problems I was having before. But I'm concerned about the tag no longer appearing in Sourcetree. So I'm reticent to actually do this with my production repository. I did all this on a test local/remote repository.

I'm tempted to create a new repository for this code and do it properly this time, so develop is created AFTER I create my first default tag.

ralvy December 9, 2018

I resolved this by simply copying my latest source code over to a new folder and created a repository there, properly this time. I can always go back to the prior repo if I need to access older versions of this source code.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events