Author Topic: .hg not found  (Read 686 times)

dpjpandone

  • Senior
  • ****
  • Posts: 387
.hg not found
« on: December 24, 2022, 07:32:23 PM »
please forgive my ignorance, I have never encountered this error until I tried to build from the repository hosted on heptapod

Code: [Select]
dpjpandone@MSI:/mnt/d/DEVELOPMENT/MLdev5D3/platform/5D3.123$ make
Using /usr/bin/arm-none-eabi-gcc (from PATH).
[ VERSION  ]   ../../platform/5D3.123/version.bin
abort: there is no Mercurial repository here (.hg not found)
abort: no repository found in '/mnt/d/DEVELOPMENT/MLdev5D3/platform/5D3.123' (.hg not found)!
make: *** [../../src/Makefile.src:360: ../../platform/5D3.123/version.bin] Error 255

I have tried the following:

- copying my makefile.user from the folder that I can already build from (danne's eosm experiments)
  - (error persists)

I then copied the entire hg folder from dannes repository and it works, I mean i can build  from the source downloaded from heptapod, is this safe to do? why is there no .hg folder on heptapod? Is there a way to disable it since I'm just working locally?

I'm sure it's something small I'm missing. Thanks in advance.

names_are_hard

  • Developer
  • Hero Member
  • *****
  • Posts: 577
  • 200D idiot
Re: .hg not found
« Reply #1 on: December 24, 2022, 08:06:29 PM »
The hg tools create this directory when you initialise a repo.  E.g. via whatever the equivalent of "git clone" is (or "git init", etc).  Presumably you downloaded a zip, rather than make a local repo via hg.

This combines with the ML build system expecting to find both the hg CLI tools, and for the repo to be managed by hg.  You are getting this error because your local files are not hg managed.

You should make your local files a proper hg repo.

dpjpandone

  • Senior
  • ****
  • Posts: 387
Re: .hg not found
« Reply #2 on: December 25, 2022, 03:41:05 AM »
You should make your local files a proper hg repo.

you are certainly right that I started with a zip.
after reading your reply I tried:

Code: [Select]
dpjpandone@MSI:/mnt/d/DEVELOPMENT/MLdev5D3$ hg clone https://foss.heptapod.net/magic-lantern/magic-lantern
destination directory: magic-lantern
requesting all changes
adding changesets
adding manifests
adding file changes
added 18073 changesets with 40336 changes to 4104 files (+63 heads)
new changesets 4d0acc5c0792:f0b7bb6ad9e5 (23 drafts)
updating to branch default
147 files updated, 0 files merged, 0 files removed, 0 files unresolved

however this doesnt pull an .hg folder

unfortunately these are the only 2 methods I know to clone a repo. I trolled all the "getting started with development" guides but they seem to be based on the old mercurial repos. I tried searching the forums but it's hard to find good information buried under thousands of "Which memory card should I use" posts... I appreciate any additional tips you could share for making a proper hg repo.

names_are_hard

  • Developer
  • Hero Member
  • *****
  • Posts: 577
  • 200D idiot
Re: .hg not found
« Reply #3 on: December 25, 2022, 04:54:10 AM »
I know very little about hg, it's why I ported the official repo to git.  You shouldn't need ML forums for this, it's a generic mercurial / hg question.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7527
Re: .hg not found
« Reply #4 on: December 25, 2022, 01:28:43 PM »
Git is probably the way to go. I just keep doing hg ccmmits to my git fork. Doesn't hurt and hg is still around.

names_are_hard

  • Developer
  • Hero Member
  • *****
  • Posts: 577
  • 200D idiot
Re: .hg not found
« Reply #5 on: December 25, 2022, 02:56:37 PM »
What do you mean by hg commits to a git repo?  They're not compatible systems.  There are some tools to wrap one in the other, I think?  But that does hurt to some degree; you can't use all the features and now you have two different complex systems as dependencies.

dpjpandone

  • Senior
  • ****
  • Posts: 387
Re: .hg not found
« Reply #6 on: December 25, 2022, 03:14:59 PM »
You guys wanna know how stupid I am?

hg clone copies the entire repository to a folder labeled "magic-lantern"

INCLUDING .hg

but if the .hg folder is not in the root of the local folder it isn't seen by "make"

thanks for the help guys, I'm good to go!

names_are_hard

  • Developer
  • Hero Member
  • *****
  • Posts: 577
  • 200D idiot
Re: .hg not found
« Reply #7 on: December 25, 2022, 03:51:29 PM »
Great, that makes more sense I think (the clone doesn't copy the .hg dir, it creates it).

Not sure what you mean by make needing .hg in some particular place.  Running make in the normal places inside the repo should work and .hg should always be in the repo root, you never need to move it or even think about it.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7527
Re: .hg not found
« Reply #8 on: December 25, 2022, 04:08:28 PM »
What do you mean by hg commits to a git repo?  They're not compatible systems.  There are some tools to wrap one in the other, I think?  But that does hurt to some degree; you can't use all the features and now you have two different complex systems as dependencies.

I run git but I also run hg. I push it all to git. Nah, doesn't hurt but probably doesn't help either since I don't see any future in mercurial right now.

names_are_hard

  • Developer
  • Hero Member
  • *****
  • Posts: 577
  • 200D idiot
Re: .hg not found
« Reply #9 on: December 25, 2022, 04:47:40 PM »
Ah...  here? https://bitbucket.org/Dannephoto/magic-lantern_jip_hop_git/src/master/

Man, that looks like it makes the diffs really confusing.  I guess you're using hg commands locally, then using git commands to store the entire hg state files??  The .hg dir isn't designed to be managed like that, many of the files are binary.  Won't your git repo size bloat really quickly?  It's text oriented, doesn't handle frequent changes to binary files well.  And you have to use both git and mercurial.  Certainly looks painful to me :)

Mercurial is pretty much dead.  Only a handful of large projects using it, git and mercurial are functionally equivalent and everyone has to learn git, so nobody learns hg.  Using mercurial is a barrier to entry for devs.

I'm incompetent enough with hg that it permanently lost my work multiple times.  That made me angry enough to remove all hg deps and make my repo pure git.  There's an experimental crop_rec branch if you're interested: https://github.com/reticulatedpines/magiclantern_simplified/tree/dev_crop_rec_merge

That branch is not really tested at all.  I don't want any long-lived branches, only one branch for everything.  So, I want to merge it or discard it.  I hear from Bilal that there are some problems with crop_rec on Digic 4 cams, hence why it's not merged yet.

Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7527
Re: .hg not found
« Reply #10 on: December 25, 2022, 07:49:26 PM »
Good to see you share your repo. I'll migjt have a look this christmas  8).

dpjpandone

  • Senior
  • ****
  • Posts: 387
Re: .hg not found
« Reply #11 on: December 25, 2022, 09:54:59 PM »
Great, that makes more sense I think (the clone doesn't copy the .hg dir, it creates it).

Not sure what you mean by make needing .hg in some particular place.  Running make in the normal places inside the repo should work and .hg should always be in the repo root, you never need to move it or even think about it.

For clarity I use bash (linux via windows command prompt) On windows when you right click inside of a folder and launch the command prompt it saves the trouble of navigating to that directory within the prompt so instead of typing cd/ (change directory) you just right-click launch cmd and you are already working in that folder.

The confusion came because the clone command does not copy files to the directory you are working in, it creates a subfolder within the directory, for example I write "clone <repo>" and it puts the entire repository in a subfolder named "magic-lantern" so I simply needed to change to the newly created directory (example:) C:/development/magic-lantern then run make and all was well. I didn't see this folder before because I already had files in my root development folder that were identical to the repo minus .hg  does this make sense?

names_are_hard

  • Developer
  • Hero Member
  • *****
  • Posts: 577
  • 200D idiot
Re: .hg not found
« Reply #12 on: December 26, 2022, 01:13:55 AM »
I understand now, thanks - accidentally trying to build the old zip copy because the names were the same but different places.  Thanks for explaining, it's useful if I understand common problems with the official repo.