Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Mercurial (hg) support #197

Closed
wants to merge 34 commits into from
Closed

[feature] Mercurial (hg) support #197

wants to merge 34 commits into from

Conversation

boozook
Copy link
Contributor

@boozook boozook commented Apr 3, 2015

Implemented support for Mercurial (hg) : clone, diff, pull, update.
All behaviors for haxelib-cli look like similar for haxelib git-command.
In the future it will help to support many any version control systems.

For test:
$ haxelib hg signal https://bitbucket.org/fzzr/hx.signal develop "" 0.9.2 and
$ haxelib update signal.

hg4haxelib opt

Alex Koz added 4 commits March 31, 2015 23:45
…ike a git) :

Format is similar `git`-command: `haxelib hg libName urlToHg [branch] [subDir] [tag/revision]`

* `haxelib hg mylib https://bitbucket.org/username/mylib` - HEAD of default branch;
* `haxelib hg mylib https://bitbucket.org/username/mylib myBranch` - HEAD of myBranch;
* `haxelib hg mylib https://bitbucket.org/username/mylib myBranch mySubDir myTag`
@@ -252,7 +254,7 @@ class Main {
if (cats[i] == null) cats[i] = [c];
else cats[i].push(c);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this? We eventually want to make haxelib usable as a library (see #186), so making this global seems a step in the wrong direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static public function ask( question )
Ok, I'll move it to something like Cli or CliUtil.
And print& command too.

@back2dos
Copy link
Member

back2dos commented Apr 3, 2015

This is a good start. Personally, I think it would be great if you could manage to abstract the VCS specific stuff away into the respective implementations, as far as possible (without jumping through hoops that is).

More importantly: since this project is in such a lousy state, what would really help a lot is if you could include tests for this (ideally also for the case where the vcs in not available).

@boozook
Copy link
Contributor Author

boozook commented Apr 3, 2015

@back2dos Thx for review. I'll update this branch and all will be beauty 💯%.

@boozook
Copy link
Contributor Author

boozook commented Apr 8, 2015

I'll write tests soon.

@boozook boozook mentioned this pull request Apr 8, 2015
Alex Koz added 9 commits April 8, 2015 18:12
* fixed issue #196:
Was:
```
$ mkdir temp; cd temp; rm -r ../temp; mkdir ../temp; haxelib upgrade
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
pwd: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/usr/lib/haxe/std/neko/_std/Sys.hx:87: characters 2-24 : Error chdir upgrade
tools/haxelib/Main.hx:309: characters 17-43 : Called from
tools/haxelib/Main.hx:1508: characters 2-22 : Called from
--macro:1: character 0 : Called from
Aborted
```

Now works:
```
$ mkdir temp; cd temp; rm -r ../temp; mkdir ../temp; neko ./../haxelib.n upgrade; cd ..
Main.hx:152: constructor: cwd_cache = "/Users/ak/Repositories/haxelib/bin/temp"
Checking actuate
Checking aether
Checking air3
Checking arrowlets
...
```
@boozook
Copy link
Contributor Author

boozook commented Apr 9, 2015

I was break Git :(. I'll fix it.

@boozook
Copy link
Contributor Author

boozook commented Apr 12, 2015

@back2dos : Ready for merge. Please review.

@back2dos
Copy link
Member

It looks really quite good, but I currently cannot accept it yet, because of #204

As much as I like macros, I do think that what Vcs.staticRegistration() is doing could be quite easily achieved without such heavy artillery. I haven't thought it through, but I do wonder whether having a [VcsID.Git => new Git(), VcsID.Hg => new Hg()] isn't simple enough.

@boozook
Copy link
Contributor Author

boozook commented Apr 13, 2015

@back2dos OK?

@back2dos
Copy link
Member

Indeed :)
I'll merge this tonight!

@back2dos
Copy link
Member

Merged by hand, as it conflicted with the symlink pull request.

@back2dos back2dos closed this Apr 15, 2015
@back2dos
Copy link
Member

Oh, and thanks ;)

@boozook
Copy link
Contributor Author

boozook commented Apr 15, 2015

Thank you.

@boozook
Copy link
Contributor Author

boozook commented Apr 16, 2015

@back2dos Oh, please approve #205 - this is important.

back2dos added a commit that referenced this pull request Apr 16, 2015
Remerge #197 + test and some fixes.
@ruby0x1 ruby0x1 mentioned this pull request Apr 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants