Closed Bug 1494968 Opened 7 years ago Closed 7 years ago

"moz-phab submit" failure

Categories

(Conduit :: moz-phab, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: tromey, Assigned: zalun)

References

Details

Attachments

(1 file)

I tried to use "moz-phab submit" for the first time today. I followed the setup instructions and ran it in my git (I'm using git-cinnabar) repository. It said: $ moz-phab submit IOError: [Errno 20] Not a directory: '/home/tromey/firefox-git/artifact/.git/.arcconfig'
We've been discussing this on IRC: Command was run from `/home/tromey/firefox-git/artifact` $HOME is `/home/tromey/` Error is thrown from `Repository` superclass - https://github.com/mozilla-conduit/review/blob/master/moz-phab#L440 ``` DEBUG=1 moz-phab submit found git repo in /home/tromey/firefox-git/artifact Traceback (most recent call last): File "/home/tromey/bin/scripts/moz-phab", line 1501, in main repo = repo_from_args(args) File "/home/tromey/bin/scripts/moz-phab", line 422, in repo_from_args repo = probe_repo(path) File "/home/tromey/bin/scripts/moz-phab", line 400, in probe_repo return Git(path) File "/home/tromey/bin/scripts/moz-phab", line 932, in __init__ super(Git, self).__init__(path, dot_path) File "/home/tromey/bin/scripts/moz-phab", line 438, in __init__ self.phab_url = phab_url or self._phab_url() File "/home/tromey/bin/scripts/moz-phab", line 458, in _phab_url arcconfig_files, ["phabricator.uri"] File "/home/tromey/bin/scripts/moz-phab", line 198, in read_json_field with open(filename) as f: IOError: [Errno 20] Not a directory: '/home/tromey/firefox-git/artifact/.git/.arcconfig' ```
Assignee: nobody → pzalewa
Please run `moz-phab self-update` and provide the output. Check if the issue persists.
Flags: needinfo?(ttromey)
pokyo. moz-phab self-update Upgrading libphutil... Upgrading arcanist... Updated! Your copy of arc is now up to date. Update of `moz-phab` not required I can't re-test because I do not have a patch to submit.
Flags: needinfo?(ttromey)
Current directory was a git worktree one. The `.git` file is then created. `moz-phab` was looking for a file inside this directory and failed with the `ENOTDIR` instead of the `ENOENT`.
We're discovering the `.arcconfig` file by looking into a few directories, one of which is `./.git/` or `./.hg/`. If in current directory a `./.git` or `./.hg` file has been created, an `IOError` `ENOTDIR` is raised. The `./.git` file is part of any git worktree, and the user might accidentally run moz-phab from such directory. This patch is checking the way we find out if a path is a "dot path" one. The `__init__()` method of `Mercurial` and `Git` classes is now not only looking if the path exists, but also if it is a directory.
Attachment #9013992 - Attachment description: Graceful error if a .git or .hg file is present in current directory. → Check if ./.hg/ and ./.git/ are directories
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
See Also: → 1497708
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: