Permalink
Browse files

In the status command report unknown packages with '?'.

Only do this when no package-regexp has been given.
  • Loading branch information...
1 parent 9138c22 commit cba728f765dda7ca5ea7aea7f6a4002d76ccc45c @mauritsvanrees committed Dec 14, 2011
Showing with 17 additions and 1 deletion.
  1. +4 −0 docs/HISTORY.txt
  2. +13 −1 src/mr/developer/develop.py
View
4 docs/HISTORY.txt
@@ -4,6 +4,10 @@ Changelog
1.20 - Unreleased
-----------------
+* In the status command report unknown packages with '?' when no
+ package-regexp has been given.
+ [maurits]
+
* Added --force option to purge command. Especially helpful in
purging non-subversion packages, which otherwise we refuse to
remove. Fixes issue #71.
View
14 src/mr/developer/develop.py
@@ -611,6 +611,7 @@ def __init__(self, develop):
'~' not in auto-checkout list
'!' in auto-checkout list, but not checked out
'C' the repository URL doesn't match
+ '?' unknown package (only reported when package-regexp is not specified)
The second column shows the working copy status:
' ' no changes
'M' local modifications or untracked files
@@ -642,18 +643,22 @@ def __init__(self, develop):
def __call__(self, args):
auto_checkout = self.develop.auto_checkout
+ sources_dir = self.develop.sources_dir
develeggs = self.develop.develeggs
- packages = self.get_packages(getattr(args, 'package-regexp'),
+ package_regexp = getattr(args, 'package-regexp')
+ packages = self.get_packages(package_regexp,
auto_checkout=args.auto_checkout,
checked_out=args.checked_out,
develop=args.develop)
workingcopies = WorkingCopies(self.develop.sources)
+ paths = []
for name in sorted(packages):
source = self.develop.sources[name]
if not source.exists():
if name in auto_checkout:
print "!", " ", name
continue
+ paths.append(source['path'])
if not workingcopies.matches(source):
print "C",
else:
@@ -698,6 +703,12 @@ def __call__(self, args):
print " ", line
print
+ # Only report on unknown entries when we have no package regexp.
+ if not package_regexp:
+ for entry in os.listdir(sources_dir):
+ if not os.path.join(sources_dir, entry) in paths:
+ print '?', ' ', entry
+
class CmdUpdate(Command):
def __init__(self, develop):
@@ -785,6 +796,7 @@ def __call__(self, **kwargs):
root_logger.setLevel(logging.INFO)
extension = Extension(buildout)
self.sources = extension.get_sources()
+ self.sources_dir = extension.get_sources_dir()
self.auto_checkout = extension.get_auto_checkout()
self.always_checkout = extension.get_always_checkout()
self.always_accept_server_certificate = extension.get_always_accept_server_certificate()

0 comments on commit cba728f

Please sign in to comment.