/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/update.py

  • Committer: Tim Marston
  • Date: 2014-04-05 17:30:19 UTC
  • Revision ID: tim@ed.am-20140405173019-5eoi82r8i3etgn4j
added file matcher (for symlink accept and/or ignore lists)

Show diffs side-by-side

added added

removed removed

71
71
                                        raise the.program.FatalError(
72
72
                                                'invalid repository name: ' + optarg )
73
73
                                the.repo = optarg
 
74
                        elif opt in [ '--verbose', '-v' ]:
 
75
                                the.verbose += 1
74
76
                        elif opt == "--help":
75
77
                                self.print_help()
76
 
 
 
78
                
77
79
                # discard first argument (the command)
78
80
                args.pop( 0 )
79
81
 
95
97
                if the.repo.vcs.has_changes():
96
98
                        raise the.program.FatalError(
97
99
                                'repo has local changes: %s\n'
98
 
                                'Hint: see "%s stage-revert --help"' %
 
100
                                'Hint: see "%s stage-revert --help"' % 
99
101
                                ( the.repo.name, the.program.name ) )
100
102
 
101
103
                # copy-in changes to repo
102
 
                deployment.copy_in()
 
104
                try:
 
105
                        deployment.copy_in()
 
106
                except deployment.CopyInConflicts as e:
 
107
                        raise the.program.FatalError(
 
108
                                'Files in %s differ too severly from %s:\n  %s\n' % \
 
109
                                ( the.home_dir, the.repo.dir, '\n  '.join( e.conflicts ) ) )
103
110
 
104
111
                # perform vcs update
105
 
                if the.verbose >= 1: print "updating %s" % the.repo.dir
 
112
                if the.verbose: print "updating %s" % the.repo.dir
106
113
                updated_files = the.repo.vcs.update()
107
114
 
108
115
                message = ''
127
134
                deployment.copy_out()
128
135
 
129
136
                # now we've copied-out, revert any copied-in changes!
130
 
                if the.verbose >= 1: print "reverting %s" % the.repo.dir
 
137
                if the.verbose: print "reverting %s" % the.repo.dir
131
138
                the.repo.vcs.revert()