File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ def list_changed_files_compared_to_branch(
1717
1818
1919def _get_mod (base_directory : str ) -> VCSMod :
20+ base_directory = os .path .abspath (base_directory )
2021 if os .path .exists (os .path .join (base_directory , ".git" )):
2122 from . import _git
2223
@@ -27,12 +28,14 @@ def _get_mod(base_directory: str) -> VCSMod:
2728 hg : VCSMod = _hg
2829
2930 return hg
30- elif base_directory == "/" :
31- from . import _novcs
32-
33- return _novcs
3431 else :
35- return _get_mod (os .path .dirname (base_directory ))
32+ parent = os .path .dirname (base_directory )
33+ if parent == base_directory :
34+ from . import _novcs
35+
36+ return _novcs
37+
38+ return _get_mod (parent )
3639
3740
3841def get_default_compare_branch (
Original file line number Diff line number Diff line change 11# Copyright (c) Amber Brown, 2015
22# See LICENSE for details.
33
4+ import os .path
45
56from pathlib import Path
67from subprocess import check_call
@@ -71,7 +72,7 @@ def test_hg(self):
7172 self .assertEqual (["main" , "otherbranch" ], branches )
7273
7374 self .assertEqual (
74- ["changes/ 000.misc.rst" ],
75+ [os . path . join ( "changes" , " 000.misc.rst") ],
7576 _hg .list_changed_files_compared_to_branch ("." , "main" , False ),
7677 )
7778
You can’t perform that action at this time.
0 commit comments