Skip to content

Commit

Permalink
Cleaning up the folder of hgtags
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalrymple committed Jul 26, 2017
1 parent 5cc7699 commit 510e70a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Supported node version => 7.6.0
npm install -S hg-plus
```

To use the gitify function, you must also have python2.7.x installed as well as the shipped gitifyhg python addon.
To use the gitify function, you must also have python2.7.x, git as well as the shipped gitifyhg python addon installed.

To install the addon simply run:

```bash
Expand Down
2 changes: 1 addition & 1 deletion docs/hg.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Create a git copy of this repository using the [gitifyhg](https://github.com/buc

| Returns | Description |
|------------------------|------------------|
| Promise <String> | Console output |
| Promise | null |


```javascript
Expand Down
2 changes: 1 addition & 1 deletion docs/hgrepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Coverts Hg repo instance into a Git repo using the [gitifyhg](https://github.com

| Returns | Description |
|------------------------|------------------|
| Promise <String> | Console output |
| Promise | null |


```javascript
Expand Down
4 changes: 2 additions & 2 deletions src/Hg.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const ShortID = require('shortid');
const Path = require('path');
const Tempy = require('tempy');
const Globby = require('globby');
const { URL } = require('url');
const Promise = require('bluebird');
const HgRepo = require('./HgRepo');
const Command = require('./Command');
const Utils = require('./Utils');
const { URL } = require('url');
const Promise = require('bluebird');

async function getSourceInfo(source, pythonPath) {
let sourceRepoPath;
Expand Down
13 changes: 12 additions & 1 deletion src/HgRepo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Fs = require('fs-extra');
const Path = require('path');
const Globby = require('globby');
const Command = require('./Command');
const Utils = require('./Utils');

Expand Down Expand Up @@ -137,7 +138,17 @@ class HgRepo {

await ensureGitify(this.pythonPath);

return Command.runWithHandling(`git clone gitifyhg::${this.path} ${path}`, done);
await Command.runWithHandling(`git clone gitifyhg::${this.path} ${path}`, done);

// Remove .hgtags from each folder
const files = await Globby(['**/.hgtags'], { dot: true, cwd: path });
await Promise.all(files.map(hgpath => Fs.remove(Path.resolve(path, hgpath))));

await Command.runWithHandling('git add', path, ['-A'], done);
await Command.runWithHandling('git commit', path, ['-m "Removing .hgtags"'], done);

await Fs.remove(Path.join(path, '.git', 'hg'));
await Fs.remove(Path.join(path, '.git', 'refs', 'hg'));
}

async rename(source, destination, { after = false, force = false, include, exclude, dryRun = false } = {}, done) {
Expand Down

0 comments on commit 510e70a

Please sign in to comment.