Author Topic: Bitbucket set to remove Mercurial support  (Read 27915 times)

kitor

  • Developer
  • Senior
  • *****
  • Posts: 286
Re: Bitbucket set to remove Mercurial support
« Reply #175 on: November 07, 2020, 11:58:51 AM »


I guess this should be fixed, of course it leads to nowhere.
EOS R, 200D, 750D, 50D...

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3401
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: Bitbucket set to remove Mercurial support
« Reply #176 on: December 20, 2020, 06:21:55 PM »
According to the first joke from here, the problem is solved - you may consider I'm the mathematician :P

Joke of the year. Great work, @a1ex!
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bitbucket set to remove Mercurial support
« Reply #177 on: December 20, 2020, 06:29:20 PM »
Thanks - for those who didn't get the joke, it means somebody still has to sit down and perform the work ;)

Which is exactly the problem I'm trying to solve with Open Collective.

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Bitbucket set to remove Mercurial support
« Reply #178 on: December 21, 2020, 12:29:11 AM »
Thanks - for those who didn't get the joke, it means somebody still has to sit down and perform the work ;)

Which is exactly the problem I'm trying to solve with Open Collective.

Excuse me if I'm missing something, but if I'm not mistaken, the tasks you mentioned above (rewriting all the links in the forum to go from Bitbucket to Heptapod) seem pretty much trivial, right? It's just a matter of loading the SQL dump of this forum and doing a search/replace. (the commit IDs are a different matter, admittedly).

I am asking this because I've long wanted to give some help to this project, after using it for so many years, but I have no experience with the kind of low level programming that you guys need, so when I read this, it sounded like something so easy that even *I* could do it...

(As for migrating the commit IDs, that might be above my skill level, but also: I've been looking around in the forum and the website, but haven't been able to find any link to specific commit IDs in Bitbucket. Do you have an example? )



a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bitbucket set to remove Mercurial support
« Reply #179 on: December 21, 2020, 01:21:54 PM »
Pretty much, yes. However, I'd prefer a "soft" replacement, when displaying the forum posts, rather than permanently altering the forum database. There's plenty of room for making non-obvious mistakes (that could be noticed months after the change).

You can find several examples by typing "bitbucket.org" in the forum search box, though for a complete list, one may need admin access. Or, after fixing the most common classes of links, the search box will reveal the remaining ones. Writing down the search/replace patterns would be a significant time saver. Caveat: it's not as simple as replacing "bitbucket.org" with "heptapod.net".

Though, the problem I've been trying to delegate to the other members of the community, is the one about migrating the commit IDs. Search string: "bitbucket.org/hudson/magic-lantern/commits", but there are also links from other repositories, that should be handled somehow. Heptapod only hosts the main repo, without the forks, but I've saved an archive of all of the forks before they got deleted - link earlier in this thread. Forks were also archived by softwareheritage.org (helped by the team behind Heptapod), as mentioned here, so linking to them could be an option as well. Again, last time I've checked, the commit IDs didn't match.

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Bitbucket set to remove Mercurial support
« Reply #180 on: December 21, 2020, 07:18:20 PM »
Okay, let's separate this into two problems: the "normal" links to Bitbucket and the links to specific commit IDs.

Pretty much, yes. However, I'd prefer a "soft" replacement, when displaying the forum posts, rather than permanently altering the forum database. There's plenty of room for making non-obvious mistakes (that could be noticed months after the change).

If you don't want to touch the forum DB itself, the solution would be to add a HTTP redirection somewhere. But the problem is that, since all the links still point to the bitbucket.org domain, either you convince the Bitbucket guys to add that redirection for you, or you'll still have to touch the forum posts, if only to point them to your own redirector.

What I mean is: you'll have to edit all the links so that they point to "myownbitbucket.org" (for example),  and add in that domain a server that would take into account all the different paths and redirect the user transparently to the appropiate URL. We'd still be editing the forum posts, but only to change the domain part (from bitbucket.org to myownbitbucket.org or whatever); the rest of the URL, which is where the "danger" lies, would be rewritten in the new redirect server. Does that sound good to you, or is it too convoluted? (I could handle the redirect server).

As for the commit IDs, my impression after reading this thread is that the simplest solution would be to ask the Heptapod people for a copy of the git-mapfile. Am I mistaken, or is that a static file that doesn't change anymore? (I mean: the new commits are done directly into the Heptapod server, right? They don't have any corresponding commits in Bitbucket). Either that, or reverse engineer how Heptapod generates the new commit IDs...




a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bitbucket set to remove Mercurial support
« Reply #181 on: December 22, 2020, 12:14:53 PM »
This could actually work - and it doesn't have to be on a different domain. Replacing "^https://bitbucket.org/" with something like "^https://magiclantern.fm/bitbucket.php?u=" could do the trick. This replacement can be done on the fly in the forum code, without modifying the database, so if you'd like to test things temporarily on a different host, that's also possible.

Regarding the commit IDs, I also prefer asking Heptapod for a copy of their the git-mapfile. Still need to find the mental energy for doing that... :-\

