We propose a scheme to measure the parity of two distant qubits, while
ensuring that losses on the quantum channel between them does not destroy
coherences within the parity subspaces. This capability enables deterministic
preparation of highly entangled qubit states whose fidelity is not limited by
the transmission loss. The key observation is that for a probe electromagnetic
field in a particular quantum state, namely a superposition of two coherent
states of opposite phases, the transmission loss stochastically applies a
near-unitary back-action on the probe state. This leads to a parity measurement
protocol where the main effect of the transmission losses is a decrease in the
measurement strength. By repeating the non-destructive (weak) parity
measurement, one achieves a high-fidelity entanglement in spite of a
significant transmission loss