/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/command/status.py

  • Committer: Tim Marston
  • Date: 2016-12-13 21:40:34 UTC
  • Revision ID: tim@ed.am-20161213214034-nd5t7ztnlrjd627i
fix add command and generic filename expansion/resolution to expend to
homedir-relative filename and absolute filename based on original filename, as
specified, rather than a fully, symlink-resolved filename.  So, e.g., if ~/bob
was a symlink to ~/fred, then ~/bob/a would resolve to the relative filename
bob/a, becuase it is inside the homedir (it would resolve to fred/a otherwise)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
 
22
22
import sys, re, getopt
23
 
from .command import Command
 
23
from command import Command
24
24
import stdhome.the as the
25
25
from stdhome.deployment import Deployment
26
26
from stdhome.walker.status import StatusWalker
30
30
 
31
31
 
32
32
        def print_help( self ):
33
 
                print("Usage: " + the.program.name + " status [--repo=REPO] [FILE]...")
34
 
                print()
 
33
                print "Usage: " + the.program.name + " status [--repo=REPO] [FILE]..."
 
34
                print
35
35
                #      01234567890123456789012345678901234567890123456789012345678901234567890123456789
36
 
                print("Show the state of files in the local repository (including modifications and")
37
 
                print("conflicts).")
38
 
                print()
39
 
                print("This lists files in your home directory that have been modified and which differ")
40
 
                print("from those in the local repository.  During an update that resulted in conflicts")
41
 
                print("this also lists files which have conflicts in the local respository, or which")
42
 
                print("can not be deployed due to conflicts with your home directory.")
43
 
                print()
44
 
                print("For help with adding modified files to the repository, type:")
45
 
                print("    " + the.program.name + " add --help")
46
 
                print()
47
 
                print("Options:")
48
 
                print("  -r, --repo=REPO  select the repo to check-out or create (defaults to 'home')")
49
 
                print("  -v, --verbose    display information about what is being done")
50
 
                print("      --help       display help and exit")
 
36
                print "Show the state of files in the local repository (including modifications and"
 
37
                print "conflicts)."
 
38
                print
 
39
                print "This lists files in your home directory that have been modified and which differ"
 
40
                print "from those in the local repository.  During an update that resulted in conflicts"
 
41
                print "this also lists files which have conflicts in the local respository, or which"
 
42
                print "can not be deployed due to conflicts with your home directory."
 
43
                print
 
44
                print "For help with adding modified files to the repository, type:"
 
45
                print "    " + the.program.name + " add --help"
 
46
                print
 
47
                print "Options:"
 
48
                print "  -r, --repo=REPO  select the repo to check-out or create (defaults to 'home')"
 
49
                print "  -v, --verbose    display information about what is being done"
 
50
                print "      --help       display help and exit"
51
51
                exit( 0 )
52
52
 
53
53
 
86
86
                # initialise deployment and check if it's ongoing
87
87
                deployment = Deployment()
88
88
                if deployment.is_ongoing():
89
 
                        print("deployment ongoing")
 
89
                        print "deployment ongoing"
90
90
 
91
91
                        # check for conflicts in repo
92
92
                        files = the.repo.vcs.get_conflicts()
116
116
                                                   '\n  '.join( walker.changed )
117
117
 
118
118
                # show status
119
 
                if message: print(message.rstrip())
 
119
                if message: print message.rstrip()