BTW, if you prefer to discuss the details on IRC or Discord, I'm keeping an eye of these channels as well.

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Bitbucket set to remove Mercurial support
« Reply #182 on: December 24, 2020, 11:57:52 AM »
Wow, I haven't been on IRC in many years, and I still have to figure out Discord. I don't know if I'm a dinosaur or not enough of one...  ;D

So we would have to hack the forum code then, I guess. Should I just download the code from Simple Machines and start hacking at it, or do you guys have installed any custom mods in this forum? I can also start making a "map" of URLs from the old repo and their correspondences in the new one, as time permits.

(If you need to discuss any details privately, just send me a message here for the moment, until I've figured out Discord...)

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Bitbucket set to remove Mercurial support
« Reply #183 on: December 28, 2020, 10:50:33 AM »
Well, I'v been having a look to all the bitbucket.org links I could find in a quick search, and I saw the following patterns:


And now there are some URLs where I don't know very well what to do with them:


kitor

  • Developer
  • Senior
  • *****
  • Posts: 286
Re: Bitbucket set to remove Mercurial support
« Reply #184 on: December 28, 2020, 11:27:37 AM »
Links to a given file. In Bitbucket they were like this: https://bitbucket.org/hudson/magic-lantern/src/tip/modules/dual_iso/cr2hdr.c (for example). The problem is that the Heptapod link includes the branch information in it: https://foss.heptapod.net/magic-lantern/magic-lantern/-/blob/branch/unified/modules/dual_iso/cr2hdr.c, so I don't know where to get it from in the Bitbucket links.

well, there's "tip" so there's a tag in URL. Not sure how to map this to heptapod though.

Tip is the most recent changeset in the repository. Default is a branch. Tip is a special Tag (a named changeset) which always refers to the most recently changed Head.

Which also means that URLs with "tip" are... useless ;)
EOS R, 200D, 750D, 50D...

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Bitbucket set to remove Mercurial support
« Reply #185 on: December 28, 2020, 11:47:27 AM »
Probably the most reasonable way to interpret that "tip" would be "tip at the time of writing". That is, link translation should be done considering the date of the post containing that link.

Otherwise, replacing it with "unified" could also work.

For the forks, which are not hosted on Heptapod, we can probably link to Software Heritage. Example: https://archive.softwareheritage.org/browse/origin/content/?origin_url=https://bitbucket.org/OtherOnePercent/tragic-lantern-2.0&path=src/video_hacks2.c

Or, I could merge all of the forks into one big repo (let's say magic-lantern-all-forks) and ask Heptapod nicely to create it and let me push everything there. I don't have permission to create new repos there, but I've been thinking to ask them to re-host some of the "side projects" related to ML, such as ml-focus-pixels etc, in the same namespace.

PaulJBis

  • New to the forum
  • *
  • Posts: 46
Re: Bitbucket set to remove Mercurial support
« Reply #186 on: December 29, 2020, 12:49:09 PM »
Probably the most reasonable way to interpret that "tip" would be "tip at the time of writing". That is, link translation should be done considering the date of the post containing that link.

Otherwise, replacing it with "unified" could also work.


The problem I see with those links is the lack of branch information. I mean, with a link like  https://bitbucket.org/hudson/magic-lantern/src/tip/modules/dual_iso/cr2hdr.c, how do we know which branch it's pointing at? Can we safely assume it's for the default branch "unified"?


kitor

  • Developer
  • Senior
  • *****
  • Posts: 286
Re: Bitbucket set to remove Mercurial support
« Reply #187 on: December 29, 2020, 01:45:54 PM »
Honestly, without knowing author thoughts at the time of writing specific post, you never know.

Quote
Probably the most reasonable way to interpret that "tip" would be "tip at the time of writing". That is, link translation should be done considering the date of the post containing that link.

Alex's idea seems right. If this was routed via internal "proxy" then redirect page might warn user that this points to unknown branch. Requires additional coding though.
EOS R, 200D, 750D, 50D...

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3657
  • Blunt and to the point
Re: Bitbucket set to remove Mercurial support
« Reply #188 on: December 29, 2020, 02:02:56 PM »
Can we safely assume it's for the default branch "unified"?

My recollection is that a branch always had the branch name in the link, so yes, it would be safe to assume that IMO.

Otherwise, replacing it with "unified" could also work.

natschil

  • New to the forum
  • *
  • Posts: 16
Re: Bitbucket set to remove Mercurial support
« Reply #189 on: January 27, 2021, 11:21:31 PM »
I'm currently unable to get the source code from Heptapod. I have no experience with mercurial whatsovever, but I tried "hg clone https://foss.heptapod.net/magic-lantern/magic-lantern". This gave me some source code that is different to what I see on Heptapod. I also tried the mercurial to git approach suggested here, that gave me what seems like the same source code as before, here the last commit is one from 2011. It would be helpful to have a file that gives you instructions on how to install the source code somewhere.


Edit: it seems like doing "hg checkout unified" does the trick.