It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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 Oct 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.

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.

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?

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 Dec 07, 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.

Thanks for your time on this, Michael.

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.

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
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,935 views 0 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you