Issue #2206 resolved

branch filter restores wrong branch for multiple related repositories

kairu
created an issue

I work with multiple copies of the "related" repositories (multiple distinct, independent repositories that with many common changesets) pegged on different branches. The restoration of the last used branch filter feature (#1009) seems to only remember the last branch based on the repository ancestry, rather than by the distinct repository location - all related repositories always initialize the filter to the same branch, probably based on whichever repository's filter value was the last to get saved, even though they were each set to different branches earlier.

Example: Repository A is filtered on branch 1, Repo B on branch 2, Repo C on branch 3, where A, B and C are all related repositories. When I open a fresh instance of thg and open all the repo tabs, they will all be on the same branch. If I set all branch filters appropriately, then close and reopen the repos, they will still all filter to the same branch.

Version: thg 2.5.1 Win32

Comments (7)

  1. kairu reporter

    Hmm, that's unfortunate. I don't suppose there's a way to disable the feature? I'd almost rather have it not restore filters, than have it restore a filter that would be wrong 9 times out of 10.

    It is what it is I suppose, and the feature does work well for the majority of users (including myself at home where I don't have to oversee all these slightly different repos). Thanks for your time.

  2. Boris Drajer

    +1 to get this changed. For developers working on multiple branches at the same time, this feature is somewhat unhelpful.

    I too have multiple local copies of one remote repository, all updated to different branches. When I open a local repository, instead of getting its active branch displayed, I get another that this repository was never updated to and is completely unrelated. It seems like the same type of problem as the original issues (#1009 and #1927) pointed to - by default, you don't get the display you had previously.

    From my point of view (simple user, ignorant of the inner workings of TortoiseHG & Mercurial) storing the branch filter per repository identity is a bit counterintuitive... If one can have different local copies of the same repository, it would make sense to be able to setup each of them differently. But if that is not possible, the proposed "select-current-branch" switch seems like a good alternative.

    Thanks!

  3. Yuya Nishihara

    repofilter: remember working branch as special symbol (refs #2206)

    It's common scenario to have multiple clones by branch, e.g. "thg" and "thg-stable", and filter by each working branch.

    With this change, the branch filter is saved as ".", if it points to the working branch. For example,

    1. open "thg" repository (which is updated to default branch), and filter by "default" branch.
    2. close it. the filter state is saved as "bac32db38e52\branch = ."
    3. open "thg-stable". the filter state, "bac32db38e52\branch = .", is restored as "stable" branch.

    → <<cset 32a5d38547b6>>

  4. Log in to comment